adding custom CFLAGS

Bernhard Fischer rep.nop at aon.at
Fri Oct 20 01:02:03 PDT 2006


On Thu, Oct 19, 2006 at 08:52:11PM +0200, Denis Vlasenko wrote:
>On Wednesday 18 October 2006 18:58, Bernhard Fischer wrote:
>> On Wed, Oct 18, 2006 at 12:24:53PM -0400, Rob Landley wrote:
>> >On Wednesday 18 October 2006 12:25 am, Larry Brigman wrote:
>> >> I have tracked down all my troubles to a tool chain issue.
>> >> In using 1.1.2 I was able to use a custom CFLAGS variable
>> >> that would allow me to point busybox to the cross compile tool
>> >> chain includes and libraries.
>> >> 
>> >> The current version does not allow these options.
>> >
>> >By "current version" to you mean 1.2.1, or svn?
>> >
>> >> How do I get that functionality back without reverting back
>> >> to the older version?
>> >
>> >Hmmm...  We added ":=" to avoid recalculating lots of check_gcc() macros 
>> >(which is PAINFULLY slow, and largely there so Bernhard can keep an old Tru64 
>> >system upright through various necromantic rituals).  Unfortunately, this is 
>> 
>> ;) Well, i added the "hosttools" make target for Tru64, and i added the
>> check_cc and check_ld to
>> a) support several versions of gcc, each of which may support one flag
>>    but not another
>> b) to support folks that don't use gcc but other compilers
>> 
>> Those two latter additions are not really entangled with True64, just as
>> a sidenote.
>> 
>> The current (i.e. svn) Make stuff currently does bomb a) as well as b)
>> back to the stoneage, but i guess that's ok for a (re-)start of the
>> build infrastructure. (anyone ran hosttools or check recently?)
>
>(looking into it...)  Aha, so check_gcc is called cc-option now,
>and seems to support $(CC) too. So (a) and (b) should be achievable.
>
>What option do you need to check?

All flags that are passed to the toolchain need to be checked since you
cannot even rely on e.g. the compiler to understand any of these
currently hardcoded flags.
Of course newly checked flags have to be _added_ to the already
positively checked flags (we didn't do this in the old checks out of
lazyness) to ensure that the combination of the flags are supported.
>
>> >Makefiles are evil.  I am _so_ glad this is not my problem anymore.  Denis 
>> >replaced this mess entirely, which means they'll be re-fixing old bugs for a 
>> >while but hopefully have a better general infrastructure now...
>
>I am scheduled to attack "build system does not detect usage of USE/SKIP/ENABLE_xxx"
>today.
>
>> well, make check barfs on a couple of tests, misses to detect the
>> correct applet order, thinks that busybox and grep and pidof as well as
>> readlink and sed and seq and sort and unzip and uuencode et al are
>> built.
>> 
>> ls -l and ls -s produce different output (regression compared to 1.2.1)
>> than GNU coreutils's ls.
>
>I just diffed ls.c between current and 1.2.1 and there is no
>significant differences. Output is also identical and different from
>GNU ls -l in the amount of whitespace used:

Yes, IIRC this wasn't the case earler (don't know offhand).

>> which(1) is broken (saving 84 bytes is a nice thing to have, but only
>> iff it still works afterwards;)
>
># ./busybox which cat
>/bin/cat
># ./busybox which smbclient
>/usr/bin/smbclient
>
>I see no apparent bug, need more info on this.

do a make check
and watch out for testsuite/which/which-uses-default-path

hm. Could it be the dependencies don't work right?
$ (make mrproper ; make allnoconfig ; make) > /dev/null
$ ./busybox 2>&1 | awk '/^Curr/{i=1;};{if(i>0){print}}' 
Currently defined functions:
        busybox

$ mv .config .config.in;(cat .config.in | egrep -v WHICH ; echo CONFIG_WHICH=y) > .config
$ make
scripts/kconfig/conf -s Config.in
#
# using defaults found in .config
#
  SPLIT   include/autoconf.h -> include/config/*
  GEN     include/bbconfigopts.h
  GEN     include/usage_compressed.h
  CC      debianutils/which.o
  AR      debianutils/lib.a
  LINK    busybox_unstripped
$ ./busybox 2>&1 | awk '/^Curr/{i=1;};{if(i>0){print}}'
Currently defined functions:
        busybox


which is wrong.

And indeed:
$ touch applets/*.c ; make
  CC      applets/applets.o
  CC      applets/busybox.o
  LD      applets/built-in.o
  LINK    busybox_unstripped
$ ./busybox 2>&1 | awk '/^Curr/{i=1;};{if(i>0){print}}'
Currently defined functions:
        busybox, which

$ wth?^C


More information about the busybox mailing list