diff options
-rw-r--r-- | extra/gcc-uClibc/Makefile | 5 | ||||
-rw-r--r-- | extra/gcc-uClibc/gcc-uClibc.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile index a1a5c21df..b54c5eadc 100644 --- a/extra/gcc-uClibc/Makefile +++ b/extra/gcc-uClibc/Makefile @@ -2,6 +2,10 @@ TOPDIR = ../../ include $(TOPDIR)Rules.mak +# NOTE: This may need to be modified on each system. +# If your default dynamic linker works, comment this out. +DYNAMIC_LINKER = /lib/ld-linux.so.1 + UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd)) GCC_BIN = $(CC) GCC_LIB = $(shell $(CC) -print-libgcc-file-name ) @@ -25,6 +29,7 @@ gcc-uClibc.h: clean echo "#define GCC_LIB " \"$(GCC_LIB)\" >> gcc-uClibc.h echo "#define GCC_INCDIR " \"-I$(GCCINCDIR)/\" >> gcc-uClibc.h echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h + echo "#define DYNAMIC_LINKER " \"$(DYNAMIC_LINKER)\" >> gcc-uClibc.h gcc-uClibc-native: gcc-uClibc.h gcc-uClibc.c # uClibc built for native environment, so why not use it ;-) diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c index 55004f935..c29f351c4 100644 --- a/extra/gcc-uClibc/gcc-uClibc.c +++ b/extra/gcc-uClibc/gcc-uClibc.c @@ -123,7 +123,7 @@ int main(int argc, char **argv) } } if (use_stdlib) { - gcc_argv[i++] = "-nostdlib"; + gcc_argv[i++] = nostdlib; if (use_static_linking) { if (debugging) { gcc_argv[i++] = UCLIBC_LIB_G; @@ -131,6 +131,10 @@ int main(int argc, char **argv) gcc_argv[i++] = UCLIBC_LIB; } } else { + if (DYNAMIC_LINKER[0]) { /* not empty string */ + gcc_argv[i++] = "-Wl,--dynamic-linker"; + gcc_argv[i++] = DYNAMIC_LINKER; + } if (debugging) { gcc_argv[i++] = UCLIBC_SHAREDLIB_G; } else { |