Skip to content

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+377
-185
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ builder-image:
4242
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
4343
variables:
4444
SDK_URL: https://bitcoincore.org/depends-sources/sdks
45-
XCODE_VERSION: "12.1"
46-
XCODE_BUILD_ID: 12A7403
45+
XCODE_VERSION: "12.2"
46+
XCODE_BUILD_ID: 12B45b
4747
MAKEJOBS: -j4
4848
before_script:
4949
- echo HOST=$HOST
5050
- |
51-
if [ "$HOST" = "x86_64-apple-darwin19" ]; then
51+
if [ "$HOST" = "x86_64-apple-darwin" ]; then
5252
mkdir -p depends/SDKs
5353
mkdir -p depends/sdk-sources
5454
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
@@ -193,12 +193,12 @@ x86_64-pc-linux-gnu-nowallet:
193193
HOST: x86_64-pc-linux-gnu
194194
DEP_OPTS: "NO_WALLET=1"
195195

196-
x86_64-apple-darwin19:
196+
x86_64-apple-darwin:
197197
extends:
198198
- .build-depends-template
199199
- .skip-in-fast-mode-template
200200
variables:
201-
HOST: x86_64-apple-darwin19
201+
HOST: x86_64-apple-darwin
202202

203203
###
204204

@@ -302,7 +302,7 @@ mac-build:
302302
- .build-template
303303
- .skip-in-fast-mode-template
304304
needs:
305-
- x86_64-apple-darwin19
305+
- x86_64-apple-darwin
306306
variables:
307307
BUILD_TARGET: mac
308308

ci/test/00_setup_env_mac.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_macos_cross
10-
export HOST=x86_64-apple-darwin19
10+
export HOST=x86_64-apple-darwin
1111
export PACKAGES="cmake libcap-dev libz-dev libbz2-dev python3-dev python3-setuptools"
12-
export XCODE_VERSION=12.1
13-
export XCODE_BUILD_ID=12A7403
12+
export XCODE_VERSION=12.2
13+
export XCODE_BUILD_ID=12B45b
1414
export RUN_UNIT_TESTS=false
1515
export RUN_INTEGRATION_TESTS=false
1616
export GOAL="all deploy"

ci/test/00_setup_env_mac_host.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_macos
10-
export HOST=x86_64-apple-darwin19
10+
export HOST=x86_64-apple-darwin
1111
export PIP_PACKAGES="zmq lief"
1212
export RUN_UNIT_TESTS=true
1313
export RUN_INTEGRATION_TESTS=false

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ BITCOIN_TX_NAME=dash-tx
2020
BITCOIN_WALLET_TOOL_NAME=dash-wallet
2121

2222
dnl Unless the user specified ARFLAGS, force it to be cr
23+
dnl This is also the default as-of libtool 2.4.7
2324
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
2425
if test "x${ARFLAGS+set}" != "xset"; then
2526
ARFLAGS="cr"

contrib/containers/ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN pip3 install \
3737
codespell==1.17.1 \
3838
flake8==3.8.3 \
3939
jinja2 \
40-
lief==0.12.0 \
40+
lief==0.12.1 \
4141
pyzmq \
4242
vulture==2.3 \
4343
yq \

contrib/containers/guix/scripts/guix-start

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [[ ! -d "$WORKSPACE_PATH" ]]; then
1313
exit 1
1414
fi
1515

16-
XCODE_VERSION="12.1"
17-
XCODE_RELEASE="12A7403"
16+
XCODE_VERSION="12.2"
17+
XCODE_RELEASE="12B45b"
1818
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
1919

2020
# Check if macOS SDK is present, if not, download it

contrib/devtools/security-check.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,9 @@ def check_MACHO_control_flow(binary) -> bool:
206206
]
207207

208208
BASE_MACHO = [
209-
('PIE', check_PIE),
210209
('NOUNDEFS', check_MACHO_NOUNDEFS),
211-
('NX', check_NX),
212210
('LAZY_BINDINGS', check_MACHO_LAZY_BINDINGS),
213211
('Canary', check_MACHO_Canary),
214-
('CONTROL_FLOW', check_MACHO_control_flow),
215212
]
216213

217214
CHECKS = {
@@ -226,7 +223,10 @@ def check_MACHO_control_flow(binary) -> bool:
226223
lief.ARCHITECTURES.X86: BASE_PE,
227224
},
228225
lief.EXE_FORMATS.MACHO: {
229-
lief.ARCHITECTURES.X86: BASE_MACHO,
226+
lief.ARCHITECTURES.X86: BASE_MACHO + [('PIE', check_PIE),
227+
('NX', check_NX),
228+
('CONTROL_FLOW', check_MACHO_control_flow)],
229+
lief.ARCHITECTURES.ARM64: BASE_MACHO,
230230
}
231231
}
232232

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def check_MACHO_min_os(binary) -> bool:
217217
return False
218218

219219
def check_MACHO_sdk(binary) -> bool:
220-
if binary.build_version.sdk == [10, 15, 6]:
220+
if binary.build_version.sdk == [11, 0, 0]:
221221
return True
222222
return False
223223

contrib/devtools/test-security-check.py

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,34 @@ def test_MACHO(self):
116116
executable = 'test1'
117117
cc = determine_wellknown_cmd('CC', 'clang')
118118
write_testcode(source)
119+
arch = get_arch(cc, source, executable)
120+
121+
if arch == lief.ARCHITECTURES.X86:
122+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector']),
123+
(1, executable+': failed NOUNDEFS LAZY_BINDINGS Canary PIE NX CONTROL_FLOW'))
124+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all']),
125+
(1, executable+': failed NOUNDEFS LAZY_BINDINGS PIE NX CONTROL_FLOW'))
126+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all']),
127+
(1, executable+': failed NOUNDEFS LAZY_BINDINGS PIE CONTROL_FLOW'))
128+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all']),
129+
(1, executable+': failed LAZY_BINDINGS PIE CONTROL_FLOW'))
130+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all']),
131+
(1, executable+': failed PIE CONTROL_FLOW'))
132+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
133+
(1, executable+': failed PIE'))
134+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
135+
(0, ''))
136+
else:
137+
# arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks
138+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector']),
139+
(1, executable+': failed NOUNDEFS LAZY_BINDINGS Canary'))
140+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all']),
141+
(1, executable+': failed NOUNDEFS LAZY_BINDINGS'))
142+
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all']),
143+
(1, executable+': failed LAZY_BINDINGS'))
144+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-bind_at_load','-fstack-protector-all']),
145+
(0, ''))
119146

120-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector']),
121-
(1, executable+': failed PIE NOUNDEFS NX LAZY_BINDINGS Canary CONTROL_FLOW'))
122-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all']),
123-
(1, executable+': failed PIE NOUNDEFS NX LAZY_BINDINGS CONTROL_FLOW'))
124-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all']),
125-
(1, executable+': failed PIE NOUNDEFS LAZY_BINDINGS CONTROL_FLOW'))
126-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all']),
127-
(1, executable+': failed PIE LAZY_BINDINGS CONTROL_FLOW'))
128-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all']),
129-
(1, executable+': failed PIE CONTROL_FLOW'))
130-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
131-
(1, executable+': failed PIE'))
132-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full']),
133-
(0, ''))
134147

135148
clean_files(source, executable)
136149

contrib/gitian-build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def build():
7474

7575
if args.macos:
7676
print('\nCompiling ' + args.version + ' MacOS')
77-
subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://bitcoincore.org/depends-sources/sdks/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz'])
78-
subprocess.check_output(["echo 'be17f48fd0b08fb4dcd229f55a6ae48d9f781d210839b4ea313ef17dd12d6ea5 inputs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz' | sha256sum -c"], shell=True)
77+
subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz'])
78+
subprocess.check_output(["echo 'df75d30ecafc429e905134333aeae56ac65fac67cb4182622398fd717df77619 inputs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz' | sha256sum -c"], shell=True)
7979
subprocess.check_call(['bin/gbuild', '--fetch-tags', '-j', args.jobs, '-m', args.memory, '--commit', 'dash='+args.commit, '--url', 'dash='+args.url, '../dash/contrib/gitian-descriptors/gitian-osx.yml'])
8080
subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-osx-unsigned', '--destination', '../gitian.sigs/', '../dash/contrib/gitian-descriptors/gitian-osx.yml'])
8181
subprocess.check_call('mv build/out/dashcore-*-osx-unsigned.tar.gz inputs/', shell=True)
@@ -218,7 +218,7 @@ def main():
218218
args.macos = 'm' in args.os
219219

220220
# Disable for MacOS if no SDK found
221-
if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz'):
221+
if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz'):
222222
print('Cannot build for MacOS, SDK does not exist. Will build for other OSes')
223223
args.macos = False
224224

0 commit comments

Comments
 (0)