Update build system for better Clang behavior on Mac.
Change-Id: I1813954681b670807d7e3faaf6d5f5a769cc5f2e
This commit is contained in:
parent
488b23d96d
commit
d318ba66f9
3 changed files with 16 additions and 8 deletions
|
@ -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 :=
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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)) \
|
||||
|
|
Loading…
Reference in a new issue