From patchwork Sat Jul 29 18:34:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andreas K. Huettel" X-Patchwork-Id: 73350 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0437E3858C39 for ; Sat, 29 Jul 2023 18:35:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0437E3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690655712; bh=vVKCqUCEQ9W5l3arKT3aRMtFwFL+EEHlhwh1ey9lNjE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=N8ZlJ6hp9/IctpTskfzqde48QJeDnihOLlV69L6eWmLlvYXea9VeK/ewzgFnhfXjl bb+YectLcmJ2bOYuJUFdyQZdbbpask2Ykd3JF+oGKdpWDsRQOWHUWds03GJ29jgb1M eUSKDQNpUgaIex01deaW5/EbrJr+mnXN7I59taEg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 422F93858C62 for ; Sat, 29 Jul 2023 18:34:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 422F93858C62 To: libc-alpha@sourceware.org, vapier@gentoo.org Subject: build failure on ia64 (+ patch), "relocation truncated to fit: GPREL22 against `.text'" Date: Sat, 29 Jul 2023 20:34:35 +0200 Message-ID: <4817905.GXAFRqVoOG@pinacolada> Organization: Gentoo Linux MIME-Version: 1.0 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Andreas K. Huettel via Libc-alpha" From: "Andreas K. Huettel" Reply-To: "Andreas K. Huettel" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 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 --- 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" \