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

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

In message 1B1B671D73FED2119B1000A0C9B8A9600108EC83@ORBNET you wrote:
The path to libgcc.a may be different based on gcc options. For example:
...
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
...
The preferred works fine for the port I'm working on ... but I'm concerned about causing problems for other architectures/boards.
This has already been addresses in a patch by David Müller of 22 Sep which I checked in today.
I think this solves the problem. Please correct me if I'm wrong.
Best regards,
Wolfgang Denk
participants (2)
-
Scott McNutt
-
Wolfgang Denk