mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 03:03:22 -03:00
cctools: fixup building with LTO
Use lto.h from clang+llvm not libtapi. The later is older, and comes bundled with the libtapi repo. Copy libLTO.so when building with FORCE_USE_SYSTEM_CLANG.
This commit is contained in:
parent
1abbae65eb
commit
9b60690b94
4 changed files with 15 additions and 3 deletions
|
@ -17,6 +17,7 @@ darwin_native_toolchain=native_cctools
|
||||||
|
|
||||||
clang_prog=$(build_prefix)/bin/clang
|
clang_prog=$(build_prefix)/bin/clang
|
||||||
clangxx_prog=$(clang_prog)++
|
clangxx_prog=$(clang_prog)++
|
||||||
|
llvm_config_prog=$(build_prefix)/bin/llvm-config
|
||||||
|
|
||||||
clang_resource_dir=$(build_prefix)/lib/clang/$(native_clang_version)
|
clang_resource_dir=$(build_prefix)/lib/clang/$(native_clang_version)
|
||||||
else
|
else
|
||||||
|
@ -34,8 +35,10 @@ darwin_native_toolchain=
|
||||||
# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
|
# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
|
||||||
clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
|
clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
|
||||||
clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
|
clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
|
||||||
|
llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config")
|
||||||
|
|
||||||
clang_resource_dir=$(shell clang -print-resource-dir)
|
clang_resource_dir=$(shell clang -print-resource-dir)
|
||||||
|
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL
|
cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL
|
||||||
|
|
|
@ -16,9 +16,17 @@ define $(package)_set_vars
|
||||||
$(package)_cxx=$(clangxx_prog)
|
$(package)_cxx=$(clangxx_prog)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
|
||||||
|
define $(package)_preprocess_cmds
|
||||||
|
mkdir -p $($(package)_staging_prefix_dir)/lib && \
|
||||||
|
cp $(llvm_lib_dir)/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
||||||
|
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools
|
||||||
|
endef
|
||||||
|
else
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools
|
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools
|
||||||
endef
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
$($(package)_autoconf)
|
$($(package)_autoconf)
|
||||||
|
|
|
@ -16,10 +16,13 @@ endef
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include && \
|
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include && \
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/bin && \
|
mkdir -p $($(package)_staging_prefix_dir)/bin && \
|
||||||
|
mkdir -p $($(package)_staging_prefix_dir)/include/llvm-c && \
|
||||||
cp bin/clang $($(package)_staging_prefix_dir)/bin/ && \
|
cp bin/clang $($(package)_staging_prefix_dir)/bin/ && \
|
||||||
cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ && \
|
cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ && \
|
||||||
cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
|
cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
|
||||||
cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \
|
cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \
|
||||||
|
cp include/llvm-c/ExternC.h $($(package)_staging_prefix_dir)/include/llvm-c && \
|
||||||
|
cp include/llvm-c/lto.h $($(package)_staging_prefix_dir)/include/llvm-c && \
|
||||||
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
||||||
cp -r lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/
|
cp -r lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -13,7 +13,5 @@ define $(package)_build_cmds
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
./install.sh && \
|
./install.sh
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/include/llvm-c && \
|
|
||||||
cp src/llvm/include/llvm-c/lto.h $($(package)_staging_prefix_dir)/include/llvm-c
|
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Add table
Reference in a new issue