public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* build failure on ia64 (+ patch), "relocation truncated to fit: GPREL22 against `.text'"
@ 2023-07-29 18:34 Andreas K. Huettel
  2023-07-30  0:08 ` Adhemerval Zanella Netto
  2023-07-30  8:10 ` Florian Weimer
  0 siblings, 2 replies; 9+ messages in thread
From: Andreas K. Huettel @ 2023-07-29 18:34 UTC (permalink / raw)
  To: libc-alpha, vapier

[-- Attachment #1: Type: text/plain, Size: 3251 bytes --]

When testing a manual build on ia64 we ran (on two different Gentoo machines) into
https://bugs.gentoo.org/723268
https://sourceware.org/pipermail/libc-alpha/2020-May/114028.html

gcc -o /home/dilfridge/glibc_build/support/test-run-command -nostdlib -nostartfiles -static      /home/dilfridge/glibc_build/csu/crt1.o /home/dilfridge/glibc_build/csu/crti.o `gcc  --print-file-name=crtbegin.o` /home/dilfridge/glibc_build/support/test-run-command.o /home/dilfridge/glibc_build/elf/static-stubs.o /home/dilfridge/glibc_build/support/libsupport_nonshared.a  -Wl,--start-group /home/dilfridge/glibc_build/libc.a -lgcc  -Wl,--end-group `gcc  --print-file-name=crtend.o` /home/dilfridge/glibc_build/csu/crtn.o
/usr/lib/gcc/ia64-unknown-linux-gnu/13/../../../../ia64-unknown-linux-gnu/bin/ld: warning: -z relro ignored
/home/dilfridge/glibc_build/libc.a(dl-support.o): in function `_dl_aux_init':
/home/dilfridge/glibc/elf/dl-support.c:239:(.text+0x51): relocation truncated to fit: GPREL22 against `.text'
/home/dilfridge/glibc_build/libc.a(dl-support.o): in function `setup_vdso':
/home/dilfridge/glibc/elf/setup-vdso.h:108:(.text+0xea2): relocation truncated to fit: GPREL22 against `.text'
collect2: error: ld returned 1 exit status
make[2]: *** [../Rules:290: /home/dilfridge/glibc_build/support/test-run-command] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/dilfridge/glibc/support'
make[1]: *** [Makefile:484: support/others] Error 2
make[1]: Leaving directory '/home/dilfridge/glibc'
make: *** [Makefile:9: all] Error 2

Turns out we have a fix for this in our Gentoo patchset since glibc-2.31, pasted below.

Since this fixes a clear build failure, is localized to sysdeps/unix/sysv/linux/ia64,
and there are no positive test results without it anywhere, I'd like to pull it in for 2.38.

Any objections?

From ed428afb4c6353692fba6cedaa2f9db7bc9fb551 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
Subject: [PATCH 4/9] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Bug: https://bugs.gentoo.org/723268
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
 sysdeps/unix/sysv/linux/ia64/dl-sysdep.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
index 3e4d5da820..eb7681b704 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
 #ifndef __ASSEMBLER__
 /* Don't declare this as a function---we want it's entry-point, not
    it's function descriptor... */
-extern int _dl_sysinfo_break attribute_hidden;
+/* Use section ".text" to force far GPREL64 relocation instead of
+   GPREL22 . */
+extern int _dl_sysinfo_break attribute_hidden __attribute__((section(".text")));
 # define DL_SYSINFO_DEFAULT ((uintptr_t) &_dl_sysinfo_break)
 # define DL_SYSINFO_IMPLEMENTATION		\
   asm (".text\n\t"				\
-- 
2.39.3


-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-30 19:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-29 18:34 build failure on ia64 (+ patch), "relocation truncated to fit: GPREL22 against `.text'" Andreas K. Huettel
2023-07-30  0:08 ` Adhemerval Zanella Netto
2023-07-30  0:15   ` Andreas K. Huettel
2023-07-30  8:10 ` Florian Weimer
2023-07-30 13:14   ` Adhemerval Zanella Netto
2023-07-30 13:27     ` Sam James
2023-07-30 14:03     ` Richard Henderson
2023-07-30 16:41       ` Alexander Monakov
2023-07-30 19:06         ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).