diff options
Diffstat (limited to 'extra/gcc-uClibc')
-rw-r--r-- | extra/gcc-uClibc/Makefile | 1 | ||||
-rw-r--r-- | extra/gcc-uClibc/gcc-uClibc.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile index 59b71790b..11e2d19e1 100644 --- a/extra/gcc-uClibc/Makefile +++ b/extra/gcc-uClibc/Makefile @@ -19,6 +19,7 @@ gcc-uClibc.h: $(TOPDIR)/Config @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 + @echo "#define BUILD_DYNAMIC_LINKER " \"$(BUILD_DYNAMIC_LINKER)\" >> gcc-uClibc.h gcc-uClibc: gcc-uClibc.h gcc-uClibc.c gcc -Wall -O2 -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c index b5a392086..a114160d5 100644 --- a/extra/gcc-uClibc/gcc-uClibc.c +++ b/extra/gcc-uClibc/gcc-uClibc.c @@ -118,8 +118,10 @@ int main(int argc, char **argv) int i, j; char ** gcc_argv; char *dlstr; + char *build_dlstr; char *ep; + build_dlstr = "-Wl,--dynamic-linker," BUILD_DYNAMIC_LINKER; dlstr = getenv("UCLIBC_GCC_DLOPT"); if (!dlstr) { dlstr = "-Wl,--dynamic-linker," DYNAMIC_LINKER; @@ -216,7 +218,9 @@ int main(int argc, char **argv) } if (linking && source_count) { if (!use_static_linking) { - if (dlstr) { + if (dlstr && use_build_dir) { + gcc_argv[i++] = build_dlstr; + } else if (dlstr) { gcc_argv[i++] = dlstr; } if (use_rpath) { |