toolchain: make target gcc a working option
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Wed, 13 Apr 2011 16:29:28 +0000 (13:29 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 26 Apr 2011 20:43:44 +0000 (22:43 +0200)
Make target gcc a more usable option.

* Nuke duplicate libgcc_s*.so* in /usr/lib since it confuses target gcc
* Copy *crt*.o files to the target system to unbreak gcc

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
toolchain/gcc/gcc-uclibc-4.x.mk

index 96bebd616ce95438dd521ca04c7b862ed6bf039d..04b21e9f11804feede7bd06693451622dc59a415 100644 (file)
@@ -550,12 +550,17 @@ $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR4)/.compiled
                cp -f $(HOST_DIR)/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h \
                        $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/; \
        fi
+
        # Make sure we have 'cc'.
        if [ ! -e $(TARGET_DIR)/usr/bin/cc ]; then \
                ln -snf gcc $(TARGET_DIR)/usr/bin/cc; \
        fi
+
+       # Copy C runtime initialization object files
+       cp -f $(STAGING_DIR)/usr/lib/*crt*.o $(TARGET_DIR)/usr/lib
+
        # These are in /lib, so...
-       #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
+       rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
        touch -c $@
 
 gcc_target: $(STAMP_DIR)/gcc_libs_target_installed $(GCC_TARGET_PREREQ) binutils $(TARGET_DIR)/usr/bin/gcc