Skip to content

Commit 6a51ab2

Browse files
1506d9d merge bitcoin#29072: use `-no_exported_symbols` on macOS (Kittywhiskers Van Gogh) 9247960 merge bitcoin#30198: qt 5.15.14 and fix macOS build with Clang 18 (Kittywhiskers Van Gogh) 5585e7a merge bitcoin#30074: use ENV flags in get_arch (Kittywhiskers Van Gogh) decd420 merge bitcoin#29739: swap cctools otool for llvm-objdump (Kittywhiskers Van Gogh) 0f8c420 merge bitcoin#29890: remove some tools when cross-compiling for macOS (Kittywhiskers Van Gogh) 936da1a merge bitcoin#29732: qt 5.15.13 (Kittywhiskers Van Gogh) c294b47 revert: patch qt to make placeholders differ from actual text (Kittywhiskers Van Gogh) af7090c merge bitcoin#29598: don't use -h with touch on OpenBSD (Kittywhiskers Van Gogh) ebf8ff2 merge bitcoin#29298: patch libtool out of libnatpmp/miniupnpc (Kittywhiskers Van Gogh) 070b876 merge bitcoin#29233: depends move macOS C(XX) FLAGS out of C & CXX (Kittywhiskers Van Gogh) d838481 revert dash#2398: Force fvisibility=hidden when compiling on macos (Kittywhiskers Van Gogh) 59a18f9 merge bitcoin#29170: add macho branch protection check (Kittywhiskers Van Gogh) cb024d9 merge bitcoin#29185: remove `--enable-lto` (Kittywhiskers Van Gogh) 6d75a81 merge bitcoin#28880: switch to using LLVM 17.x for macOS builds (Kittywhiskers Van Gogh) 7b0a1f2 merge bitcoin#28622: use macOS 14 SDK (Xcode 15.0) (Kittywhiskers Van Gogh) 02eb735 merge bitcoin#24948: fix typo in permissions (Kittywhiskers Van Gogh) 2739107 merge bitcoin#24534: make gen-sdk deterministic (Kittywhiskers Van Gogh) ab10bf9 merge bitcoin#24241: cleanup doc on need of Developer Account to obtain macOS SDK (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Dependent on dashpay#6384 * Dependency for dashpay#6389 * The Qt patch introduced in [dash#5596](dashpay#5596), `fix_qt_placeholders.patch`, was a portion of a suggested workaround for QTBUG-92199 ([source](https://bugreports.qt.io/browse/QTBUG-92199?focusedId=669719&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-669719)) but since then, a fix ([here](https://codereview.qt-project.org/c/qt/qtbase/+/434310)) has made its way to 5.15.12 and we are upgrading to 5.15.14 from 5.15.11. So we can safely remove this patch. ## Breaking Changes None expected ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 1506d9d PastaPastaPasta: utACK 1506d9d Tree-SHA512: df8e4ea0ce9e7b269d248518698f0566b5eca1a54cdfb53f5b213b90fb5177e5a5df44eaeb6f3fc014cd93351c9245736bb2fd52bc2af4ae274d8fa93e601b07
2 parents 12e5e32 + 1506d9d commit 6a51ab2

Some content is hidden

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

47 files changed

+328
-243
lines changed

.gitlab-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ 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.2"
46-
XCODE_BUILD_ID: 12B45b
45+
XCODE_VERSION: "15.0"
46+
XCODE_BUILD_ID: 15A240d
4747
before_script:
4848
- echo HOST=$HOST
4949
- |

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $(OSX_DMG): deploydir
130130
$(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))
131131

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

135135
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt
136136
endif !BUILD_DARWIN

ci/test/00_setup_env_mac.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_macos_cross
1010
export HOST=x86_64-apple-darwin
1111
export PACKAGES="cmake libz-dev python3-setuptools xorriso"
12-
export XCODE_VERSION=12.2
13-
export XCODE_BUILD_ID=12B45b
12+
export XCODE_VERSION=15.0
13+
export XCODE_BUILD_ID=15A240d
1414
export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false
1616
export GOAL="all deploy"
17-
18-
# False-positive warning is fixed with clang 17, remove this when that version
19-
# can be used.
20-
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --with-boost-process LDFLAGS=-Wno-error=unused-command-line-argument"
17+
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --with-boost-process"

configure.ac

+7-18
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ AC_PATH_PROG(CCACHE,ccache)
122122
AC_PATH_PROG(XGETTEXT,xgettext)
123123
AC_PATH_PROG(HEXDUMP,hexdump)
124124
AC_PATH_TOOL(OBJCOPY, objcopy)
125+
AC_PATH_TOOL([OBJDUMP], [objdump])
125126
AC_PATH_TOOL(DSYMUTIL, dsymutil)
126127
AC_PATH_PROG(DOXYGEN, doxygen)
127128
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
@@ -345,11 +346,6 @@ AC_ARG_WITH([boost-process],
345346
[boost_process=$withval],
346347
[boost_process=no])
347348

348-
AC_ARG_ENABLE([lto],
349-
[AS_HELP_STRING([--enable-lto],[build using LTO (default is no)])],
350-
[enable_lto=$enableval],
351-
[enable_lto=no])
352-
353349
AC_LANG_PUSH([C++])
354350

355351
dnl Check for a flag to turn compiler warnings into errors. This is helpful for checks which may
@@ -408,11 +404,6 @@ else
408404
fi
409405
fi
410406

411-
if test "x$enable_lto" = "xyes"; then
412-
AX_CHECK_COMPILE_FLAG([-flto], [LTO_CXXFLAGS="$LTO_CXXFLAGS -flto"], [AC_MSG_ERROR([compile failed with -flto])], [$CXXFLAG_WERROR])
413-
AX_CHECK_LINK_FLAG([-flto], [LTO_LDFLAGS="$LTO_LDFLAGS -flto"], [AC_MSG_ERROR([link failed with -flto])], [$CXXFLAG_WERROR])
414-
fi
415-
416407
if test "x$enable_stacktraces" != xno; then
417408
AC_CHECK_HEADERS([execinfo.h], [], [enable_stacktraces=no])
418409
fi
@@ -780,6 +771,9 @@ case $host in
780771
TARGET_OS=darwin
781772
if test x$cross_compiling != xyes; then
782773
BUILD_OS=darwin
774+
775+
AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"],, [[$LDFLAG_WERROR]])
776+
783777
AC_CHECK_PROG([BREW],brew, brew)
784778
if test x$BREW = xbrew; then
785779
dnl These Homebrew packages may be keg-only, meaning that they won't be found
@@ -843,8 +837,6 @@ case $host in
843837
;;
844838
*)
845839
AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil)
846-
AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], install_name_tool)
847-
AC_PATH_TOOL([OTOOL], [otool], otool)
848840
AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs)
849841

850842
dnl libtool will try to strip the static lib, which is a problem for
@@ -856,7 +848,6 @@ case $host in
856848
esac
857849
fi
858850

859-
AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"],, [[$LDFLAG_WERROR]])
860851
CPPFLAGS="$CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
861852
OBJCXXFLAGS="$CXXFLAGS"
862853
;;
@@ -1529,6 +1520,7 @@ if test x$use_reduce_exports = xyes; then
15291520
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],
15301521
[AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])],[[$CXXFLAG_WERROR]])
15311522
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]],[RELDFLAGS="-Wl,--exclude-libs,ALL"],,[[$LDFLAG_WERROR]])
1523+
AX_CHECK_LINK_FLAG([-Wl,-no_exported_symbols], [LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -Wl,-no_exported_symbols"], [], [$LDFLAG_WERROR])
15321524
fi
15331525

15341526
if test x$use_tests = xyes; then
@@ -1887,8 +1879,6 @@ AC_SUBST(GPROF_LDFLAGS)
18871879
AC_SUBST(HARDENED_CXXFLAGS)
18881880
AC_SUBST(HARDENED_CPPFLAGS)
18891881
AC_SUBST(HARDENED_LDFLAGS)
1890-
AC_SUBST(LTO_CXXFLAGS)
1891-
AC_SUBST(LTO_LDFLAGS)
18921882
AC_SUBST(PIC_FLAGS)
18931883
AC_SUBST(PIE_FLAGS)
18941884
AC_SUBST(SANITIZER_CXXFLAGS)
@@ -1999,7 +1989,6 @@ echo " crash hooks enabled = $enable_crashhooks"
19991989
echo " miner enabled = $enable_miner"
20001990
echo " gprof enabled = $enable_gprof"
20011991
echo " werror = $enable_werror"
2002-
echo " LTO = $enable_lto"
20031992
echo
20041993
echo " target os = $host_os"
20051994
echo " build os = $build_os"
@@ -2008,7 +1997,7 @@ echo " CC = $CC"
20081997
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
20091998
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
20101999
echo " CXX = $CXX"
2011-
echo " CXXFLAGS = $LTO_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
2012-
echo " LDFLAGS = $LTO_LDFLAGS $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
2000+
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
2001+
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
20132002
echo " ARFLAGS = $ARFLAGS"
20142003
echo

contrib/containers/guix/scripts/guix-start

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPAC
99
exit 1
1010
fi
1111

12-
XCODE_VERSION="12.2"
13-
XCODE_RELEASE="12B45b"
12+
XCODE_VERSION="15.0"
13+
XCODE_RELEASE="15A240d"
1414
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
1515
XCODE_SOURCE="${XCODE_SOURCE:-https://bitcoincore.org/depends-sources/sdks}"
1616

contrib/devtools/security-check.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ def check_MACHO_control_flow(binary) -> bool:
193193
return True
194194
return False
195195

196+
def check_MACHO_branch_protection(binary) -> bool:
197+
'''
198+
Check for branch protection instrumentation
199+
'''
200+
content = binary.get_content_from_virtual_address(binary.entrypoint, 4, lief.Binary.VA_TYPES.AUTO)
201+
202+
if content.tolist() == [95, 36, 3, 213]: # bti
203+
return True
204+
return False
205+
196206
BASE_ELF = [
197207
('PIE', check_PIE),
198208
('NX', check_NX),
@@ -232,7 +242,7 @@ def check_MACHO_control_flow(binary) -> bool:
232242
lief.ARCHITECTURES.X86: BASE_MACHO + [('PIE', check_PIE),
233243
('NX', check_NX),
234244
('CONTROL_FLOW', check_MACHO_control_flow)],
235-
lief.ARCHITECTURES.ARM64: BASE_MACHO,
245+
lief.ARCHITECTURES.ARM64: BASE_MACHO + [('BRANCH_PROTECTION', check_MACHO_branch_protection)],
236246
}
237247
}
238248

contrib/devtools/symbol-check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def check_MACHO_min_os(binary) -> bool:
247247
return False
248248

249249
def check_MACHO_sdk(binary) -> bool:
250-
if binary.build_version.sdk == [11, 0, 0]:
250+
if binary.build_version.sdk == [14, 0, 0]:
251251
return True
252252
return False
253253

contrib/devtools/test-security-check.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,24 @@ def clean_files(source, executable):
2828
os.remove(source)
2929
os.remove(executable)
3030

31-
def call_security_check(cc, source, executable, options):
31+
def env_flags() -> List[str]:
3232
# This should behave the same as AC_TRY_LINK, so arrange well-known flags
3333
# in the same order as autoconf would.
3434
#
3535
# See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
3636
# reference.
37-
env_flags: List[str] = []
37+
flags: List[str] = []
3838
for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']:
39-
env_flags += filter(None, os.environ.get(var, '').split(' '))
39+
flags += filter(None, os.environ.get(var, '').split(' '))
40+
return flags
4041

41-
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
42+
def call_security_check(cc, source, executable, options):
43+
subprocess.run([*cc,source,'-o',executable] + env_flags() + options, check=True)
4244
p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
4345
return (p.returncode, p.stdout.rstrip())
4446

4547
def get_arch(cc, source, executable):
46-
subprocess.run([*cc, source, '-o', executable], check=True)
48+
subprocess.run([*cc, source, '-o', executable] + env_flags(), check=True)
4749
binary = lief.parse(executable)
4850
arch = binary.abstract.header.architecture
4951
os.remove(executable)
@@ -138,12 +140,12 @@ def test_MACHO(self):
138140
else:
139141
# arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks
140142
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-no_fixup_chains']),
141-
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS'))
142-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains']),
143+
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS BRANCH_PROTECTION'))
144+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
143145
(1, executable+': failed NOUNDEFS Canary'))
144-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']),
146+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
145147
(1, executable+': failed NOUNDEFS'))
146-
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains']),
148+
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
147149
(0, ''))
148150

149151

contrib/devtools/test-symbol-check.py

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ def call_symbol_check(cc: List[str], source, executable, options):
2828
os.remove(executable)
2929
return (p.returncode, p.stdout.rstrip())
3030

31-
def get_machine(cc: List[str]):
32-
p = subprocess.run([*cc,'-dumpmachine'], stdout=subprocess.PIPE, universal_newlines=True)
33-
return p.stdout.rstrip()
34-
3531
class TestSymbolChecks(unittest.TestCase):
3632
def test_ELF(self):
3733
source = 'test1.c'

contrib/guix/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ RUN mkdir base_cache sources SDKs
5959
WORKDIR /dash
6060

6161
RUN mkdir -p depends/SDKs && \
62-
curl -L https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz | tar -xz -C depends/SDKs
62+
curl -L https://bitcoincore.org/depends-sources/sdks/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz | tar -xz -C depends/SDKs
6363

