Skip to content

Commit

Permalink
Revert "Merge dashpay#6384: backport: merge bitcoin#22380, bitcoin#25838
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Dec 26, 2024
1 parent 692fa75 commit f2ba16f
Show file tree
Hide file tree
Showing 35 changed files with 133 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ task:
FILE_ENV: "./ci/test/00_setup_env_native_nowallet.sh"

task:
name: 'macOS 11.0 [gui, no tests] [jammy]'
name: 'macOS 10.12 [gui, no tests] [jammy]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:jammy
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ $(OSX_DMG): deploydir
$(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ $(APP_DIST_DIR) -- $(if $(SOURCE_DATE_EPOCH),-volume_date all_file_dates =$(SOURCE_DATE_EPOCH))

$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
INSTALL_NAME_TOOL=$(INSTALL_NAME_TOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)

deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt
endif !BUILD_DARWIN
Expand Down
7 changes: 2 additions & 5 deletions ci/test/00_setup_env_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_macos_cross
export HOST=x86_64-apple-darwin
export PACKAGES="cmake libz-dev python3-setuptools xorriso"
export PACKAGES="cmake libz-dev libtinfo5 python3-setuptools"
export XCODE_VERSION=12.2
export XCODE_BUILD_ID=12B45b
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="all deploy"

# False-positive warning is fixed with clang 17, remove this when that version
# can be used.
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --with-boost-process LDFLAGS=-Wno-error=unused-command-line-argument"
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --with-boost-process"
15 changes: 2 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ case $host in
;;
*)
AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil)
AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], install_name_tool)
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
AC_PATH_TOOL([OTOOL], [otool], otool)
AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs)

Expand Down Expand Up @@ -1047,7 +1047,7 @@ dnl "ad_strip" as the symbol for the entry point.
if test x$TARGET_OS = xdarwin; then
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip_dylibs]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-fixup_chains]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-bind_at_load]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"],, [[$LDFLAG_WERROR]])
fi

AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
Expand Down Expand Up @@ -1955,17 +1955,6 @@ case ${OS} in
;;
esac

dnl An old hack similar to a98356fee to remove hard-coded
dnl bind_at_load flag from libtool
case $host in
*darwin*)
AC_MSG_RESULT([Removing -Wl,bind_at_load from libtool.])
sed < libtool > libtool-2 '/bind_at_load/d'
mv libtool-2 libtool
chmod 755 libtool
;;
esac

echo
echo "Options used to compile and link:"
echo " boost process = $with_boost_process"
Expand Down
9 changes: 5 additions & 4 deletions contrib/devtools/security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ def check_MACHO_NOUNDEFS(binary) -> bool:
'''
return binary.header.has(lief.MachO.HEADER_FLAGS.NOUNDEFS)

def check_MACHO_FIXUP_CHAINS(binary) -> bool:
def check_MACHO_LAZY_BINDINGS(binary) -> bool:
'''
Check for use of chained fixups.
Check for no lazy bindings.
We don't use or check for MH_BINDATLOAD. See #18295.
'''
return binary.has_dyld_chained_fixups
return binary.dyld_info.lazy_bind == (0,0)

def check_MACHO_Canary(binary) -> bool:
'''
Expand Down Expand Up @@ -213,8 +214,8 @@ def check_MACHO_control_flow(binary) -> bool:

BASE_MACHO = [
('NOUNDEFS', check_MACHO_NOUNDEFS),
('LAZY_BINDINGS', check_MACHO_LAZY_BINDINGS),
('Canary', check_MACHO_Canary),
('FIXUP_CHAINS', check_MACHO_FIXUP_CHAINS),
]

CHECKS = {
Expand Down
8 changes: 1 addition & 7 deletions contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def check_MACHO_libraries(binary) -> bool:
return ok

def check_MACHO_min_os(binary) -> bool:
if binary.build_version.minos == [11,0,0]:
if binary.build_version.minos == [10,15,0]:
return True
return False

Expand All @@ -251,11 +251,6 @@ def check_MACHO_sdk(binary) -> bool:
return True
return False

def check_MACHO_ld64(binary) -> bool:
if binary.build_version.tools[0].version == [711, 0, 0]:
return True
return False

def check_PE_libraries(binary) -> bool:
ok: bool = True
for dylib in binary.libraries:
Expand Down Expand Up @@ -295,7 +290,6 @@ def check_ELF_ABI(binary) -> bool:
('DYNAMIC_LIBRARIES', check_MACHO_libraries),
('MIN_OS', check_MACHO_min_os),
('SDK', check_MACHO_sdk),
('LD64', check_MACHO_ld64),
],
lief.EXE_FORMATS.PE: [
('DYNAMIC_LIBRARIES', check_PE_libraries),
Expand Down
38 changes: 18 additions & 20 deletions contrib/devtools/test-security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,29 @@ def test_MACHO(self):
arch = get_arch(cc, source, executable)

if arch == lief.ARCHITECTURES.X86:
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-no_fixup_chains']),
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS PIE NX CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-fixup_chains']),
(1, executable+': failed NOUNDEFS Canary PIE NX CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all', '-Wl,-fixup_chains']),
(1, executable+': failed NOUNDEFS PIE NX CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']),
(1, executable+': failed NOUNDEFS PIE CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector']),
(1, executable+': failed NOUNDEFS LAZY_BINDINGS Canary PIE NX CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all']),
(1, executable+': failed NOUNDEFS LAZY_BINDINGS PIE NX CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all']),
(1, executable+': failed NOUNDEFS LAZY_BINDINGS PIE CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all']),
(1, executable+': failed LAZY_BINDINGS PIE CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all']),
(1, executable+': failed PIE CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
(1, executable+': failed PIE CONTROL_FLOW'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
(1, executable+': failed PIE'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
(0, ''))
else:
# arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-no_fixup_chains']),
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains']),
(1, executable+': failed NOUNDEFS Canary'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']),
(1, executable+': failed NOUNDEFS'))
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains']),
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector']),
(1, executable+': failed NOUNDEFS LAZY_BINDINGS Canary'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all']),
(1, executable+': failed NOUNDEFS LAZY_BINDINGS'))
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all']),
(1, executable+': failed LAZY_BINDINGS'))
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-bind_at_load','-fstack-protector-all']),
(0, ''))


Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/test-symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_MACHO(self):
}
''')

self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,-platform_version','-Wl,macos', '-Wl,11.0', '-Wl,11.4']),
self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,-platform_version','-Wl,macos', '-Wl,10.15', '-Wl,11.4']),
(1, f'{executable}: failed SDK'))

def test_PE(self):
Expand Down
1 change: 1 addition & 0 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
x86_64_linux_STRIP=x86_64-linux-gnu-strip \
qt_config_opts_x86_64_linux='-platform linux-g++ -xplatform bitcoin-linux-g++' \
FORCE_USE_SYSTEM_CLANG=1


Expand Down
2 changes: 1 addition & 1 deletion contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ inspecting signatures in Mach-O binaries.")
(list ;; Native GCC 11 toolchain
gcc-toolchain-11
binutils
clang-toolchain-15
clang-toolchain-10
python-signapple
xorriso))
(else '())))))
2 changes: 1 addition & 1 deletion contrib/macdeploy/macdeployqtplus
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def getFrameworks(binaryPath: str, verbose: int) -> List[FrameworkInfo]:
return libraries

def runInstallNameTool(action: str, *args):
installnametoolbin=os.getenv("INSTALL_NAME_TOOL", "install_name_tool")
installnametoolbin=os.getenv("INSTALLNAMETOOL", "install_name_tool")
run([installnametoolbin, "-"+action] + list(args), check=True)

def changeInstallName(oldName: str, newName: str, binaryPath: str, verbose: int):
Expand Down
5 changes: 0 additions & 5 deletions depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ MULTIPROCESS ?=
LTO ?=
FALLBACK_DOWNLOAD_PATH ?= http://dash-depends-sources.s3-website-us-west-2.amazonaws.com

C_STANDARD ?= c11
CXX_STANDARD ?= c++17

BUILD = $(shell ./config.guess)
HOST ?= $(BUILD)
PATCHES_PATH = $(BASEDIR)/patches
Expand Down Expand Up @@ -226,8 +223,6 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@RANLIB@|$(host_RANLIB)|' \
-e 's|@NM@|$(host_NM)|' \
-e 's|@STRIP@|$(host_STRIP)|' \
-e 's|@OTOOL@|$(host_OTOOL)|' \
-e 's|@INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \
-e 's|@build_os@|$(build_os)|' \
-e 's|@host_os@|$(host_os)|' \
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
Expand Down
6 changes: 2 additions & 4 deletions depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The paths are automatically configured and no other options are needed unless ta

#### For macOS cross compilation

sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools xorriso
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso

Note: You must obtain the macOS SDK before proceeding with a cross-compile.
Under the depends directory, create a subdirectory named `SDKs`.
Expand All @@ -62,7 +62,7 @@ For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-ex

Common linux dependencies:

sudo apt-get install make automake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison
sudo apt-get install make automake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison

For linux ARM cross compilation:

Expand Down Expand Up @@ -103,8 +103,6 @@ The following can be set when running make: `make FOO=bar`
- `BASE_CACHE`: Built packages will be placed here
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
- `NO_QT`: Don't download/build/cache Qt and its dependencies
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
Expand Down
2 changes: 2 additions & 0 deletions depends/builders/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ default_build_TAR = tar
default_build_RANLIB = ranlib
default_build_STRIP = strip
default_build_NM = nm
default_build_OTOOL = otool
default_build_INSTALL_NAME_TOOL = install_name_tool

define add_build_tool_func
build_$(build_os)_$1 ?= $$(default_build_$1)
Expand Down
17 changes: 0 additions & 17 deletions depends/config.site.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,6 @@ if test -n "@NM@"; then
ac_cv_path_ac_pt_NM="${NM}"
fi

if test -n "@STRIP@"; then
STRIP="@STRIP@"
ac_cv_path_ac_pt_STRIP="${STRIP}"
fi

if test "@host_os@" = darwin; then
if test -n "@OTOOL@"; then
OTOOL="@OTOOL@"
ac_cv_path_ac_pt_OTOOL="${OTOOL}"
fi

if test -n "@INSTALL_NAME_TOOL@"; then
INSTALL_NAME_TOOL="@INSTALL_NAME_TOOL@"
ac_cv_path_ac_pt_INSTALL_NAME_TOOL="${INSTALL_NAME_TOOL}"
fi
fi

if test -n "@debug@"; then
enable_reduce_exports=no
fi
Expand Down
3 changes: 0 additions & 3 deletions depends/hosts/android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++
android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang
endif

android_CFLAGS=-std=$(C_STANDARD)
android_CXXFLAGS=-std=$(CXX_STANDARD)

ifneq ($(LTO),)
android_CFLAGS += -flto
android_LDFLAGS += -flto
Expand Down
Loading

0 comments on commit f2ba16f

Please sign in to comment.