Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Nov 15, 2023

This is the last step before #21778. We need LLVM 17.x so that lld has -fixup_chains.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 15, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK theuni, TheCharlatan
Concept ACK hebasto

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #21778 (build: LLD based macOS toolchain by fanquake)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@hebasto
Copy link
Member

hebasto commented Nov 15, 2023

Concept ACK.

@hebasto
Copy link
Member

hebasto commented Nov 15, 2023

this PR also unblocks #28622 (C++20)

... due to this commit that fixes Qt package build.

@fanquake
Copy link
Member Author

From Guix build logs it follows that Clang 15.0.7 is used. Not Clang 17?

I don't think so? If that was the case the Guix builds in #28622 would be failing to build Qt? They are currently working with the most recent push, and addition of -platform_version.

@hebasto
Copy link
Member

hebasto commented Nov 15, 2023

From Guix build logs it follows that Clang 15.0.7 is used. Not Clang 17?

I don't think so?

Right. There was a wrong build setup on my side. Sorry for the noise.

@hebasto
Copy link
Member

hebasto commented Nov 15, 2023

My Guix builds:

x86_64
34e5ff49486a0777be8c0cba514a0de0e010573ada67c4e7fc0d5f46b4489ac2  guix-build-1a9d3eb54ba0/output/arm64-apple-darwin/SHA256SUMS.part
c0b4a1b61a9b65c1765fbf33b1c0ea53b1f6aeb5efd5e3a2051f193f34f345fd  guix-build-1a9d3eb54ba0/output/arm64-apple-darwin/bitcoin-1a9d3eb54ba0-arm64-apple-darwin-unsigned.tar.gz
911b8fa0cdc61195e96c479b5173b333f9efa647cbc71ef499284905ef3e1e1b  guix-build-1a9d3eb54ba0/output/arm64-apple-darwin/bitcoin-1a9d3eb54ba0-arm64-apple-darwin-unsigned.zip
6d923922da2690b0e057b5e6311dfea178bcfa7b57bdd1b07ab6b33420bc5f8c  guix-build-1a9d3eb54ba0/output/arm64-apple-darwin/bitcoin-1a9d3eb54ba0-arm64-apple-darwin.tar.gz
3f049d21a4102125285d22d4a8254aee610cb27aa2420c5d8963641e98d9ca82  guix-build-1a9d3eb54ba0/output/dist-archive/bitcoin-1a9d3eb54ba0.tar.gz
8f3ce1981dd866e4406a20b88a156f50ce361b612a364b7716452211d257f174  guix-build-1a9d3eb54ba0/output/x86_64-apple-darwin/SHA256SUMS.part
4ec15175a10cdda529323468eb013b457ebaaeecbcbebf8b137dbeab6d60120d  guix-build-1a9d3eb54ba0/output/x86_64-apple-darwin/bitcoin-1a9d3eb54ba0-x86_64-apple-darwin-unsigned.tar.gz
b42232cca761c261ff88eaaef1f67ac5db57402b93d836579e6c875cc35a4b94  guix-build-1a9d3eb54ba0/output/x86_64-apple-darwin/bitcoin-1a9d3eb54ba0-x86_64-apple-darwin-unsigned.zip
b5f2396c0928ca70fb6494b3345f94cd25672e9ea91a5478631a5acddb26248c  guix-build-1a9d3eb54ba0/output/x86_64-apple-darwin/bitcoin-1a9d3eb54ba0-x86_64-apple-darwin.tar.gz

@hebasto
Copy link
Member

hebasto commented Nov 15, 2023

Guix hashes for arm64-apple-darwin differs across the build platforms, unfortunately.

@fanquake
Copy link
Member Author

Removed LDFLAGS=-Wno-error=unused-command-line-argument from the CI in the depends bump commit. Also added a commit to remove the no-longer used pyhton3-setuptools dep. Also rebsaed on recent merges. Still have to investigate the non-determinism.

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64)

File commit a73715e
(master)
commit 5dacd79
(master and this pull)
SHA256SUMS.part d118fb1ee94f7477... 9d2624c62d93e44e...
*-aarch64-linux-gnu-debug.tar.gz fddb55afeab56ace... 013fca08df3c9f11...
*-aarch64-linux-gnu.tar.gz 7480a14c741422e2... 6c6260ebcc3bb93b...
*-arm-linux-gnueabihf-debug.tar.gz 64d300a1ae2c888e... e1b4a9405692bb06...
*-arm-linux-gnueabihf.tar.gz 8d1ebbf4368b3600... 8d9e1b521f3e7380...
*-arm64-apple-darwin-unsigned.tar.gz 92facb464ba137dc... bdab314df74dc720...
*-arm64-apple-darwin-unsigned.zip 2a2df1315b35b63a... 5664ada4cfd7dfec...
*-arm64-apple-darwin.tar.gz f6ae0d227a86283b... 4ca8eb5502168495...
*-powerpc64-linux-gnu-debug.tar.gz e298c0bfb516dada... 18c13a3f12b0ef38...
*-powerpc64-linux-gnu.tar.gz be05549bd5ef4dc6... bbe019b3e1e2d40d...
*-powerpc64le-linux-gnu-debug.tar.gz 3d9344a835e7b239... abcc4014c76d99e2...
*-powerpc64le-linux-gnu.tar.gz 13d301cec56f0aa8... f9db2334eef8bdfa...
*-riscv64-linux-gnu-debug.tar.gz 3033c2c4c6cc67cf... 630626d9f8949eb3...
*-riscv64-linux-gnu.tar.gz 34a33f35b305dc1d... 5bc1d65b208c299c...
*-x86_64-apple-darwin-unsigned.tar.gz d7eb0d12f1508e6f... 8ee087635bf907a3...
*-x86_64-apple-darwin-unsigned.zip e0e9a8f7507975c5... 3a8e86518b028ae9...
*-x86_64-apple-darwin.tar.gz 2652e587357439b4... 0b54b017ca15bdba...
*-x86_64-linux-gnu-debug.tar.gz 4f40b27fabad419d... 35cdfb2032f8a6f1...
*-x86_64-linux-gnu.tar.gz d3641191fc2b7899... c6957209926a2d1c...
*.tar.gz 2a328641c577f4e4... df5d4f3f78e33930...
guix_build.log 5378b965f34dacc7... 46edefcdf5f8a710...
guix_build.log.diff f6030295d3b19646...