contrib/guix/manifest.scm

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ inspecting signatures in Mach-O binaries.")
609609
(list ;; Native GCC 11 toolchain
610610
gcc-toolchain-11
611611
binutils
612-
clang-toolchain-15
612+
clang-toolchain-17
613613
python-signapple
614614
xorriso))
615615
(else '())))))

contrib/macdeploy/README.md

+25-34
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,50 @@ When complete, it will have produced `Dash-Qt.dmg`.
1212

1313
### Step 1: Obtaining `Xcode.app`
1414

15-
Our current macOS SDK
16-
(`Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`) can be
17-
extracted from
18-
[Xcode_12.2.xip](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
15+
A free Apple Developer Account is required to proceed.
16+
17+
Our macOS SDK can be extracted from
18+
[Xcode_15.xip](https://download.developer.apple.com/Developer_Tools/Xcode_15/Xcode_15.xip).
19+
1920
Alternatively, after logging in to your account go to 'Downloads', then 'More'
20-
and look for [`Xcode_12.2`](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
21+
and search for [`Xcode 15`](https://developer.apple.com/download/all/?q=Xcode%2015).
22+
2123
An Apple ID and cookies enabled for the hostname are needed to download this.
22-
The `sha256sum` of the archive should be `28d352f8c14a43d9b8a082ac6338dc173cb153f964c6e8fb6ba389e5be528bd0`.
2324

24-
After Xcode version 7.x, Apple started shipping the `Xcode.app` in a `.xip`
25-
archive. This makes the SDK less-trivial to extract on non-macOS machines. One
26-
approach (tested on Debian Buster) is outlined below:
25+
The `sha256sum` of the downloaded XIP archive should be `4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e`.
26+
27+
To extract the `.xip` on Linux:
2728

2829
```bash
2930
# Install/clone tools needed for extracting Xcode.app
3031
apt install cpio
3132
git clone https://github.com/bitcoin-core/apple-sdk-tools.git
3233

33-
# Unpack Xcode_12.2.xip and place the resulting Xcode.app in your current
34+
# Unpack the .xip and place the resulting Xcode.app in your current
3435
# working directory
35-
python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i
36+
python3 apple-sdk-tools/extract_xcode.py -f Xcode_15.xip | cpio -d -i
3637
```
3738

38-
On macOS the process is more straightforward:
39+
On macOS:
3940

4041
```bash
41-
xip -x Xcode_12.2.xip
42+
xip -x Xcode_15.xip
4243
```
4344

44-
### Step 2: Generating `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz` from `Xcode.app`
45+
### Step 2: Generating the SDK tarball from `Xcode.app`
4546

46-
To generate `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`, run
47-
the script [`gen-sdk`](./gen-sdk) with the path to `Xcode.app` (extracted in the
48-
previous stage) as the first argument.
47+
To generate the SDK, run the script [`gen-sdk`](./gen-sdk) with the
48+
path to `Xcode.app` (extracted in the previous stage) as the first argument.
4949

5050
```bash
51-
# Generate a Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz from
52-
# the supplied Xcode.app
5351
./contrib/macdeploy/gen-sdk '/path/to/Xcode.app'
5452
```
5553

54+
The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`.
55+
The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`.
56+
5657
## Deterministic macOS DMG Notes
58+
5759
Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
5860
`binutils` (`ld`, `ar`, etc) and DMG authoring tools.
5961

@@ -64,9 +66,8 @@ building for macOS.
6466

6567
Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the
6668
FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several
67-
other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These
68-
do not build under Linux, so they have been patched to do so. The work here was used as
69-
a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
69+
other tools are needed as well. These do not build under Linux, so they have been patched to
70+
do so. The work here was used as a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
7071

7172
In order to build a working toolchain, the following source packages are needed from
7273
Apple: `cctools`, `dyld`, and `ld64`.
@@ -78,19 +79,9 @@ This version of `cctools` has been patched to use the current version of `clang`
7879
and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`.
7980

8081
To complicate things further, all builds must target an Apple SDK. These SDKs are free to
81-
download, but not redistributable. To obtain it, register for an Apple Developer Account,
82-
then download [Xcode_12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
83-
84-
This file is many gigabytes in size, but most (but not all) of what we need is
85-
contained only in a single directory:
86-
87-
```bash
88-
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
89-
```
90-
91-
See the SDK Extraction notes above for how to obtain it.
82+
download, but not redistributable. See the SDK Extraction notes above for how to obtain it.
9283

93-
The Guix process build 2 sets of files: Linux tools, then Apple binaries which are
84+
The Guix process builds 2 sets of files: Linux tools, then Apple binaries which are
9485
created using these tools. The build process has been designed to avoid including the
9586
SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely
9687
redistributed.

0 commit comments

Comments
 (0)