a more universal BOOT_CFLAGS/BOOT_LDFLAGS

Paul Jarc prj@po.cwru.edu
Tue Aug 13 11:24:00 GMT 2002


I wrote:
> While building gcc, I want to pass a certain set of flags to every
> compilation that uses a gcc we've just built.  (More accurately, I
> want to pass these flags to absolutely every compilation whatsoever,
> but for the cases where the installed gcc is used, I'm using a wrapper
> script that's ahead of the real gcc in $PATH.)

The flags I want to pass are -I, -L, -Wl,-R, and -Wl,--dynamic-linker,
so as to link to a glibc installed in a nonstandard directory.  I've
just learned about C_INCLUDE_PATH, LIBRARY_PATH, etc., so I've set
those, and I've included the -Wl, options in CFLAGS, LDFLAGS, XCFLAGS,
TCFLAGS, STAGE1_CFLAGS, and BOOT_CFLAGS.  Most things work, but unless
I use --enable-languages to exclude java, I get this error:

/home/prj/src/sptools/gcc-3.1-2-build/gcc/gcj -B/home/prj/src/sptools/gcc-3.1-2-build/i686-pc-linux-gnu/libjava/ -B/home/prj/src/sptools/gcc-3.1-2-build/gcc/ -ffloat-store -g -O2 -o .libs/jv-convert --main=gnu.gcj.convert.Convert -shared-libgcc  -L/home/prj/src/sptools/gcc-3.1-2-build/i686-pc-linux-gnu/libjava -L/home/prj/src/sptools/gcc-3.1-2-build/i686-pc-linux-gnu/libjava/.libs ./.libs/libgcj.so -L/home/prj/src/sptools/gcc-3.1-2-build/i686-pc-linux-gnu/libstdc++-v3/src -L/home/prj/src/sptools/gcc-3.1-2-build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -lpthread -ldl -L/home/prj/src/sptools/gcc-3.1-2-build/gcc -L/package/host/localhost/gcc-3.1-2/conf/libc/lib -lgcc_s -lc -lgcc_s -Wl,--rpath -Wl,/package/host/localhost/gcc-3.1-2/lib
/package/host/localhost/gcc-3.1-2/conf/ld: warning: ld-linux.so.2, needed by /package/host/localhost/glibc-2.2.5-1/lib/libc.so.6, not found (try using -rpath or -rpath-link)
/package/host/localhost/glibc-2.2.5-1/lib/libc.so.6: undefined reference to `_dl_lazy@GLIBC_2.1.1'
...

So what Makefile variable do I need to set to include the -Wl, options
in that command?


paul



More information about the Gcc-help mailing list