diff --git a/core/clang/config.mk b/core/clang/config.mk index 94dcdb04c4..8aa48a8d24 100644 --- a/core/clang/config.mk +++ b/core/clang/config.mk @@ -33,10 +33,10 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \ -Wno-unused-but-set-parameter # Clang flags for all host rules -CLANG_CONFIG_HOST_EXTRA_ASFLAGS := --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) -CLANG_CONFIG_HOST_EXTRA_CFLAGS := --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) -CLANG_CONFIG_HOST_EXTRA_CPPFLAGS := --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) -CLANG_CONFIG_HOST_EXTRA_LDFLAGS := --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) +CLANG_CONFIG_HOST_EXTRA_ASFLAGS := +CLANG_CONFIG_HOST_EXTRA_CFLAGS := +CLANG_CONFIG_HOST_EXTRA_CPPFLAGS := +CLANG_CONFIG_HOST_EXTRA_LDFLAGS := # Clang flags for all target rules CLANG_CONFIG_TARGET_EXTRA_ASFLAGS := diff --git a/core/clang/x86_common.mk b/core/clang/x86_common.mk index d75d83f0af..bce95cb703 100644 --- a/core/clang/x86_common.mk +++ b/core/clang/x86_common.mk @@ -13,17 +13,21 @@ HOST_ARCH_DESCRIPTOR_FOR_CLANG := i686-linux endif CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS := \ + --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$(HOST_TOOLCHAIN_FOR_CLANG)/sysroot -CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS := +CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS := \ + --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) \ CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \ + --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$(HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ -isystem $(HOST_TOOLCHAIN_FOR_CLANG)/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG)/include/c++/4.6.x-google \ -isystem $(HOST_TOOLCHAIN_FOR_CLANG)/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG)/include/c++/4.6.x-google/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG) \ -isystem $(HOST_TOOLCHAIN_FOR_CLANG)/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG)/include/c++/4.6.x-google/backward \ CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \ + --gcc-toolchain=$(HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$(HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ -B$(HOST_TOOLCHAIN_FOR_CLANG)/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG)/bin \ -B$(HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/$(HOST_ARCH_DESCRIPTOR_FOR_CLANG)/4.6.x-google \ diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk index 994196a1b2..b819f36cb3 100644 --- a/core/combo/HOST_darwin-x86.mk +++ b/core/combo/HOST_darwin-x86.mk @@ -123,7 +123,9 @@ define transform-host-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -dynamiclib -single_module -read_only_relocs suppress \ $(HOST_GLOBAL_LD_DIRS) \ - $(HOST_GLOBAL_LDFLAGS) \ + $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ + $(PRIVATE_HOST_GLOBAL_LDFLAGS) \ + ) \ $(PRIVATE_ALL_OBJECTS) \ $(addprefix -force_load , $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ @@ -140,9 +142,11 @@ define transform-host-o-to-executable-inner $(hide) $(PRIVATE_CXX) \ -Wl,-rpath,@loader_path/../lib \ -o $@ \ - $(PRE_LION_DYNAMIC_LINKER_OPTIONS) -headerpad_max_install_names \ + $(PRE_LION_DYNAMIC_LINKER_OPTIONS) -Wl,-headerpad_max_install_names \ $(HOST_GLOBAL_LD_DIRS) \ - $(HOST_GLOBAL_LDFLAGS) \ + $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ + $(PRIVATE_HOST_GLOBAL_LDFLAGS) \ + ) \ $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ $(PRIVATE_ALL_OBJECTS) \ $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \