merge bitcoin#25838: Use mkspecs/bitcoin-linux-g++ for all Linux hosts

This commit is contained in:
Kittywhiskers Van Gogh 2024-11-04 13:06:47 +00:00
parent 8d51bcc171
commit fff0f6b628
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
3 changed files with 12 additions and 21 deletions

View File

@ -11,6 +11,7 @@ default_host_LIBTOOL = $(host_toolchain)libtool
default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool
default_host_OTOOL = $(host_toolchain)otool default_host_OTOOL = $(host_toolchain)otool
default_host_NM = $(host_toolchain)nm default_host_NM = $(host_toolchain)nm
default_host_OBJCOPY = $(host_toolchain)objcopy
define add_host_tool_func define add_host_tool_func
ifneq ($(filter $(origin $1),undefined default),) ifneq ($(filter $(origin $1),undefined default),)
@ -40,5 +41,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1)
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
endef endef
$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) $(foreach tool,CC CXX AR RANLIB STRIP LIBTOOL NM OBJCOPY OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool))))
$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))

View File

@ -160,18 +160,10 @@ $(package)_config_opts_linux += -dbus-runtime
ifneq ($(LTO),) ifneq ($(LTO),)
$(package)_config_opts_linux += -ltcg $(package)_config_opts_linux += -ltcg
endif endif
$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++ $(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx))) ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
$(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++ $(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++
else
$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
endif endif
$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
$(package)_config_opts_powerpc64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
$(package)_config_opts_powerpc64le_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
$(package)_config_opts_s390x_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
$(package)_config_opts_mingw32 = -no-opengl $(package)_config_opts_mingw32 = -no-opengl
$(package)_config_opts_mingw32 += -no-dbus $(package)_config_opts_mingw32 += -no-dbus
@ -236,18 +228,11 @@ endef
# 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. # 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf.
# #
# 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named # 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named
# bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This # bitcoin-linux-g++, replace tool names with $($($(package)_type)_TOOL).
# way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't
# ship a mkspec for. See it's usage in config_opts_* above.
# #
# 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. # 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds.
# #
# 5. Do similar for the win32-g++ mkspec. # 5. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466.
#
# 6. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466.
#
# 7. Adjust a regex in toolchain.prf, to accommodate Guix's usage of
# CROSS_LIBRARY_PATH. See #15277.
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
cp $($(package)_patch_dir)/qt.pro qt.pro && \ cp $($(package)_patch_dir)/qt.pro qt.pro && \
cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \ cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \
@ -270,7 +255,12 @@ define $(package)_preprocess_cmds
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \ cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ sed -i.old "s|arm-linux-gnueabi-gcc|$($($(package)_type)_CC)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
sed -i.old "s|arm-linux-gnueabi-g++|$($($(package)_type)_CXX)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
sed -i.old "s|arm-linux-gnueabi-ar|$($($(package)_type)_AR)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
sed -i.old "s|arm-linux-gnueabi-objcopy|$($($(package)_type)_OBJCOPY)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
sed -i.old "s|arm-linux-gnueabi-nm|$($($(package)_type)_NM)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
sed -i.old "s|arm-linux-gnueabi-strip|$($($(package)_type)_STRIP)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \

View File

@ -4,7 +4,7 @@ See discussion in https://github.com/bitcoin/bitcoin/pull/15277.
--- a/qtbase/mkspecs/features/toolchain.prf --- a/qtbase/mkspecs/features/toolchain.prf
+++ b/qtbase/mkspecs/features/toolchain.prf +++ b/qtbase/mkspecs/features/toolchain.prf
@@ -231,8 +231,8 @@ isEmpty($${target_prefix}.INCDIRS) { @@ -236,8 +236,8 @@ isEmpty($${target_prefix}.INCDIRS) {
add_libraries = false add_libraries = false
for (line, output) { for (line, output) {
line ~= s/^[ \\t]*// # remove leading spaces line ~= s/^[ \\t]*// # remove leading spaces