@fanquake
Copy link
Member Author

Guix hashes for arm64-apple-darwin differs across the build platforms, unfortunately.

Looks like the difference is only in bitcoin-qt. I'll check if reverting #28778 (dropping the -O1 workaround) makes things deterministic again. That would be disappointing, and a bit confusing, because it'd mean that things were non-deterministic, then became deterministic with newer Clang, and then went non-deterministic again with an even newer Clang..

@fanquake
Copy link
Member Author

The diff I see between the two bins is:

--- a.txt
+++ b.txt
@@ -1,8 +1,8 @@
-bitcoin-f387bc0783ba_aarch64/bin/bitcoin-qt:
+bitcoin-f387bc0783ba_x86_64/bin/bitcoin-qt:
 (__TEXT,__text) section
 0000000100017364	bti	c
 0000000100017368	sub	sp, sp, #0x30
 000000010001736c	stp	x20, x19, [sp, #0x10]
 0000000100017370	stp	x29, x30, [sp, #0x20]
 0000000100017374	add	x29, sp, #0x20
 0000000100017378	mov	x19, x0
@@ -2987768,31 +2987768,31 @@
 0000000100b7cf38	sub	w9, w9, w8
 0000000100b7cf3c	cmp	w9, #0x10
 0000000100b7cf40	b.lo	0x100b7cfb8
 0000000100b7cf44	and	w10, w9, #0xfffffff0
 0000000100b7cf48	add	w8, w8, w10
 0000000100b7cf4c	movi.4s	v0, #0x1
 0000000100b7cf50	movi.4s	v1, #0x1
-0000000100b7cf54	mov.s	v1[0], w19
+0000000100b7cf54	mov.s	v1[1], w19
 0000000100b7cf58	movi.4s	v2, #0x3c
 0000000100b7cf5c	mov	x11, x10
 0000000100b7cf60	movi.4s	v3, #0x1
 0000000100b7cf64	movi.4s	v4, #0x1
 0000000100b7cf68	mul.4s	v1, v1, v2
 0000000100b7cf6c	mul.4s	v0, v0, v2
 0000000100b7cf70	mul.4s	v3, v3, v2
 0000000100b7cf74	mul.4s	v4, v4, v2
 0000000100b7cf78	subs	w11, w11, #0x10
 0000000100b7cf7c	b.ne	0x100b7cf68
 0000000100b7cf80	uzp2.4s	v2, v3, v4
 0000000100b7cf84	uzp1.4s	v3, v3, v4
 0000000100b7cf88	uzp2.4s	v4, v1, v0
 0000000100b7cf8c	uzp1.4s	v0, v1, v0
-0000000100b7cf90	mul.4s	v0, v3, v0
-0000000100b7cf94	mul.4s	v1, v2, v4
+0000000100b7cf90	mul.4s	v0, v0, v4
+0000000100b7cf94	mul.4s	v1, v2, v3
 0000000100b7cf98	mul.4s	v0, v1, v0
 0000000100b7cf9c	ext.16b	v1, v0, v0, #0x8
 0000000100b7cfa0	mul.2s	v0, v0, v1
 0000000100b7cfa4	mov.s	w11, v0[1]
 0000000100b7cfa8	fmov	w12, s0
 0000000100b7cfac	mul	w19, w12, w11
 0000000100b7cfb0	cmp	w9, w10
@@ -2994717,30 +2994717,30 @@
 0000000100b83bcc	sub	w11, w25, w23
 0000000100b83bd0	and	w10, w9, #0xfffffff0
 0000000100b83bd4	and	w8, w28, #0xfffffff0
 0000000100b83bd8	add	w8, w8, w23
 0000000100b83bdc	and	w11, w11, #0xfffffff0
 0000000100b83be0	movi.4s	v0, #0x1
 0000000100b83be4	movi.4s	v1, #0x1
-0000000100b83be8	mov.s	v1[0], w24
-0000000100b83bec	movi.4s	v2, #0xa
-0000000100b83bf0	movi.4s	v3, #0x1
+0000000100b83be8	mov.s	v1[1], w24
+0000000100b83bec	movi.4s	v3, #0xa
+0000000100b83bf0	movi.4s	v2, #0x1
 0000000100b83bf4	movi.4s	v4, #0x1
-0000000100b83bf8	mul.4s	v1, v1, v2
-0000000100b83bfc	mul.4s	v0, v0, v2
-0000000100b83c00	mul.4s	v3, v3, v2
-0000000100b83c04	mul.4s	v4, v4, v2
+0000000100b83bf8	mul.4s	v0, v0, v3
+0000000100b83bfc	mul.4s	v2, v2, v3
+0000000100b83c00	mul.4s	v1, v1, v3
+0000000100b83c04	mul.4s	v4, v4, v3
 0000000100b83c08	subs	w11, w11, #0x10
 0000000100b83c0c	b.ne	0x100b83bf8
-0000000100b83c10	uzp1.4s	v2, v3, v4
-0000000100b83c14	uzp2.4s	v3, v3, v4
-0000000100b83c18	uzp2.4s	v4, v1, v0
-0000000100b83c1c	uzp1.4s	v0, v1, v0
-0000000100b83c20	mul.4s	v0, v3, v0
-0000000100b83c24	mul.4s	v1, v2, v4
+0000000100b83c10	uzp1.4s	v3, v1, v4
+0000000100b83c14	uzp2.4s	v1, v1, v4
+0000000100b83c18	uzp1.4s	v4, v0, v2
+0000000100b83c1c	uzp2.4s	v0, v0, v2
+0000000100b83c20	mul.4s	v0, v0, v1
+0000000100b83c24	mul.4s	v1, v3, v4
 0000000100b83c28	mul.4s	v0, v1, v0
 0000000100b83c2c	ext.16b	v1, v0, v0, #0x8
 0000000100b83c30	mul.2s	v0, v0, v1
 0000000100b83c34	mov.s	w11, v0[1]
 0000000100b83c38	fmov	w12, s0
 0000000100b83c3c	mul	w24, w12, w11
 0000000100b83c40	cmp	w9, w10
@@ -3119330,16 +3119330,16 @@
 0000000100bfd6e0	add.2d	v5, v5, v1
 0000000100bfd6e4	add.2d	v4, v4, v1
 0000000100bfd6e8	stp	q2, q2, [x11], #0x40
 0000000100bfd6ec	subs	x13, x13, #0x8
 0000000100bfd6f0	b.ne	0x100bfd6c4
 0000000100bfd6f4	zip1.2d	v1, v4, v5
 0000000100bfd6f8	zip2.2d	v2, v4, v5
-0000000100bfd6fc	zip2.2d	v4, v0, v3
-0000000100bfd700	zip1.2d	v0, v0, v3
+0000000100bfd6fc	zip1.2d	v4, v0, v3
+0000000100bfd700	zip2.2d	v0, v0, v3
 0000000100bfd704	add.2d	v0, v0, v2
 0000000100bfd708	add.2d	v1, v1, v4
 0000000100bfd70c	add.2d	v0, v1, v0
 0000000100bfd710	addp.2d	d0, v0
 0000000100bfd714	fmov	x11, d0
 0000000100bfd718	cmp	x9, x10
 0000000100bfd71c	b.ne	0x100bfd43c
@@ -3119370,17 +3119370,17 @@
 0000000100bfd780	add.2d	v5, v5, v1
 0000000100bfd784	add.2d	v4, v4, v1
 0000000100bfd788	stp	q2, q2, [x11], #0x40
 0000000100bfd78c	subs	x13, x13, #0x8
 0000000100bfd790	b.ne	0x100bfd764
 0000000100bfd794	zip2.2d	v1, v4, v5
 0000000100bfd798	zip1.2d	v2, v4, v5
-0000000100bfd79c	zip2.2d	v4, v0, v3
-0000000100bfd7a0	zip1.2d	v0, v0, v3
-0000000100bfd7a4	add.2d	v0, v0, v2
+0000000100bfd79c	zip1.2d	v4, v0, v3
+0000000100bfd7a0	zip2.2d	v0, v0, v3
+0000000100bfd7a4	add.2d	v0, v2, v0
 0000000100bfd7a8	add.2d	v1, v1, v4
 0000000100bfd7ac	add.2d	v0, v1, v0
 0000000100bfd7b0	addp.2d	d0, v0
 0000000100bfd7b4	fmov	x11, d0
 0000000100bfd7b8	cmp	x10, x9
 0000000100bfd7bc	b.ne	0x100bfd4f0
 0000000100bfd7c0	add	x8, x19, x9, lsl #3
@@ -3563823,19 +3563823,19 @@
 0000000100daf814	movi.4s	v4, #0x1
 0000000100daf818	mul.4s	v0, v0, v2
 0000000100daf81c	mul.4s	v1, v1, v2
 0000000100daf820	mul.4s	v3, v3, v2
 0000000100daf824	mul.4s	v4, v4, v2
 0000000100daf828	subs	w11, w11, #0x10
 0000000100daf82c	b.ne	0x100daf818
-0000000100daf830	uzp2.4s	v2, v3, v4
-0000000100daf834	uzp1.4s	v3, v3, v4
-0000000100daf838	uzp2.4s	v4, v0, v1
-0000000100daf83c	uzp1.4s	v0, v0, v1
-0000000100daf840	mul.4s	v0, v3, v0
+0000000100daf830	uzp1.4s	v2, v3, v4
+0000000100daf834	uzp2.4s	v3, v3, v4
+0000000100daf838	uzp1.4s	v4, v0, v1
+0000000100daf83c	uzp2.4s	v0, v0, v1
+0000000100daf840	mul.4s	v0, v0, v3
 0000000100daf844	mul.4s	v1, v2, v4
 0000000100daf848	mul.4s	v0, v1, v0
 0000000100daf84c	ext.16b	v1, v0, v0, #0x8
 0000000100daf850	mul.2s	v0, v0, v1
 0000000100daf854	mov.s	w11, v0[1]
 0000000100daf858	fmov	w12, s0
 0000000100daf85c	mul	w11, w12, w11
@@ -3563876,17 +3563876,17 @@
 0000000100daf8e8	mul.4s	v1, v1, v2
 0000000100daf8ec	mul.4s	v3, v3, v2
 0000000100daf8f0	mul.4s	v4, v4, v2
 0000000100daf8f4	subs	w10, w10, #0x10
 0000000100daf8f8	b.ne	0x100daf8e4
 0000000100daf8fc	uzp2.4s	v2, v3, v4
 0000000100daf900	uzp1.4s	v3, v3, v4
-0000000100daf904	uzp2.4s	v4, v0, v1
-0000000100daf908	uzp1.4s	v0, v0, v1
-0000000100daf90c	mul.4s	v0, v3, v0
+0000000100daf904	uzp1.4s	v4, v0, v1
+0000000100daf908	uzp2.4s	v0, v0, v1
+0000000100daf90c	mul.4s	v0, v0, v3
 0000000100daf910	mul.4s	v1, v2, v4
 0000000100daf914	mul.4s	v0, v1, v0
 0000000100daf918	ext.16b	v1, v0, v0, #0x8
 0000000100daf91c	mul.2s	v0, v0, v1
 0000000100daf920	mov.s	w10, v0[1]
 0000000100daf924	fmov	w11, s0
 0000000100daf928	mul	w10, w11, w10
@@ -4194297,8 +4194297,8 @@
 000000010101733c	sub	x11, x11, x10
 0000000101017340	add	x11, x11, #0x10
 0000000101017344	str	x11, [x9, x10]
 0000000101017348	b	0x1010173f0
 000000010101734c	ldr	w8, [x20, #0x28]
 0000000101017350	add	w8, w8, #0x1
 0000000101017354	str	w8, [x20, #0x28]

@fanquake
Copy link
Member Author

I'll check if reverting #28778 (dropping the -O1 workaround) makes things deterministic again.

It does not. Building this branch: https://github.com/fanquake/bitcoin/tree/llvm_17_0_5_macos_deps_test, still results in non-deterministic binaries.

@fanquake fanquake force-pushed the llvm_17_0_5_macos_deps branch 3 times, most recently from 33600b4 to 5b10fb9 Compare November 28, 2023 11:41
@fanquake
Copy link
Member Author

In _QUtcTimeZonePrivate::offsetFromUtcString(QByteArray const&), which exists in corelib:

-bitcoin-qt_aarch64:	file format mach-o arm64
+bitcoin-qt_x86_64:	file format mach-o arm64
 
 Disassembly of section __TEXT,__text:
 
 0000000100b78e48 <__ZN19QUtcTimeZonePrivate19offsetFromUtcStringERK10QByteArray>:
 100b78e48: d10143ff    	sub	sp, sp, #80
 100b78e4c: a9015ff8    	stp	x24, x23, [sp, #16]
 100b78e50: a90257f6    	stp	x22, x21, [sp, #32]
@@ -156,16 +156,16 @@
 100b7909c: 4f000424    	movi.4s	v4, #1
 100b790a0: 4ea29c21    	mul.4s	v1, v1, v2
 100b790a4: 4ea29c00    	mul.4s	v0, v0, v2
 100b790a8: 4ea29c63    	mul.4s	v3, v3, v2
 100b790ac: 4ea29c84    	mul.4s	v4, v4, v2
 100b790b0: 7100416b    	subs	w11, w11, #16
 100b790b4: 54ffff61    	b.ne	0x100b790a0 <__ZN19QUtcTimeZonePrivate19offsetFromUtcStringERK10QByteArray+0x258>
-100b790b8: 4e845862    	uzp2.4s	v2, v3, v4
-100b790bc: 4e841863    	uzp1.4s	v3, v3, v4
+100b790b8: 4e841862    	uzp1.4s	v2, v3, v4
+100b790bc: 4e845863    	uzp2.4s	v3, v3, v4
 100b790c0: 4e801824    	uzp1.4s	v4, v1, v0
 100b790c4: 4e805820    	uzp2.4s	v0, v1, v0
 100b790c8: 4ea09c60    	mul.4s	v0, v3, v0
 100b790cc: 4ea49c41    	mul.4s	v1, v2, v4
 100b790d0: 4ea09c20    	mul.4s	v0, v1, v0
 100b790d4: 6e004001    	ext.16b	v1, v0, v0, #8
 100b790d8: 0ea19c00    	mul.2s	v0, v0, v1

@maflcko
Copy link
Member

maflcko commented Nov 30, 2023

Would there be any downside in going forward with #28851 instead, and then reverting it as part of this pull, once and if it is ready?

@fanquake
Copy link
Member Author

fanquake commented Dec 1, 2023

I was hoping we'd figure out all the determinism issues in Qt, but I guess C++20 also doesn't want to wait much longer. I'll add a reversion of #28851 here.

@fanquake fanquake force-pushed the llvm_17_0_5_macos_deps branch 2 times, most recently from 5a28b91 to b736ef7 Compare December 5, 2023 12:10
@fanquake
Copy link
Member Author

fanquake commented Dec 5, 2023

Updated to LLVM 17.0.6 in depends and based on top of #28622. Also sent a patch to update LLVM in Guix to 17.0.6: https://lists.gnu.org/archive/html/guix-patches/2023-12/msg00226.html.

@maflcko
Copy link
Member

maflcko commented Dec 6, 2023

Building 17.0.5 failed for me on riscv64: /var/log/guix/drvs/9k/xxqy3shpf5b3ajmw1ar2zrbm2a8pyp-llvm-17.0.5.drv.gz:

...
[ 93%] Linking CXX executable ../../bin/dsymutil
cd /tmp/guix-build-llvm-17.0.5.drv-0/source/build/tools/dsymutil && /gnu/store/v9d5kgjpkcgfwc5k1jsq8a6i2qxmp9fw-cmake-minimal-3.24.2/bin/cmake -E cmake_link_script CMakeFiles/dsymutil.dir/link.txt --verbose=1
/gnu/store/dcrdgy1rjkh0kibpkw6v2mia7f921b27-gcc-11.3.0/bin/c++  -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -O3 -DNDEBUG  -Wl,--gc-sections CMakeFiles/dsymutil.dir/dsymutil.cpp.o CMakeFiles/dsymutil.dir/BinaryHolder.cpp.o CMakeFiles/dsymutil.dir/CFBundle.cpp.o CMakeFiles/dsymutil.dir/DebugMap.cpp.o CMakeFiles/dsymutil.dir/DwarfLinkerForBinary.cpp.o CMakeFiles/dsymutil.dir/MachODebugMapParser.cpp.o CMakeFiles/dsymutil.dir/MachOUtils.cpp.o CMakeFiles/dsymutil.dir/Reproducer.cpp.o CMakeFiles/dsymutil.dir/SymbolMap.cpp.o -o ../../bin/dsymutil  -Wl,-rpath,/tmp/guix-build-llvm-17.0.5.drv-0/source/build/lib::::::::: ../../lib/libLLVM-17.so
ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
ld: /gnu/store/hs6g34kf7z2sdc7sc60ngkdnysy782bl-gcc-11.3.0-lib/lib/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tools/dsymutil/CMakeFiles/dsymutil.dir/build.make:229: bin/dsymutil] Error 1
make[2]: Leaving directory '/tmp/guix-build-llvm-17.0.5.drv-0/source/build'
make[1]: *** [CMakeFiles/Makefile2:30805: tools/dsymutil/CMakeFiles/dsymutil.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@fanquake
Copy link
Member Author

fanquake commented Dec 6, 2023

Building 17.0.5 failed for me on riscv64:

Nice. Glad we've now got Guix on RISC-V. I guess this is either a bug in LLVM (i.e a missing an -latomic), or in the combination of GCC 11 & LLVM 17. Will take a look.

@fanquake
Copy link
Member Author

This is now reproducible, and reviewable.

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b335710.

Amazing detective work on the qt determinism fixes 🤯 !

I haven't tested or scrutinized to determine if that's the minimal patching we need. This seems low-impact enough it doesn't really matter if it's a bit heavy-handed.

@DrahtBot DrahtBot requested a review from hebasto December 21, 2023 16:24
@TheCharlatan
Copy link
Contributor

TheCharlatan commented Dec 21, 2023

I'm getting an error during the guix build:

  adding: bitcoin-b335710782c2/lib/libbitcoinconsensus-0.dll.dbg (deflated 76%)
INFO: Building b335710782c2 for platform triple x86_64-apple-darwin:
      ...using reference timestamp: 1702996424
      ...running at most 30 jobs
      ...from worktree directory: '/home/drgrid/Documents/bitcoin'
          ...bind-mounted in container to: '/bitcoin'
      ...in build directory: '/home/drgrid/Documents/bitcoin/guix-build-b335710782c2/distsrc-b335710782c2-x86_64-apple-darwin'
          ...bind-mounted in container to: '/distsrc-base/distsrc-b335710782c2-x86_64-apple-darwin'
      ...outputting in: '/home/drgrid/Documents/bitcoin/guix-build-b335710782c2/output/x86_64-apple-darwin'
          ...bind-mounted in container to: '/outdir-base/x86_64-apple-darwin'
The following derivations will be built:
  /gnu/store/zj1dj50zqqwaz9230x49yb80z5f7x3fq-clang-toolchain-17.0.6.drv
  /gnu/store/2fcdnjvxdi2sjq1d6f3b5f926z62nkyf-clang-17.0.6.drv
  /gnu/store/3imcrwkrljpqfzw481019j3hfk26gq6x-llvm-project-17.0.6-checkout.drv
  /gnu/store/gw1jlk6gmg9304rmi9b9xmrhi1ndijky-llvm-project-17.0.6-checkout.drv
  /gnu/store/gaxq4y6nwbljpkrg19rbh1p3s0bgv0an-clang-tools-extra-17.0.6.src.tar.xz.drv
  /gnu/store/j188b0ar5lq8i9zq6v52p57q7p9bacsl-clang-runtime-17.0.6.drv
  /gnu/store/wjx8bkzzmijjq6w7zphc1h709jj4yl51-llvm-17.0.6.drv
  /gnu/store/fdxpzdn6h39n7n76fs2fnqlkl2myyvq1-libomp-17.0.6.drv

building /gnu/store/gaxq4y6nwbljpkrg19rbh1p3s0bgv0an-clang-tools-extra-17.0.6.src.tar.xz.drv...
building /gnu/store/gw1jlk6gmg9304rmi9b9xmrhi1ndijky-llvm-project-17.0.6-checkout.drv...
building /gnu/store/3imcrwkrljpqfzw481019j3hfk26gq6x-llvm-project-17.0.6-checkout.drv...
building /gnu/store/wjx8bkzzmijjq6w7zphc1h709jj4yl51-llvm-17.0.6.drv...
building /gnu/store/j188b0ar5lq8i9zq6v52p57q7p9bacsl-clang-runtime-17.0.6.drv...
building /gnu/store/2fcdnjvxdi2sjq1d6f3b5f926z62nkyf-clang-17.0.6.drv...
building /gnu/store/fdxpzdn6h39n7n76fs2fnqlkl2myyvq1-libomp-17.0.6.drv...
building /gnu/store/zj1dj50zqqwaz9230x49yb80z5f7x3fq-clang-toolchain-17.0.6.drv...
The following derivation will be built:
  /gnu/store/xcf164di7qmwj00a86y9q4l83qk1k54w-profile.drv

applying 3 grafts for clang-runtime-17.0.6 ...
applying 4 grafts for llvm-17.0.6 ...
applying 13 grafts for clang-17.0.6 ...
applying 5 grafts for libomp-17.0.6 ...
applying 10 grafts for clang-toolchain-17.0.6 ...
building CA certificate bundle...
listing Emacs sub-directories...
building fonts directory...
building directory of Info manuals...
building profile with 32 packages...
Required environment variables as seen inside the container:
    DIST_ARCHIVE_BASE: /outdir-base/dist-archive
    DISTNAME: bitcoin-b335710782c2
    HOST: x86_64-apple-darwin
    SOURCE_DATE_EPOCH: 1702996424
    JOBS: 30
    DISTSRC: /distsrc-base/distsrc-b335710782c2-x86_64-apple-darwin
    OUTDIR: /outdir-base/x86_64-apple-darwin
make: Entering directory '/bitcoin/depends'
Building native_libtapi...
/gnu/store/v9p25q9l5nnaixkhpap5rnymmwbhf9rp-bash-minimal-5.1.16/bin/sh: line 1: ./build.sh: No such file or directory
make: *** [funcs.mk:291: /bitcoin/depends/work/build/x86_64-apple-darwin/native_libtapi/eb33a59f2e30ff9724dc1ea8bee8b5229b0557c9-226d9d824f3/./.stamp_built] Error 127

EDIT: I guess this is a cache issue, just weird that both my machines ran into this. Will rebuild.

@fanquake
Copy link
Member Author

Can you try cleaning up in your depends / work dirs? I've seen something similar after partial / interrupted builds (with changes unrelated to this one).

Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b335710

Guix builds (aarch64 & x86_64)

65981453fcb83338ed76435dc8fed06e9903441731b461e4f2c8a04ad102043c  guix-build-b335710782c2/output/aarch64-linux-gnu/SHA256SUMS.part
3127d18bc55a7a207eb7e1252feaf24f767d5983e5d064323671139659c4f3d7  guix-build-b335710782c2/output/aarch64-linux-gnu/bitcoin-b335710782c2-aarch64-linux-gnu-debug.tar.gz
0a67737c010e742249f07dd3ca3ae289df02edf2dedd8d6a5a07b291921bab47  guix-build-b335710782c2/output/aarch64-linux-gnu/bitcoin-b335710782c2-aarch64-linux-gnu.tar.gz
7c315f9ccda8bffd4fd70bb51a1342d300e6039791d7e8a953ff1252d05c55b8  guix-build-b335710782c2/output/arm-linux-gnueabihf/SHA256SUMS.part
b677023cff7c2f82d01393616a4029aeb2b58d4c524b2241bf4d62c7e218f2b2  guix-build-b335710782c2/output/arm-linux-gnueabihf/bitcoin-b335710782c2-arm-linux-gnueabihf-debug.tar.gz
c8c0af592db397deb7f311a99acbc11de9de3d5112a237f198042ef8bf23d5cd  guix-build-b335710782c2/output/arm-linux-gnueabihf/bitcoin-b335710782c2-arm-linux-gnueabihf.tar.gz
e5c04f3b25b67e22d2b73e55e19baa510bee65f8d6464c2c20ec5d2227476a55  guix-build-b335710782c2/output/arm64-apple-darwin/SHA256SUMS.part
b8715006781829ad051e181812d66ced43344aa1b13dd2e84b81eeb68adea68a  guix-build-b335710782c2/output/arm64-apple-darwin/bitcoin-b335710782c2-arm64-apple-darwin-unsigned.tar.gz
4aaf51a8d510c5d07e1773498626cf6b23a8f09949d93d9dc71598e8afaf9df8  guix-build-b335710782c2/output/arm64-apple-darwin/bitcoin-b335710782c2-arm64-apple-darwin-unsigned.zip
4bbda33089e51a2f4e11ede6fd16b700b975312903e9e5ca81de6454b2bc5aa3  guix-build-b335710782c2/output/arm64-apple-darwin/bitcoin-b335710782c2-arm64-apple-darwin.tar.gz
4a157d0fc52890e41161bf979535a2cb93f76d68fc52192da768ffb052c5450d  guix-build-b335710782c2/output/dist-archive/bitcoin-b335710782c2.tar.gz
5a1a79720de4fa309b7994b59a40a993b86ea8713488a070fca8680a82f0050f  guix-build-b335710782c2/output/powerpc64-linux-gnu/SHA256SUMS.part
fe85f055b38152f6eb46b8cbce9c05483dfaa42dabac8240565b88d892c04133  guix-build-b335710782c2/output/powerpc64-linux-gnu/bitcoin-b335710782c2-powerpc64-linux-gnu-debug.tar.gz
5d2af441e1c93d310b77523222706ab898bd7628a3694b3fd86f246c37210ecc  guix-build-b335710782c2/output/powerpc64-linux-gnu/bitcoin-b335710782c2-powerpc64-linux-gnu.tar.gz
2a8f2193f1d6a6f4d9e048a8f095f657a5e6a8e30f1cf78de677f4a86c311a8f  guix-build-b335710782c2/output/powerpc64le-linux-gnu/SHA256SUMS.part
22d554d75352d3a76eeaa9fcd157c33aa3c76259d07da14d2d40550f31bb065d  guix-build-b335710782c2/output/powerpc64le-linux-gnu/bitcoin-b335710782c2-powerpc64le-linux-gnu-debug.tar.gz
7b49606830140c081fece3ec70004025f944da2d7c27f723b1909fc625cdf5fc  guix-build-b335710782c2/output/powerpc64le-linux-gnu/bitcoin-b335710782c2-powerpc64le-linux-gnu.tar.gz
cd166f781272140535075f697ca7dcdeec2cb53a753ab711b8d31eb2d794d77a  guix-build-b335710782c2/output/riscv64-linux-gnu/SHA256SUMS.part
dae035d4b49ebba7d08f934aa85c0e03c278851f6d2a24aa2bcbc140ca916418  guix-build-b335710782c2/output/riscv64-linux-gnu/bitcoin-b335710782c2-riscv64-linux-gnu-debug.tar.gz
6b3c058a9b44ffbc84eb40e6c2111457f241c6d02f4e2d862fd04d7a4321f9c4  guix-build-b335710782c2/output/riscv64-linux-gnu/bitcoin-b335710782c2-riscv64-linux-gnu.tar.gz
a31713a5184f7ddc8be3419a15e3bef1e1b4609df5677dcd8d506bd9841f4701  guix-build-b335710782c2/output/x86_64-apple-darwin/SHA256SUMS.part
c22d8f3d8e6d5fa9eeed49a666d550af7659917f94cb0e13c533035f40b8ad28  guix-build-b335710782c2/output/x86_64-apple-darwin/bitcoin-b335710782c2-x86_64-apple-darwin-unsigned.tar.gz
976017307b2d18c402153457918e00869089f0396f603659d1b019b84a84cff7  guix-build-b335710782c2/output/x86_64-apple-darwin/bitcoin-b335710782c2-x86_64-apple-darwin-unsigned.zip
d1a8de93bc228b35c16ddc6e314d7d313b19dbaf799d98bd805887b5150fda23  guix-build-b335710782c2/output/x86_64-apple-darwin/bitcoin-b335710782c2-x86_64-apple-darwin.tar.gz
9746aca5706fbc20418b944d2d7f158fb0a17bbb8a3da2c81c1011fe1691d259  guix-build-b335710782c2/output/x86_64-linux-gnu/SHA256SUMS.part
4b11422997062fddaf6a0a7a36ca0a9cccddadfe63672d5661e0ad512180b2a5  guix-build-b335710782c2/output/x86_64-linux-gnu/bitcoin-b335710782c2-x86_64-linux-gnu-debug.tar.gz
25d03b0b0b59933c8dbd7c003da2f8e13a4b81cc4b03ab72a11e260214deb3bc  guix-build-b335710782c2/output/x86_64-linux-gnu/bitcoin-b335710782c2-x86_64-linux-gnu.tar.gz
bc9cafc1ff3bea6ece3aabb69f4426b6689edc0498acab56581d9f7eb72c1026  guix-build-b335710782c2/output/x86_64-w64-mingw32/SHA256SUMS.part
e7590223e27d2e13f9b766f5c2515f73dfe7848782ddf078613f62f4d59898eb  guix-build-b335710782c2/output/x86_64-w64-mingw32/bitcoin-b335710782c2-win64-debug.zip
86431fea6cb3d62cc9be2b30d1a7516ff7f7f0f09ae7f65fafcf6925d036157d  guix-build-b335710782c2/output/x86_64-w64-mingw32/bitcoin-b335710782c2-win64-setup-unsigned.exe
210527aa5b2dbf6b5687ed7504339b85ba35a2bfb68a3fffc4e9b16bd4ce7be7  guix-build-b335710782c2/output/x86_64-w64-mingw32/bitcoin-b335710782c2-win64-unsigned.tar.gz
edf3f6397d04481efd23385896f76babf46f5bb20a16042605f88e694b62ab01  guix-build-b335710782c2/output/x86_64-w64-mingw32/bitcoin-b335710782c2-win64.zip

Looking over the determinism patch, avoiding the clang optimizations for these functions seems without noticeable consequence. Similarly, the sort change should not make much of a difference in the GUI either.

@@ -0,0 +1,84 @@
Modify optimisation flags for various functions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I guess this should mention std::sort too? Or maybe even put that into a separate patch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can shuffle this all around again, the next time we bump Qt (new LTS has just been released), and have to inevitably rebase/update all these patches?

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64)

File commit 7524fcf
(master)
commit add9a9e
(master and this pull)
SHA256SUMS.part 359386ba668fbf66... d2bd0d7a29130700...
*-aarch64-linux-gnu-debug.tar.gz ddae6770fe3b8bf4... ec93d858660026e4...
*-aarch64-linux-gnu.tar.gz fb764fbb6d7bcdb3... 8a105c70712171a3...
*-arm-linux-gnueabihf-debug.tar.gz 8af275a6036df503... bf80c779c3decc46...
*-arm-linux-gnueabihf.tar.gz ad486e7742e4e08c... 52ca0fac3fe694ea...
*-arm64-apple-darwin-unsigned.tar.gz ef84802436c00b8f... b56a81afc4ebcbd0...
*-arm64-apple-darwin-unsigned.zip 7acd13728bf8607f... badb3613bfa14b2b...
*-arm64-apple-darwin.tar.gz fe61b75739790eec... 1a4acce856f63ebe...
*-powerpc64-linux-gnu-debug.tar.gz 371e9b2a45d2f8c7... 10491e4f9b912777...
*-powerpc64-linux-gnu.tar.gz 47c0d30a65322263... e41f6f129c6c11ba...
*-powerpc64le-linux-gnu-debug.tar.gz f1831479ca025631... 0f837fe25febee47...
*-powerpc64le-linux-gnu.tar.gz 1946e4d1a9dbb7e6... 9341eb7bc775c98a...
*-riscv64-linux-gnu-debug.tar.gz 5f5ac200eea5f437... 5a10f7720f56d023...
*-riscv64-linux-gnu.tar.gz c2b5c8787ee21961... a5b2fd4f2a06514c...
*-x86_64-apple-darwin-unsigned.tar.gz 056bbce834def497... 36583fa5cad86fbc...
*-x86_64-apple-darwin-unsigned.zip 3d9a79a8513fb498... 63f9537e253ce16b...
*-x86_64-apple-darwin.tar.gz 9171645726be0197... 28266595f984a4b1...
*-x86_64-linux-gnu-debug.tar.gz 083eed064bc0895a... 070825935c8394d0...
*-x86_64-linux-gnu.tar.gz 306fb33fc9ecc64a... a0da6bcd646ef0f4...
*.tar.gz 7ac01eb848d7d58a... 491f9e23abcd7230...
guix_build.log 5c35c3ddd4b3c8a9... a2257eaba45852ae...
guix_build.log.diff 0c023b3076630100...

@fanquake
Copy link
Member Author

EDIT: I guess this is a cache issue, just weird that both my machines ran into this. Will rebuild.

Thankfully the likelyhood if this occuring will be largely reduced after #28880.

@fanquake fanquake merged commit 4b1196a into bitcoin:master Dec 22, 2023
@fanquake fanquake deleted the llvm_17_0_5_macos_deps branch December 22, 2023 10:36
void _q_columnsAboutToBeInserted(const QModelIndex &parent, int start, int end);
void _q_layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
- void _q_layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
+ __attribute__ ((optnone)) void _q_layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b335710

Being a clang-specific attribute it should be properly gated to do not produce warning: 'optnone' attribute directive ignored [-Wattributes].

However, such warnings are harmless for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Qt build already produces heaps of other irrelevant warning output, so I'm not sure this makes any real difference? Properly gateing this would also just increase the patch size, and make rebasing them harder?

This same thing also already occurs for other qt patches, i.e fast_fixed_dtoa_no_optimize, where clang already warns about ignoring the pragma usage.

@hebasto
Copy link
Member

hebasto commented Dec 22, 2023

What behavior changes we might expect due to replacing std::stable_sort with std::sort?

How do we ensure that no subtle bugs are introduced?

fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 14, 2024
This includes a commit to fix building LLVM 17 on riscv64, see
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e26331a5ee87928a16888c36d51e270f0f10f90.

Followup to discussion in
bitcoin#28880 (comment).

If you don't have riscv64 hardware, this can be tested with the
following:
```bash
guix time-machine --commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc -- build --target=riscv64-linux-gnu  llvm
....
riscv64-linux-gnu-ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
riscv64-linux-gnu-ld: /gnu/store/i4ga0pnr1b74bir2bjyp8mcrrbsvk7d3-gcc-cross-riscv64-linux-gnu-11.3.0-lib/riscv64-linux-gnu/lib/libatomic.so.1:
  error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

guix time-machine --commit=dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a -- build --target=riscv64-linux-gnu  llvm
....
grafting '/gnu/store/7y0j0y8jaz4mjx2nz0y42wdnxxjp6id6-llvm-17.0.6-opt-viewer' -> '/gnu/store/8xvahrrjscbprh6cjj0qp5bm9mm78wwa-llvm-17.0.6-opt-viewer'...
grafting '/gnu/store/bjhw648bz7ijd2p9hgzzdbw1q8hpagk8-llvm-17.0.6' -> '/gnu/store/x50qi8i2ywgpx6azv4k55ms0w5xjxxg5-llvm-17.0.6'...
successfully built /gnu/store/q9xvk8gzzvb4dxfzf6yi5164zd0d1vj2-llvm-17.0.6.drv
```
fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 14, 2024
This includes a commit to fix building LLVM 17 on riscv64, see
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e26331a5ee87928a16888c36d51e270f0f10f90.

Followup to discussion in
bitcoin#28880 (comment).

If you don't have riscv64 hardware, this can be tested with the
following:
```bash
guix time-machine --commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc -- build --target=riscv64-linux-gnu  llvm
....
riscv64-linux-gnu-ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
riscv64-linux-gnu-ld: /gnu/store/i4ga0pnr1b74bir2bjyp8mcrrbsvk7d3-gcc-cross-riscv64-linux-gnu-11.3.0-lib/riscv64-linux-gnu/lib/libatomic.so.1:
  error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

guix time-machine --commit=dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a -- build --target=riscv64-linux-gnu  llvm
....
grafting '/gnu/store/7y0j0y8jaz4mjx2nz0y42wdnxxjp6id6-llvm-17.0.6-opt-viewer' -> '/gnu/store/8xvahrrjscbprh6cjj0qp5bm9mm78wwa-llvm-17.0.6-opt-viewer'...
grafting '/gnu/store/bjhw648bz7ijd2p9hgzzdbw1q8hpagk8-llvm-17.0.6' -> '/gnu/store/x50qi8i2ywgpx6azv4k55ms0w5xjxxg5-llvm-17.0.6'...
successfully built /gnu/store/q9xvk8gzzvb4dxfzf6yi5164zd0d1vj2-llvm-17.0.6.drv
```
fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 15, 2024
This includes a commit to fix building LLVM 17 on riscv64, see
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e26331a5ee87928a16888c36d51e270f0f10f90.

Followup to discussion in
bitcoin#28880 (comment).

If you don't have riscv64 hardware, this can be tested with the
following:
```bash
guix time-machine --commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc -- build --target=riscv64-linux-gnu  llvm
....
riscv64-linux-gnu-ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
riscv64-linux-gnu-ld: /gnu/store/i4ga0pnr1b74bir2bjyp8mcrrbsvk7d3-gcc-cross-riscv64-linux-gnu-11.3.0-lib/riscv64-linux-gnu/lib/libatomic.so.1:
  error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

guix time-machine --commit=dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a -- build --target=riscv64-linux-gnu  llvm
....
grafting '/gnu/store/7y0j0y8jaz4mjx2nz0y42wdnxxjp6id6-llvm-17.0.6-opt-viewer' -> '/gnu/store/8xvahrrjscbprh6cjj0qp5bm9mm78wwa-llvm-17.0.6-opt-viewer'...
grafting '/gnu/store/bjhw648bz7ijd2p9hgzzdbw1q8hpagk8-llvm-17.0.6' -> '/gnu/store/x50qi8i2ywgpx6azv4k55ms0w5xjxxg5-llvm-17.0.6'...
successfully built /gnu/store/q9xvk8gzzvb4dxfzf6yi5164zd0d1vj2-llvm-17.0.6.drv
```
fanquake added a commit that referenced this pull request Mar 21, 2024
…9c2b68bd6b5a

cf5faf7 guix: bump time-machine to dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a (fanquake)

Pull request description:

  This includes a commit to fix building LLVM 17 on riscv64, see https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e26331a5ee87928a16888c36d51e270f0f10f90.

  Followup to discussion in #28880 (comment).

  If you don't have riscv64 hardware, this can be tested with the following:
  ```bash
  # observe failure when cross-compiling using our current time-machine
  guix time-machine --commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc -- build --target=riscv64-linux-gnu  llvm
  ....
  riscv64-linux-gnu-ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
  riscv64-linux-gnu-ld: /gnu/store/i4ga0pnr1b74bir2bjyp8mcrrbsvk7d3-gcc-cross-riscv64-linux-gnu-11.3.0-lib/riscv64-linux-gnu/lib/libatomic.so.1:
    error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status

  # build success when using the new time-machine
  guix time-machine --commit=dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a -- build --target=riscv64-linux-gnu  llvm
  ....
  grafting '/gnu/store/7y0j0y8jaz4mjx2nz0y42wdnxxjp6id6-llvm-17.0.6-opt-viewer' -> '/gnu/store/8xvahrrjscbprh6cjj0qp5bm9mm78wwa-llvm-17.0.6-opt-viewer'...
  grafting '/gnu/store/bjhw648bz7ijd2p9hgzzdbw1q8hpagk8-llvm-17.0.6' -> '/gnu/store/x50qi8i2ywgpx6azv4k55ms0w5xjxxg5-llvm-17.0.6'...
  successfully built /gnu/store/q9xvk8gzzvb4dxfzf6yi5164zd0d1vj2-llvm-17.0.6.drv
  ```

  Also includes at least:
  Linux Headers 6.1.67 -> 6.1.80

ACKs for top commit:
  TheCharlatan:
    ACK cf5faf7
  hebasto:
    ACK cf5faf7, tested on x86_64 hardware as described in the PR description.

Tree-SHA512: b49d4f90effeec666b12b5447a24c90315b82675cfc166bc1230ac173134bab6b277fc7e064bbb75e990275165b2b27d88e4ec1cdeea4750541ec6443cb50f41
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Apr 6, 2024
This includes a commit to fix building LLVM 17 on riscv64, see
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4e26331a5ee87928a16888c36d51e270f0f10f90.

Followup to discussion in
bitcoin/bitcoin#28880 (comment).

If you don't have riscv64 hardware, this can be tested with the
following:
```bash
guix time-machine --commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc -- build --target=riscv64-linux-gnu  llvm
....
riscv64-linux-gnu-ld: CMakeFiles/dsymutil.dir/dsymutil.cpp.o: undefined reference to symbol '__atomic_fetch_and_1@@LIBATOMIC_1.0'
riscv64-linux-gnu-ld: /gnu/store/i4ga0pnr1b74bir2bjyp8mcrrbsvk7d3-gcc-cross-riscv64-linux-gnu-11.3.0-lib/riscv64-linux-gnu/lib/libatomic.so.1:
  error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

guix time-machine --commit=dc4842797bfdc5f9f3f5f725bf189c2b68bd6b5a -- build --target=riscv64-linux-gnu  llvm
....
grafting '/gnu/store/7y0j0y8jaz4mjx2nz0y42wdnxxjp6id6-llvm-17.0.6-opt-viewer' -> '/gnu/store/8xvahrrjscbprh6cjj0qp5bm9mm78wwa-llvm-17.0.6-opt-viewer'...
grafting '/gnu/store/bjhw648bz7ijd2p9hgzzdbw1q8hpagk8-llvm-17.0.6' -> '/gnu/store/x50qi8i2ywgpx6azv4k55ms0w5xjxxg5-llvm-17.0.6'...
successfully built /gnu/store/q9xvk8gzzvb4dxfzf6yi5164zd0d1vj2-llvm-17.0.6.drv
```
@hebasto hebasto mentioned this pull request Oct 15, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Nov 7, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Nov 7, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Nov 15, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Nov 16, 2024
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Nov 17, 2024
, bitcoin#28622, bitcoin#28880, bitcoin#29185, bitcoin#29170, bitcoin#29233, bitcoin#29298, bitcoin#29598, bitcoin#29732, bitcoin#29890, bitcoin#29739, bitcoin#30074, bitcoin#30198, bitcoin#29072 (toolchain backports: part 2)

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 #6384
  * Dependency for #6389
  * The Qt patch introduced in [dash#5596](#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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 29, 2024
Summary:
```
We need LLVM 17.x so that lld has -fixup_chains.
```

Backport of [[bitcoin/bitcoin#28880 | core#28880]].

Depends on D17254.

Test Plan: Run the osx guix build.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17247
roqqit pushed a commit to doged-io/doged that referenced this pull request Dec 19, 2024
Summary:
```
We need LLVM 17.x so that lld has -fixup_chains.
```

Backport of [[bitcoin/bitcoin#28880 | core#28880]].

Depends on D17254.

Test Plan: Run the osx guix build.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17247
@bitcoin bitcoin locked and limited conversation to collaborators Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants