Page MenuHomePhabricator

macOS: Bump minimum required runtime version and prepare for building with upstream LLVM
DraftPublic

Authored by PiRK on Feb 19 2024, 16:20.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

depends: bump darwin clang to 11.1

Unfortunately clang 10 does not understand "-mmacosx-version-min=11.0",
as it expects to see only 10.x.

Bump minimally to 11.1 to fix that problem. This will likely be our last
binary toolchain bump, as it will soon be replaced with usage of upstream
vanilla llvm.

https://github.com/bitcoin/bitcoin/pull/27676/commits/c2cd47280cf5db5645917574dd95e9ec6036319e

depends: Bump MacOS minimum runtime requirement to 11.0

This is necessary as the new fixup_chains linker behavior is only valid
when the runtime target is >=11.0.

https://github.com/bitcoin/bitcoin/pull/27676/commits/fb61bc0c022cc0fff290b94ee4f9cf9f4160efe2

build: explicitly opt-in to new fixup_chains functionality for darwin

This replaces (but does not collide with) the previous bind_on_load. There
is technically no need to opt-in to this functionality as long as >= MacOS 11.0
is being targetted, but it will be helpful to see in the logs.

https://github.com/bitcoin/bitcoin/pull/27676/commits/9bc357e205abc78524eae8906e6d231d6eb9f059

This is a backport of core#27676

Note that we didn't backport the -bind_at_load linker flag and corresponding LAZY_BINDINGS check, so their removal is not applicable.
The other difference is that we have not yet started working on the Apple ARM build, so that checksum change also is not applicable.

Test Plan

gitian builds

This seems to fix an error in the guix build for mac OS, but it still fails with other errors.

Event Timeline

Tail of the build log:

 * [new tag]             phabricator/diff/45303 -> phabricator/diff/45303
 * [new tag]             phabricator/diff/45309 -> phabricator/diff/45309
 * [new tag]             phabricator/diff/45310 -> phabricator/diff/45310
 * [new tag]             phabricator/diff/45311 -> phabricator/diff/45311
 * [new tag]             phabricator/diff/45314 -> phabricator/diff/45314
 * [new tag]             phabricator/diff/45317 -> phabricator/diff/45317
 * [new tag]             phabricator/diff/45322 -> phabricator/diff/45322
 * [new tag]             phabricator/diff/45323 -> phabricator/diff/45323
 * [new tag]             phabricator/diff/45326 -> phabricator/diff/45326
 * [new tag]             phabricator/diff/45328 -> phabricator/diff/45328
 * [new tag]             phabricator/diff/45329 -> phabricator/diff/45329
 * [new tag]             phabricator/diff/45331 -> phabricator/diff/45331
 * [new tag]             phabricator/diff/45332 -> phabricator/diff/45332
 * [new tag]             phabricator/diff/45333 -> phabricator/diff/45333
 * [new tag]             phabricator/diff/45336 -> phabricator/diff/45336
 * [new tag]             phabricator/diff/45337 -> phabricator/diff/45337
 * [new tag]             phabricator/diff/45339 -> phabricator/diff/45339
 * [new tag]             phabricator/diff/45343 -> phabricator/diff/45343
 * [new tag]             phabricator/diff/45345 -> phabricator/diff/45345
 * [new tag]             phabricator/diff/45346 -> phabricator/diff/45346
 * [new tag]             phabricator/diff/45347 -> phabricator/diff/45347
 * [new tag]             phabricator/diff/45351 -> phabricator/diff/45351
 * [new tag]             phabricator/diff/45352 -> phabricator/diff/45352
 * [new tag]             phabricator/diff/45355 -> phabricator/diff/45355
 * [new tag]             phabricator/diff/45356 -> phabricator/diff/45356
 * [new tag]             phabricator/diff/45360 -> phabricator/diff/45360
 * [new tag]             phabricator/diff/45361 -> phabricator/diff/45361
 * [new tag]             phabricator/diff/45363 -> phabricator/diff/45363
 * [new tag]             phabricator/diff/45366 -> phabricator/diff/45366
 * [new tag]             phabricator/diff/45367 -> phabricator/diff/45367
 * [new tag]             phabricator/diff/45368 -> phabricator/diff/45368
 * [new tag]             phabricator/diff/45377 -> phabricator/diff/45377
 * [new tag]             phabricator/diff/45378 -> phabricator/diff/45378
 * [new tag]             phabricator/diff/45379 -> phabricator/diff/45379
 * [new tag]             phabricator/diff/45392 -> phabricator/diff/45392
 * [new tag]             phabricator/diff/8992  -> phabricator/diff/8992
 * [new tag]             phabricator/diff/8993  -> phabricator/diff/8993
 * [new branch]          master                 -> master
