OSDN Git Service

Patch from Konrad Eisele to omit -Wl,--dynamic-linker from
authorEric Andersen <andersen@codepoet.org>
Wed, 5 Mar 2003 10:55:31 +0000 (10:55 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 5 Mar 2003 10:55:31 +0000 (10:55 -0000)
the gcc wrapper when not building with shared library support.

extra/gcc-uClibc/Makefile
extra/gcc-uClibc/gcc-uClibc.c

index e312d17..ff60a20 100644 (file)
@@ -24,6 +24,11 @@ gcc-uClibc.h: Makefile $(TOPDIR)/.config
        @echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
        @echo "#define DYNAMIC_LINKER " \"$(DYNAMIC_LINKER)\" >> gcc-uClibc.h
        @echo "#define BUILD_DYNAMIC_LINKER " \"$(UCLIBC_DIR)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
+ifeq ($(strip $(HAVE_SHARED)),y)
+       @echo "#define __UCLIBC_HAS_SHARED__ 1" >> gcc-uClibc.h
+else
+       @echo "#undef __UCLIBC_HAS_SHARED__" >> gcc-uClibc.h
+endif
 ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
        @echo "#define __UCLIBC_HAS_MMU__ 1" >> gcc-uClibc.h
 else
index 5b002b9..b283ed0 100644 (file)
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
        char *devprefix;
        char *builddir;
        char *libstr;
-       char *build_dlstr;
+       char *build_dlstr = 0;
        char *ep;
        char *rpath_link[2];
        char *rpath[2];
@@ -220,11 +220,13 @@ int main(int argc, char **argv)
        xstrcat(&(our_lib_path[0]), "-L", devprefix, "/lib", NULL);
        xstrcat(&(our_lib_path[1]), "-L", builddir, "/lib", NULL);
 
+#ifdef __UCLIBC_HAS_SHARED__
        build_dlstr = "-Wl,--dynamic-linker," BUILD_DYNAMIC_LINKER;
        dlstr = getenv("UCLIBC_GCC_DLOPT");
        if (!dlstr) {
                dlstr = "-Wl,--dynamic-linker," DYNAMIC_LINKER;
        }
+#endif
 
        ep = getenv("UCLIBC_GCC");
        if (!ep) {