summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/gcc-uClibc/Makefile5
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile
index 249de0367..ba6139a43 100644
--- a/extra/gcc-uClibc/Makefile
+++ b/extra/gcc-uClibc/Makefile
@@ -32,6 +32,11 @@ ifeq ($(strip $(HAS_MMU)),true)
else
@echo "#undef HAS_MMU" >> gcc-uClibc.h
endif
+ifeq ($(strip $(HAS_ELF)),true)
+ @echo "#define HAS_ELF 1" >> gcc-uClibc.h
+else
+ @echo "#undef HAS_ELF" >> gcc-uClibc.h
+endif
gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
gcc -Wall -O2 -Wl,-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 a16349626..76798fee2 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -322,7 +322,7 @@ int main(int argc, char **argv)
}
if (linking && source_count) {
-#ifndef HAS_MMU
+#if defined HAVE_ELF && ! defined HAS_MMU
gcc_argv[i++] = "-Wl,-elf2flt";
#endif
if (use_stdlib) {