Hi David,

David McCullough wrote:
Applied (finally ;-)


You might also be interested in the attached - vendors/common/config.arch's test for --fatal-warnings support in the linker fails on non-English language Linux distros, since it just greps for a word in the error output.

This bit us on Microblaze because our linker doesn't support --fatal-warnings, but we got all these error reports from non-English speaking countries, and the build system was appending --fatal-warnings in the command line!

Cheers,

John


Jivin John Williams lays it down ...

Hi,

ucfront-ld tool chokes on the "NONE" libc option (for standalone toolchains with built-in uClibc, for example).

Dumping the environment inside config/common/config.arch, I have:

CONFIG_DEFAULTS_LIBC_NONE=y
CONFIG_LIBCDIR=

Here's what ucfront-ld says about that:

FATAL: Could not determine libc. Are $CONFIG_DEFAULTS_LIBC_... and $CONFIG_LIBCDIR set correctly?

Obviously in the LIBC_NONE case ucfront-ld doesn't have a lot to do, but one place it is used is when common/config.arch tests linker support for --fatal-warnings:

ifeq "$(shell $(LD) --fatal-warnings 2>&1 | grep 'unrecogni.ed option')" ""
           # Linker warnings are almost always a sign of badness
           LDFLAGS  += -Wl,--fatal-warnings
   endif

With LIBC_NONE, ucfront-ld doesn't get as far as invoking $(CROSS)-ld - it just pukes about LIBCDIR.

ucfront-ld assumes that if it's CONFIG_DEFAULTS_LIBC_NONE, then CONFIG_LIBCDIR should not be set. This is wrong, CONFIG_LIBCDIR is set, but empty. There's another error whereby it would pass an empty libdirectory on the command line, so we'd get

$(LD) ... -L {nothing} ...

which is also bogus.

Attached patch seems to work OK here, but I couldn't actually find any dist apps that explicitly invoke the linker - all seem to do it via $(GCC). Any comments?

Thanks,

John


Index: tools/ucfront/ucfront-ld.c
===================================================================
--- tools/ucfront/ucfront-ld.c  (revision 2231)
+++ tools/ucfront/ucfront-ld.c  (working copy)
@@ -282,6 +282,9 @@
                        x_asprintf(&libc_libdir, "%s/lib/%s", rootdir, 
config_libcdir);
                }
        }
+       else if (getenv("CONFIG_DEFAULTS_LIBC_NONE")) {
+               libtype = LIBTYPE_NONE;
+       }
        else {
fatal("Could not determine libc. Are $CONFIG_DEFAULTS_LIBC_... and $CONFIG_LIBCDIR set correctly?"); }
@@ -325,8 +328,10 @@
        if (!nostdlib) {
                args_add(stripped_args, "-nostdlib");

-               args_add(stripped_args, "-L");
-               args_add(stripped_args, libc_libdir);
+               if(libc_libdir) {
+                       args_add(stripped_args, "-L");
+                       args_add(stripped_args, libc_libdir);
+               }

                x_asprintf(&e, "%s/lib", rootdir);
                args_add(stripped_args, "-L");


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev



Index: vendors/config/common/config.arch
===================================================================
--- vendors/config/common/config.arch   (revision 2733)
+++ vendors/config/common/config.arch   (working copy)
@@ -89,8 +89,8 @@
        STL_INCDIR=$(ROOTDIR)/include/STLport
        STL_LIBDIR=$(ROOTDIR)/lib/STLport/lib
 
-       ifeq "$(shell PATH=$(PATH) $(LD) --fatal-warnings 2>&1 | grep 
'unrecogni.ed option')" ""
-               # Linker warnings are almost always a sign of badness
-               LDFLAGS  += -Wl,--fatal-warnings
-       endif
+       # Some make-foo to add the --fatal-warnings linker option, if supported
+       # (with thanks to Kbuild in 2.6)
+       LDFLAGS += $(shell if $(CC) -Wl,--fatal-warnings -nostdlib -xc 
/dev/null -o /tmp/$$$$.out > /dev/null 2>&1; then echo "-Wl,--fatal-warnings"; 
rm /tmp/$$$$.out; fi;)
+               
 endif
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to