Skip to content

Commit a0dc2eb

Browse files
committed
guix: replace GCC unaligned VMOV patch with binutils patch
Rather than invasively patching GCC. Given we have binutils 2.38 available, we can patch it to flip the default for `-muse-unaligned-vector-move`.
1 parent 3f6a6da commit a0dc2eb

File tree

3 files changed

+28
-291
lines changed

3 files changed

+28
-291
lines changed

contrib/guix/manifest.scm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ desirable for building Bitcoin Core release binaries."
110110

111111
(define (gcc-mingw-patches gcc)
112112
(package-with-extra-patches gcc
113-
(search-our-patches "gcc-remap-guix-store.patch"
114-
"vmov-alignment.patch")))
113+
(search-our-patches "gcc-remap-guix-store.patch")))
114+
115+
(define (binutils-mingw-patches binutils)
116+
(package-with-extra-patches binutils
117+
(search-our-patches "binutils-unaligned-default.patch")))
115118

116119
(define (make-mingw-pthreads-cross-toolchain target)
117120
"Create a cross-compilation toolchain package for TARGET"
118-
(let* ((xbinutils (cross-binutils target))
121+
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
119122
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
120123
(pthreads-xgcc (cross-gcc target
121124
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
commit 6537181f59ed186a341db621812a6bc35e22eaf6
2+
Author: fanquake <fanquake@gmail.com>
3+
Date: Wed Apr 10 12:15:52 2024 +0200
4+
5+
build: turn on -muse-unaligned-vector-move by default
6+
7+
This allows us to avoid (more invasively) patching GCC, to avoid
8+
unaligned instruction use.
9+
10+
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
11+
index e0632681477..14a9653abdf 100644
12+
--- a/gas/config/tc-i386.c
13+
+++ b/gas/config/tc-i386.c
14+
@@ -801,7 +801,7 @@ static unsigned int no_cond_jump_promotion = 0;
15+
static unsigned int sse2avx;
16+
17+
/* Encode aligned vector move as unaligned vector move. */
18+
-static unsigned int use_unaligned_vector_move;
19+
+static unsigned int use_unaligned_vector_move = 1;
20+
21+
/* Encode scalar AVX instructions with specific vector length. */
22+
static enum

contrib/guix/patches/vmov-alignment.patch

Lines changed: 0 additions & 288 deletions
This file was deleted.

0 commit comments

Comments
 (0)