]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - toolchain/toolchain-wrapper.mk
log4cplus: add C++11 dependencies
[coffee/buildroot.git] / toolchain / toolchain-wrapper.mk
1 ################################################################################
2 #
3 # definition of the toolchain wrapper build commands
4 #
5 ################################################################################
6
7 # We use --hash-style=both to increase the compatibility of the generated
8 # binary with older platforms, except for MIPS, where the only acceptable
9 # hash style is 'sysv'
10 ifeq ($(findstring mips,$(HOSTARCH)),mips)
11 TOOLCHAIN_WRAPPER_HASH_STYLE = sysv
12 else
13 TOOLCHAIN_WRAPPER_HASH_STYLE = both
14 endif
15
16 TOOLCHAIN_WRAPPER_ARGS = $($(PKG)_TOOLCHAIN_WRAPPER_ARGS)
17 TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'
18
19 # We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a
20 # separate argument when used in execv() by the toolchain wrapper.
21 TOOLCHAIN_WRAPPER_OPTS = \
22         $(foreach f,$(call qstrip,$(BR2_TARGET_OPTIMIZATION)),"$(f)"$(comma))
23 TOOLCHAIN_WRAPPER_ARGS += -DBR_ADDITIONAL_CFLAGS='$(TOOLCHAIN_WRAPPER_OPTS)'
24
25 ifeq ($(BR2_CCACHE),y)
26 TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE
27 endif
28
29 ifeq ($(BR2_x86_x1000),y)
30 TOOLCHAIN_WRAPPER_ARGS += -DBR_OMIT_LOCK_PREFIX
31 endif
32
33 # Avoid FPU bug on XBurst CPUs
34 ifeq ($(BR2_mips_xburst),y)
35 # Before gcc 4.6, -mno-fused-madd was needed, after -ffp-contract is
36 # needed
37 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
38 TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
39 else
40 TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
41 endif
42 endif
43
44 ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
45 TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
46 endif
47
48 define TOOLCHAIN_WRAPPER_BUILD
49         $(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_WRAPPER_ARGS) \
50                 -s -Wl,--hash-style=$(TOOLCHAIN_WRAPPER_HASH_STYLE) \
51                 toolchain/toolchain-wrapper.c \
52                 -o $(@D)/toolchain-wrapper
53 endef
54
55 define TOOLCHAIN_WRAPPER_INSTALL
56         $(INSTALL) -D -m 0755 $(@D)/toolchain-wrapper \
57                 $(HOST_DIR)/bin/toolchain-wrapper
58 endef