This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is it a cross-compiler problem?


"Xiaogeng (Shawn) Jin" wrote:
> I tried to use the cross gcc-2.95.3 that I built to compile
> busybox-0.60.1 and have a very strange problem.
> 
> I just followed the instructions
> (http://billgatliff.com/twiki/bin/view/Crossgcc/BuildToolchainScript)
> step by step to build my cross gcc (powerpc-linux). It looks successful.
> But when using it to compile busybox-0.60.1's 'mount.c', I encountered
> an error message
> (http://www.geocities.com/shawnxjin/crossgcc/rs-bb.txt). It complains
> that 'PATH_MAX' is not definied, which is defined in <linux/limits.h> ...

Have a look at the busybox changlog.  They have accepted patches to address
this for some of their source files on systems where PATH_MAX is strangely
defined not in limits.h but in sys/param.h.  Here's the patch I use:

http://www.kegel.com/linux/busybox_path_max.patch

to get it to compile with Montavista Hard Hat Linux 2.0.

If ELDK doesn't need that, great, it's more standards-compliant.

> It seems to me that somehow
> my cross gcc didn't define '_POSIX_SOURCE' or '_GNU_SOURCE', which is
> supposed to be defined by user or compiler.

I think you can strike the '... or compiler' from that.  I haven't
seen any compiler that defines those.

> These two macros will turn
> on '__USE_POSIX", which in turn includes <bits/posix1_lim.h> in
> <limits.h>. The more strange thing is that even if I add
> "-D_POSIX_SOURCE" or "_D_GNU_SOURCE", it doesn't work.

I notice that busybox 0.60.2 turns on the -D_GNU_SOURCE flag in its Makefile,
and I get PATH_MAX as expected.  Maybe you should upgrade to the newer
busybox...

Oddly, when compiling
#include <limits.h>
echo path_max is PATH_MAX
echo line_max is LINE_MAX
with gcc -E, I now always get a value for both, even without -D_GNU_SOURCE
Not sure why I needed to patch busybox.  Oh, well...
- Dan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]