[BusyBox 0001438]: [patch] fix assumptions the build environment is Linux

bugs at busybox.net bugs at busybox.net
Mon Jul 23 10:17:07 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1438 
====================================================================== 
Reported By:                mirabilos
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1438
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             07-20-2007 05:41 PDT
Last Modified:              07-23-2007 03:17 PDT
====================================================================== 
Summary:                    [patch] fix assumptions the build environment is
Linux
Description: 
• not all systems have /bin/bash

• compressed usage generation does not work if the target sy-
  stem deviates from the build system too much: busybox itself
  includes several Linux headers, which obviously aren't existent
  on a real UNIX® system from which buxybox is cross-compiled;
  disabling compressed usage was not enough, since the utility
  programme was still built (I'd be glad if you have a better
  fix, since like this you still have to define a variable)

====================================================================== 

---------------------------------------------------------------------- 
 vapier - 07-20-07 15:37  
---------------------------------------------------------------------- 
no, not all systems have /bin/bash, but trylink is a POSIX shell script and
all systems must have a /bin/sh

as for usage, it builds fine for me on OS X so i dont know what your
trouble is, but simply disabling it in the Makefile is incorrect 

---------------------------------------------------------------------- 
 vda - 07-21-07 07:39  
---------------------------------------------------------------------- 
-#!/bin/sh
+#!/usr/bin/env bash

Can you fix bash-isms in trylink instead, so that it runs under your
shell. Which one do you use?

>compressed usage generation does not work

Then proprly #ifdef out relevant pieces conditionally on
FEATURE_COMPRESS_USAGE. (We are a bit lax with it now, yes.) Your patch is
a quick hack 

---------------------------------------------------------------------- 
 mirabilos - 07-21-07 09:09  
---------------------------------------------------------------------- 
I'll see to the bashisms - when looking now, I don't see
them either. Maybe the script changed in the meantime, I
think that part was first done for 1.2.x or so.

Regarding the "compressed help" stuff: even if disabling
the "compressed help" option, it still tries to build a
host programme (helper) which breaks on BSD (but I will
try again without that diff if you think it shouldn't). 

---------------------------------------------------------------------- 
 mirabilos - 07-23-07 03:17  
---------------------------------------------------------------------- 
This is the problem with compressed help:

  gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer     
-I/home/.data/tg/svn/trunk/freewrt/build_mipsel/w-busybox-1.4.2-24/busybox-1.4.2/include
-o applets/usage applets/usage.c
applets/usage.c:0: note: someone does not honour COPTS correctly, passed 0
times
In file included from applets/../include/libbb.h:13,
                 from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
applets/../include/platform.h:93:23: byteswap.h: No such file or
directory
applets/../include/platform.h:94:21: endian.h: No such file or directory
In file included from applets/../include/libbb.h:13,
                 from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
applets/../include/platform.h:132: error: conflicting types for
'socklen_t'
/usr/include/sys/types.h:109: error: previous declaration of 'socklen_t'
was here
In file included from applets/../include/libbb.h:20,
                 from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
/usr/include/malloc.h:4:2: warning: #warning "<malloc.h> is obsolete, use
<stdlib.h>"
In file included from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
applets/../include/libbb.h:33:24: sys/statfs.h: No such file or directory
In file included from applets/../include/libbb.h:53,
                 from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
applets/../include/grp_.h:44: error: conflicting types for 'setgroups'
/usr/include/unistd.h:202: error: previous declaration of 'setgroups' was
here
applets/../include/grp_.h:44: error: conflicting types for 'setgroups'
/usr/include/unistd.h:202: error: previous declaration of 'setgroups' was
here
In file included from applets/../include/busybox.h:10,
                 from applets/usage.c:5:
applets/../include/libbb.h:285: warning: "struct sockaddr_in" declared
inside parameter list
applets/../include/libbb.h:296: error: field `sin' has incomplete type
applets/../include/libbb.h:298: error: field `sin6' has incomplete type
gmake[4]: *** [applets/usage] Error 1

That's why I had to disable building that helper programme. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-20-07 05:41  mirabilos      New Issue                                    
07-20-07 05:41  mirabilos      Status                   new => assigned     
07-20-07 05:41  mirabilos      Assigned To               => BusyBox         
07-20-07 05:41  mirabilos      File Added: 950-unportability.patch              
     
07-20-07 15:37  vapier         Note Added: 0002610                          
07-21-07 07:39  vda            Note Added: 0002615                          
07-21-07 09:09  mirabilos      Note Added: 0002622                          
07-23-07 03:17  mirabilos      Note Added: 0002629                          
======================================================================




More information about the busybox-cvs mailing list