--- Building for bullseye amd64 ---
Stopping target if it is up
Error response from daemon: No such container: gitian-target
Error: No such container: gitian-target
Making a new image copy
Starting target
Checking if target is up...
Preparing build environment
Updating apt-get repository (log in var/install.log)
Installing additional packages (log in var/install.log)
Upgrading system, may take a while (log in var/install.log)
Creating package manifest
Creating build script (var/build-script)
Running build script (log in var/build.log)
./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
	from ./bin/gbuild:185:in `build_one_configuration'
	from ./bin/gbuild:339:in `block (2 levels) in <main>'
	from ./bin/gbuild:334:in `each'
	from ./bin/gbuild:334:in `block in <main>'
	from ./bin/gbuild:332:in `each'
	from ./bin/gbuild:332:in `<main>'
Build gitian-osx failed with exit code 1

Tail of the build log:

 * [new tag]             phabricator/diff/45322 -> phabricator/diff/45322
 * [new tag]             phabricator/diff/45323 -> phabricator/diff/45323
 * [new tag]             phabricator/diff/45324 -> phabricator/diff/45324
 * [new tag]             phabricator/diff/45325 -> phabricator/diff/45325
 * [new tag]             phabricator/diff/45326 -> phabricator/diff/45326
 * [new tag]             phabricator/diff/45327 -> phabricator/diff/45327
 * [new tag]             phabricator/diff/45329 -> phabricator/diff/45329
 * [new tag]             phabricator/diff/45331 -> phabricator/diff/45331
 * [new tag]             phabricator/diff/45332 -> phabricator/diff/45332
 * [new tag]             phabricator/diff/45333 -> phabricator/diff/45333
 * [new tag]             phabricator/diff/45334 -> phabricator/diff/45334
 * [new tag]             phabricator/diff/45336 -> phabricator/diff/45336
 * [new tag]             phabricator/diff/45337 -> phabricator/diff/45337
 * [new tag]             phabricator/diff/45339 -> phabricator/diff/45339
 * [new tag]             phabricator/diff/45343 -> phabricator/diff/45343
 * [new tag]             phabricator/diff/45345 -> phabricator/diff/45345
 * [new tag]             phabricator/diff/45346 -> phabricator/diff/45346
 * [new tag]             phabricator/diff/45347 -> phabricator/diff/45347
 * [new tag]             phabricator/diff/45351 -> phabricator/diff/45351
 * [new tag]             phabricator/diff/45352 -> phabricator/diff/45352
 * [new tag]             phabricator/diff/45355 -> phabricator/diff/45355
 * [new tag]             phabricator/diff/45360 -> phabricator/diff/45360
 * [new tag]             phabricator/diff/45362 -> phabricator/diff/45362
 * [new tag]             phabricator/diff/45366 -> phabricator/diff/45366
 * [new tag]             phabricator/diff/45367 -> phabricator/diff/45367
 * [new tag]             phabricator/diff/45370 -> phabricator/diff/45370
 * [new tag]             phabricator/diff/45372 -> phabricator/diff/45372
 * [new tag]             phabricator/diff/45373 -> phabricator/diff/45373
 * [new tag]             phabricator/diff/45374 -> phabricator/diff/45374
 * [new tag]             phabricator/diff/45377 -> phabricator/diff/45377
 * [new tag]             phabricator/diff/45378 -> phabricator/diff/45378
 * [new tag]             phabricator/diff/45379 -> phabricator/diff/45379
 * [new tag]             phabricator/diff/45380 -> phabricator/diff/45380
 * [new tag]             phabricator/diff/45390 -> phabricator/diff/45390
 * [new tag]             phabricator/diff/45392 -> phabricator/diff/45392
 * [new tag]             phabricator/diff/8992  -> phabricator/diff/8992
 * [new tag]             phabricator/diff/8993  -> phabricator/diff/8993
 * [new branch]          master                 -> master
--- Building for bullseye amd64 ---
Stopping target if it is up
Error response from daemon: No such container: gitian-target
Error: No such container: gitian-target
Making a new image copy
Starting target
Checking if target is up.
Preparing build environment
Updating apt-get repository (log in var/install.log)
Installing additional packages (log in var/install.log)
Upgrading system, may take a while (log in var/install.log)
Creating package manifest
Creating build script (var/build-script)
Running build script (log in var/build.log)
./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
	from ./bin/gbuild:185:in `build_one_configuration'
	from ./bin/gbuild:339:in `block (2 levels) in <main>'
	from ./bin/gbuild:334:in `each'
	from ./bin/gbuild:334:in `block in <main>'
	from ./bin/gbuild:332:in `each'
	from ./bin/gbuild:332:in `<main>'
Build gitian-osx failed with exit code 1

update min version also in OSX.cmake