[U-Boot-Users] gcc print-libgcc-file-name

Scott McNutt ScottM at Orbacom.com
Wed Oct 1 21:33:51 CEST 2003


The path to libgcc.a may be different based on gcc options. For
example:

$ powerpc-eabi-gcc -print-libgcc-file-name
/usr/local/xtools/lib/gcc-lib/powerpc-eabi/3.2.1/libgcc.a

$ powerpc-eabi-gcc -print-libgcc-file-name -msoft-float
/usr/local/xtools/lib/gcc-lib/powerpc-eabi/3.2.1/nof/libgcc.a

In some cases this can cause problems. In my case, the
nios-elf-gcc path defaults to the 16-bit library (which results
in a link-time failure). I need to include the -m32 flag to get
the correct path to the 32-bit library.

In the top-level Makefile, it seems the following would be
preferred:

PLATFORM_LIBS += -L $(shell dirname `$(CC) $(PLATFORM_CPPFLAGS)
-print-libgcc-file-name`) -lgcc

over something like:

ifeq ($(CPU),nios)
PLATFORM_LIBS += -L $(shell dirname `$(CC) -m32 -print-libgcc-file-name`)
-lgcc
else
PLATFORM_LIBS += -L $(shell dirname `$(CC) -print-libgcc-file-name`) -lgcc
endif

The preferred  works fine for the port I'm working on ... but
I'm concerned about causing problems for other architectures/boards.

Comments/suggestions welcome.

--Scott







More information about the U-Boot mailing list