Skip to content

Commit c4361e5

Browse files
committed
Merge bitcoin/bitcoin#34757: guix: re-enable riscv exported symbol checking
19e99be guix: remove riscv exclusion from symbol check (fanquake) 47b7a9f guix: binutils 2.46.0 (fanquake) Pull request description: Switching to binutils `2.46.0` fixes the spurious exported symbols (2.45.1 was still broken). The relevant upstream change is https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9e10fcf71c1101fb6422d0f52de5e615ed8df71d. Fixes #28095. ACKs for top commit: hebasto: re-ACK 19e99be, only rebased and properly adjusted since my recent [review](bitcoin/bitcoin#34757 (review)). Tree-SHA512: 5673e8df8e2297e41c3f50fbe87ee506684a7dd7e8be27fc5613853ace9732d92616c10870614f6b196ca71a581470eb6f432cfd102e1fce58bbaf18c599342e
2 parents 44ac0c3 + 19e99be commit c4361e5

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

contrib/guix/manifest.scm

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
(guix build-system python)
2424
(guix build-system pyproject)
2525
(guix build-system trivial)
26+
(guix download)
2627
(guix gexp)
2728
(guix git-download)
2829
((guix licenses) #:prefix license:)
@@ -38,13 +39,36 @@ FILE-NAME found in ./patches relative to the current file."
3839

3940
(define building-on (string-append "--build=" (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
4041

42+
(define (base-binutils target)
43+
(package
44+
(inherit (cross-binutils target)) ;; 2.44
45+
(version "2.46.0")
46+
(source (origin
47+
(method url-fetch)
48+
(uri (string-append "mirror://gnu/binutils/binutils-"
49+
version ".tar.bz2"))
50+
(sha256
51+
(base32
52+
"04nd9vl7c1pxjbc9wh3ckddzhz5g82xyjqq9y9kf171a59im4c8g"))))
53+
(arguments
54+
(substitute-keyword-arguments (package-arguments (cross-binutils target))
55+
((#:configure-flags flags)
56+
#~(append #$flags
57+
(list "--enable-gprofng=no")))))
58+
(native-inputs
59+
(modify-inputs
60+
(package-native-inputs (cross-binutils target))
61+
(delete "bison")))
62+
)
63+
)
64+
4165
(define (make-cross-toolchain target
4266
base-gcc-for-libc
4367
base-kernel-headers
4468
base-libc
4569
base-gcc)
4670
"Create a cross-compilation toolchain package for TARGET"
47-
(let* ((xbinutils (cross-binutils target))
71+
(let* ((xbinutils (base-binutils target))
4872
;; 1. Build a cross-compiling gcc without targeting any libc, derived
4973
;; from BASE-GCC-FOR-LIBC
5074
(xgcc-sans-libc (cross-gcc target
@@ -119,7 +143,7 @@ desirable for building Bitcoin Core release binaries."
119143

120144
(define (make-mingw-pthreads-cross-toolchain target)
121145
"Create a cross-compilation toolchain package for TARGET"
122-
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
146+
(let* ((xbinutils (binutils-mingw-patches (base-binutils target)))
123147
(machine (substring target 0 (string-index target #\-)))
124148
(pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
125149
#:xgcc (cross-gcc target #:xgcc base-gcc)

contrib/guix/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def check_exported_symbols(binary) -> bool:
202202
if not symbol.exported:
203203
continue
204204
name = symbol.name
205-
if binary.header.machine_type == lief.ELF.ARCH.RISCV or name in IGNORE_EXPORTS:
205+
if name in IGNORE_EXPORTS:
206206
continue
207207
print(f'{filename}: export of symbol {name} not allowed!')
208208
ok = False

0 commit comments

Comments
 (0)