6 --with-headers
=$(TOOLCHAIN_DIR
)/include \
7 --enable-languages
=$(TARGET_LANGUAGES
) \
10 --with-slibdir
=$(TOOLCHAIN_DIR
)/lib \
13 --with-libelf
=$(STAGING_DIR_HOST
)
15 ifndef CONFIG_USE_GLIBC
16 GCC_CONFIGURE
+= --disable-libsanitizer
20 GCC_MAKE
+= gcc_cv_libc_provides_ssp
=yes
23 ifneq ($(CONFIG_SJLJ_EXCEPTIONS
),)
25 --enable-sjlj-exceptions
28 define CleanupToolchain
29 $(INSTALL_DIR
) $(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)
30 # Important! Required for limits.h to be fixed.
31 rm -rf
$(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)/sys-include
32 ln
-sf ..
/include $(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)/sys-include
33 rm -rf
$(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
34 ln
-sf ..
/lib
$(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
35 $(if
$(CONFIG_ARCH_64BIT
),ln
-sf ..
/lib64
$(TOOLCHAIN_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib64
)
40 mkdir
-p
$(GCC_BUILD_DIR
)
41 (cd
$(GCC_BUILD_DIR
) && rm -f config.cache
; \
46 ifeq ($(CONFIG_USE_GLIBC
)$(CONFIG_INSTALL_GCCGO
),yy
)
48 # link crtX.o for gotools
49 mkdir
-p
$(GCC_BUILD_DIR
)/gotools
50 $(foreach crt
, i
1 n
, ln
-sf ..
/..
/glibc-dev
/lib
/crt
$(crt
).o
$(GCC_BUILD_DIR
)/gotools
/ ; )
56 +$(GCC_MAKE
) $(HOST_JOBS
) -C
$(GCC_BUILD_DIR
) all
60 for app in
$(TOOLCHAIN_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)*-{gcc
,gcc-
*,g
++}; do \
61 [ -e
$$$$app ] || continue
; \
62 old_base
=$$$$(basename $$$$app); \
63 new_base
=$(call qstrip
,$(CONFIG_EXTRA_TARGET_ARCH_NAME
))-$$$${old_base
##$(OPTIMIZE_FOR_CPU)-}; \
64 sed
-e
"s/@CC_BASE@/$$$$old_base/" \
65 -e
's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \
66 ..
/files
/alternate-arch-cc.in
> \
67 $(TOOLCHAIN_DIR
)/bin
/$$$$new_base; \
68 chmod a
+x
$(TOOLCHAIN_DIR
)/bin
/$$$$new_base; \
74 +$(GCC_MAKE
) $(HOST_JOBS
) -C
$(GCC_BUILD_DIR
) install
75 # Set up the symlinks to enable lying about target name.
77 (cd
$(TOOLCHAIN_DIR
); \
78 ln
-sf
$(REAL_GNU_TARGET_NAME
) $(GNU_TARGET_NAME
); \
80 for app in
$(REAL_GNU_TARGET_NAME
)-* ; do \
82 $(GNU_TARGET_NAME
)$$$${app
##$(REAL_GNU_TARGET_NAME)}; \
85 $(if
$(CONFIG_EXTRA_TARGET_ARCH
),$(call SetupExtraArch
))
86 $(RM
) $(TOOLCHAIN_DIR
)/lib
/libiberty.a
87 $(SCRIPT_DIR
)/patch-specs.sh
"$(TOOLCHAIN_DIR)"
90 $(eval
$(call HostBuild
))