Skip to content

Commit

Permalink
guix: use gcc 13.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tobtoht committed Feb 22, 2025
1 parent 078bcc2 commit 1e806ac
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 299 deletions.
3 changes: 3 additions & 0 deletions contrib/depends/packages/native_qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ $(package)_config_opts += -no-zstd
ifneq ($(LTO),)
$(package)_config_opts += -ltcg
endif

$(package)_config_env := CC="$$($(package)_cc)"
$(package)_config_env += CXX="$$($(package)_cxx)"
endef

define $(package)_fetch_cmds
Expand Down
4 changes: 3 additions & 1 deletion contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ make -C contrib/depends --jobs="$JOBS" HOST="$HOST" \
x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
x86_64_linux_STRIP=x86_64-linux-gnu-strip \
guix_ldflags="$HOST_LDFLAGS"
guix_ldflags="$HOST_LDFLAGS" \
build_CC="${NATIVE_GCC}/bin/gcc -isystem ${NATIVE_GCC}/include" \
build_CXX="${NATIVE_GCC}/bin/g++ -isystem ${NATIVE_GCC}/include/c++ -isystem ${NATIVE_GCC}/include"

# Log the depends package hashes
DEPENDS_PACKAGES="$(make -C contrib/depends --no-print-directory HOST="$HOST" print-all_packages)"
Expand Down
19 changes: 9 additions & 10 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ chain for " target " development."))
(home-page (package-home-page xgcc))
(license (package-license xgcc)))))

(define base-gcc gcc-12)
(define base-gcc gcc-13)
(define base-linux-kernel-headers linux-libre-headers-6.1)

(define* (make-bitcoin-cross-toolchain target
Expand All @@ -121,16 +121,19 @@ desirable for building Feather Wallet release binaries."

(define (gcc-mingw-patches gcc)
(package-with-extra-patches gcc
(search-our-patches "gcc-remap-guix-store.patch"
"vmov-alignment.patch")))
(search-our-patches "gcc-remap-guix-store.patch")))

(define (binutils-mingw-patches binutils)
(package-with-extra-patches binutils
(search-our-patches "binutils-unaligned-default.patch")))

(define (winpthreads-patches mingw-w64-x86_64-winpthreads)
(package-with-extra-patches mingw-w64-x86_64-winpthreads
(search-our-patches "winpthreads-remap-guix-store.patch")))

(define (make-mingw-pthreads-cross-toolchain target)
"Create a cross-compilation toolchain package for TARGET"
(let* ((xbinutils (cross-binutils target))
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
(machine (substring target 0 (string-index target #\-)))
(pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
#:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc))
Expand Down Expand Up @@ -475,6 +478,8 @@ inspecting signatures in Mach-O binaries.")
zip
unzip
;; Build tools
gcc-toolchain-13
(list gcc-toolchain-13 "static")
gnu-make
libtool
autoconf-2.71
Expand Down Expand Up @@ -505,21 +510,15 @@ inspecting signatures in Mach-O binaries.")
(cond ((string-contains target "-mingw32")
;; Windows
(list
gcc-toolchain-12
(list gcc-toolchain-12 "static")
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
nsis-x86_64
nss-certs
osslsigncode))
((string-contains target "-linux-")
(list
gcc-toolchain-12
(list gcc-toolchain-12 "static")
(make-bitcoin-cross-toolchain target)))
((string-contains target "darwin")
(list
gcc-toolchain-11
(list gcc-toolchain-11 "static")
clang-toolchain-18
lld-18
(make-lld-wrapper lld-18 #:lld-as-ld? #t)
Expand Down
22 changes: 22 additions & 0 deletions contrib/guix/patches/binutils-unaligned-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
commit 6537181f59ed186a341db621812a6bc35e22eaf6
Author: fanquake <fanquake@gmail.com>
Date: Wed Apr 10 12:15:52 2024 +0200

build: turn on -muse-unaligned-vector-move by default

This allows us to avoid (more invasively) patching GCC, to avoid
unaligned instruction use.

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e0632681477..14a9653abdf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -801,7 +801,7 @@ static unsigned int no_cond_jump_promotion = 0;
static unsigned int sse2avx;

/* Encode aligned vector move as unaligned vector move. */
-static unsigned int use_unaligned_vector_move;
+static unsigned int use_unaligned_vector_move = 1;

/* Encode scalar AVX instructions with specific vector length. */
static enum
288 changes: 0 additions & 288 deletions contrib/guix/patches/vmov-alignment.patch

This file was deleted.

0 comments on commit 1e806ac

Please sign in to comment.