summaryrefslogtreecommitdiff
path: root/extra/gcc-uClibc
diff options
context:
space:
mode:
Diffstat (limited to 'extra/gcc-uClibc')
-rw-r--r--extra/gcc-uClibc/Makefile5
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile
index faf4e5c75..62ab6c8ee 100644
--- a/extra/gcc-uClibc/Makefile
+++ b/extra/gcc-uClibc/Makefile
@@ -27,6 +27,11 @@ gcc-uClibc.h: $(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 $(HAS_MMU)),true)
+ @echo "#define HAS_MMU 1" >> gcc-uClibc.h
+else
+ @echo "#undef HAS_MMU" >> 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 16fdd2f71..a16349626 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -322,6 +322,9 @@ int main(int argc, char **argv)
}
if (linking && source_count) {
+#ifndef HAS_MMU
+ gcc_argv[i++] = "-Wl,-elf2flt";
+#endif
if (use_stdlib) {
gcc_argv[i++] = nostdlib;
}