Compare commits

...

10 Commits

Author SHA1 Message Date
David Abdurachmanov 05ff0d39a9
Apply a patch to disable linking non-PIC into shared objects
Patch sent upstream:
https://lists.gnu.org/archive/html/libtool-patches/2024-02/msg00002.html

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-02-02 11:29:22 +02:00
David Abdurachmanov d20131ea50
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-02-02 11:20:10 +02:00
Fedora Release Engineering 770440b273 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 05:32:06 +00:00
Jakub Jelinek c9b17ee035 2.4.7-9 2024-01-15 12:29:57 +01:00
Frédéric Bérat 93ce89c4c4 Migrate to SPDX license
The LicenseRef-Fedora-Public-Domain entry as been reported through:
https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/314

License scanning done on the binary RPM itself, cross-checked with
source RPM for non-text based files.
2023-09-07 15:38:24 +02:00
Fedora Release Engineering 71f74ae17c Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 12:19:01 +00:00
Fedora Release Engineering 72a6738eee Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 17:37:46 +00:00
Jakub Jelinek 02d40d4556 2.4.7-5 2023-01-16 13:08:49 +01:00
Florian Weimer 07f4318bf8 C99 compatibility fix in the testsuite
Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2023-01-10 11:13:44 +01:00
Frédéric Bérat e5a7e0081e tests: fix grep warning leading to test failure
Recent grep version emits a warning when \ is found before /.
This leads to a test failure in libtool.

Patch sent upstream:
https://lists.gnu.org/archive/html/libtool-patches/2022-12/msg00004.html

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-12-21 16:53:24 +01:00
4 changed files with 258 additions and 8 deletions

View File

@ -0,0 +1,35 @@
From 414deacee0f564afdf2d7750450274c581330a59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= <fberat@redhat.com>
Date: Wed, 21 Dec 2022 13:14:03 +0100
Subject: [PATCH] tests: Fix grep warning about stray \ before /
Recent version of grep emit a warning if stray \ is found before /.
This leads to the link-order test failure.
* tests/link-order.at: Remove unneeded \ before /
---
tests/link-order.at | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/link-order.at b/tests/link-order.at
index 3f01a00d..a145347f 100644
--- a/tests/link-order.at
+++ b/tests/link-order.at
@@ -99,12 +99,12 @@ aix* | interix*) ;; # These systems have different path syntax
case $hardcode_direct$hardcode_direct_absolute in
yesno)
AT_CHECK([if $EGREP relinking stderr; then
- $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout
+ $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout
else :; fi], [0], [ignore], [], [echo "wrong link order"])
;;
*)
AT_CHECK([if $EGREP relinking stderr; then
- $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout
+ $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout
else :; fi], [0], [ignore], [], [echo "wrong link order"])
;;
esac
--
2.38.1

20
libtool-c99.patch Normal file
View File

@ -0,0 +1,20 @@
Include <string.h> for the strcmp function. This improves C99
compiler compatibility because it avoids an implicit function
declaration.
Submitted upstream:
<https://lists.gnu.org/archive/html/libtool-patches/2023-01/msg00000.html>
diff --git a/tests/lt_dlopen_a.at b/tests/lt_dlopen_a.at
index 95f18a0df165d41d..d3948738e4199cc6 100644
--- a/tests/lt_dlopen_a.at
+++ b/tests/lt_dlopen_a.at
@@ -27,6 +27,7 @@ AT_KEYWORDS([libltdl lt_dlopen_a])
AT_DATA([main.c],
[[#include <ltdl.h>
#include <stdio.h>
+#include <string.h>
/* This dlopen() in the main executable should override any dlopen()s in
shared libraries etc.

View File

@ -1,7 +1,3 @@
%ifarch riscv64
%global debug_package %{nil}
%endif
# See the bug #429880
%global gcc_major %(gcc -dumpversion || echo "666")
# See rhbz#1193591
@ -12,8 +8,41 @@
Summary: The GNU Portable Library Tool
Name: libtool
Version: 2.4.7
Release: 2.0.riscv64%{?dist}
License: GPLv2+ and LGPLv2+ and GFDL
Release: 10.0.riscv64%{?dist}
# To help future rebase, the following licenses were seen in the following files/folders:
# '*' is anything that was not explicitly listed earlier in the folder
#
# From libtool package:
# usr/bin/:
# libtool - GPL-2.0-or-later WITH Libtool-exception AND MIT
# libtoolize - GPL-2.0-or-later AND MIT
# usr/share/:
# aclocal/* - FSFULLR
# doc/libtool:
# AUTHORS - GPL-2.0-or-later
# * - FSFAP
# info/* - GFDL-1.3-or-later
# libtool/build-aux/:
# {compile,depcomp,missing} - GPL-2.0-or-later WITH Autoconf-exception-generic
# config.{guess,sub} - GPL-3.0-or-later WITH Autoconf-exception-generic-3.0
# install-sh - X11 AND LicenseRef-Fedora-public-domain
# ltmain.sh - GPL-2.0-or-later WITH Libtool-exception AND MIT
# usr/share/man/man1/*: generated from usr/bin/libtool{,ize} using help2man
#
# From libtool-ltdl package:
# usr/lib64/
# * - LGPL-2.0-or-later WITH Libtool-exception
#
# From libtool-ltdl-devel package:
# usr/include/* - LGPL-2.0-or-later WITH Libtool-exception
# usr/share/:
# README - FSFAP
# {*.c,*.h,Makefile.am,configure.ac,ltdl.mk} - LGPL-2.0-or-later WITH Libtool-exception
# Makefile.in - FSFULLRWD
# aclocal.m4 - FSFULLR AND FSFULLRWD
# configure - FSFUL
License: GPL-2.0-or-later AND GPL-2.0-or-later WITH Autoconf-exception-generic AND GPL-2.0-or-later WITH Libtool-exception AND LGPL-2.0-or-later WITH Libtool-exception AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND MIT AND FSFAP AND FSFULLR AND FSFULLRWD AND GFDL-1.3-or-later AND X11 AND LicenseRef-Fedora-public-domain
URL: http://www.gnu.org/software/libtool/
Source: http://ftp.gnu.org/gnu/libtool/libtool-%{version}.tar.xz
@ -43,10 +72,20 @@ Patch3: libtool-2.4.6-disable_non-pic_arm.patch
# https://lists.gnu.org/archive/html/libtool-patches/2022-02/msg00000.html
Patch4: libtool-2.4.6-keep-compiler-deps.patch
# Patch sent upstream
# https://lists.gnu.org/archive/html/libtool-patches/2022-12/msg00004.html
Patch5: 0001-tests-Fix-grep-warning-about-stray-before.patch
# Patch sent upstream
# https://lists.gnu.org/archive/html/libtool-patches/2024-02/msg00002.html
Patch6: riscv-non-PIC-into-shared-objects.patch
%if ! 0%{?_module_build}
Patch100: libtool-nodocs.patch
%endif
Patch101: libtool-c99.patch
# /usr/bin/libtool includes paths within gcc's versioned directories
# Libtool must be rebuilt whenever a new upstream gcc is built
# Starting with gcc 7 gcc in Fedora is packaged so that only major
@ -169,8 +208,32 @@ rm -f %{buildroot}%{_libdir}/libltdl.{a,la}
%changelog
* Fri Aug 05 2022 David Abdurachmanov <davidlt@rivosinc.com> - 2.4.7-2.0.riscv64
- Disable debug packages on riscv64
* Fri Feb 02 2024 David Abdurachmanov <davidlt@rivosinc.com> - 2.4.7-10.0.riscv64
- RISC-V doesn't allow linking non-PIC into shared objects
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.7-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 15 2024 Jakub Jelinek <jakub@redhat.com> - 2.4.7-9
- bump: for gcc 14.* in rawhide
* Tue Aug 08 2023 Frederic Berat <fberat@redhat.com> - 2.4.7-8
- Migrate to SPDX licenses (#2222091).
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Jan 16 2023 Jakub Jelinek <jakub@redhat.com> - 2.4.7-5
- bump: for gcc 13.* in rawhide
* Tue Jan 10 2023 Florian Weimer <fweimer@redhat.com> - 2.4.7-4
- C99 compatibility fix in the testsuite
* Wed Dec 21 2022 Frederic Berat <fberat@redhat.com> - 2.4.7-3
- Fix test failure due to grep update
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View File

@ -0,0 +1,132 @@
From MAILER-DAEMON Thu Feb 01 16:04:14 2024
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
id 1rVeEH-0006Vu-Gh
for mharc-libtool-patches@gnu.org; Thu, 01 Feb 2024 16:04:13 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <palmer@rivosinc.com>)
id 1rVdmJ-0007wb-Op
for libtool-patches@gnu.org; Thu, 01 Feb 2024 15:35:20 -0500
Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from <palmer@rivosinc.com>)
id 1rVdmB-0003MQ-4E
for libtool-patches@gnu.org; Thu, 01 Feb 2024 15:35:19 -0500
Received: by mail-pl1-x634.google.com with SMTP id
d9443c01a7336-1d94b222a3aso10591565ad.2
for <libtool-patches@gnu.org>; Thu, 01 Feb 2024 12:35:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706819707; x=1707424507;
darn=gnu.org;
h=to:from:cc:content-transfer-encoding:mime-version:message-id:date
:subject:from:to:cc:subject:date:message-id:reply-to;
bh=rx/fQhuTVCQDQ0qweI0mMDiWtQVxyrst0rLwP6hMZYw=;
b=JMjleLVUcsiqX4cH1hiIn1dv/H2L5AUg55yPUju40RNWsH5UIJyQ12kuTDXrG3UT2O
aQ9+nJbLRUe6KKT3wNqDko0xxdL9Io/ifqyUgDO1kvuYn5rjs6PqbTwVraCd25CTp8jA
GJckDmDAnDs+pmUVCC2wuJa3kWnphunswBHZ1Xa+oLuRAl2bn3l9qw4P6QN3GRatPZp5
fUjKIP/JdOvHRxgc5qfSqfDNFxpSQI88+/mZrS6MlzVJeqB5EbFH9NMbvgDV90vUDezC
nK1mQZeoFKxonXWWFsqYtTRg2xX3OGlqAYYfzGnw2aHcPPL/TKAtAIgWiJ6m1lJXdVlp
BUmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1706819707; x=1707424507;
h=to:from:cc:content-transfer-encoding:mime-version:message-id:date
:subject:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=rx/fQhuTVCQDQ0qweI0mMDiWtQVxyrst0rLwP6hMZYw=;
b=eht7eeLjBZxZ4MhiqumZXqGoGpn9bRUoXS4GknQ+5DubkPLqcL5fjSFNYeUTVdJ0F6
pU1DaVsRQbfJ3kM6fvP7XyNSYX3QM1b3Dv9ysGpWpmItwq2D5ZKEMOUNz1Xj82zthxKp
Cl6fqKpfTH83WkR+pERRM8xTHjT8mmar3yQb2HtdWNZMkn5KlA2V/ed4sF2LUoNhoErT
K2kFCxP6O5buN8gkYDuOMu+p0SOwK+AyIN9mESR8mwCyuM0FyfaH+9Z/jo5G7hMruRm9
NWtpKNTSIi0pe4SBUiL8eCLPgPMICjmPZD2iZI1bkkCwLrQldjjF0Dn9yGn5orL6HMVF
aeEw==
X-Gm-Message-State: AOJu0YwbdC57wFaP3YZR/+NDcpIdmtjHzvBwoGgfbhl+jupDEjcdl6/Z
roOfVdBLkLN8hWsCmTJOQOqDP7YV2EPKeHLk4ZaHRppz1FhFDVO1UlPToH3+Mk1cnDy2Q5NZtpa
8
X-Google-Smtp-Source: AGHT+IFef/XNpazSDQ1JLc4miPn2A2VXHAyrArK0DKSlblS2jsbrAywrdsZ3oxL8MVl7c7QiYlKrWA==
X-Received: by 2002:a17:903:2806:b0:1d9:5b78:57fb with SMTP id
kp6-20020a170903280600b001d95b7857fbmr136400plb.61.1706819707504;
Thu, 01 Feb 2024 12:35:07 -0800 (PST)
X-Forwarded-Encrypted: i=0;
AJvYcCXBMvWGqPr1J/8Uo5Ka+DDIlpsMEHA0MQgx8hxP/zCqsbdmvcuqU/vfYKIsKRxKFJvP5D+Ylr4c8OKJ7iNbSSly+0K2
Received: from localhost ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id
o11-20020a170903008b00b001d8f112e910sm245323pld.69.2024.02.01.12.35.06
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 01 Feb 2024 12:35:07 -0800 (PST)
Subject: [PATCH] RISC-V doesn't allow linking non-PIC into shared objects
Date: Thu, 1 Feb 2024 12:34:14 -0800
Message-ID: <20240201203413.2664-2-palmer@rivosinc.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Cc: David Abdurachmanov <davidlt@rivosinc.com>,
Palmer Dabbelt <palmer@rivosinc.com>
From: Palmer Dabbelt <palmer@rivosinc.com>
To: libtool-patches@gnu.org
Received-SPF: pass client-ip=2607:f8b0:4864:20::634;
envelope-from=palmer@rivosinc.com; helo=mail-pl1-x634.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Mailman-Approved-At: Thu, 01 Feb 2024 16:04:11 -0500
X-BeenThere: libtool-patches@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Patch submission list for the GNU libtool shared library maintenance
tool <libtool-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtool-patches>,
<mailto:libtool-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/libtool-patches>
List-Post: <mailto:libtool-patches@gnu.org>
List-Help: <mailto:libtool-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtool-patches>,
<mailto:libtool-patches-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 01 Feb 2024 20:35:20 -0000
I'm not sure exactly why, but it looks like this has started failing on
the latest Fedora rebuilds (with a bump to GCC-14 prereleases) with
errors along the lines of
/usr/bin/ld: .libs/libhello_la-hello.o: relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/libhello_la-foo.o: relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: unresolvable R_RISCV_CALL_PLT relocation against symbol `puts@@GLIBC_2.27'
/usr/bin/ld: unresolvable R_RISCV_CALL_PLT relocation against symbol `__printf_chk@@GLIBC_2.27'
As far as I can tell this always should have failed on RISC-V, as
non-PIC objects have never worked correctly in shared libraries. We
have added some stricter linker error checking over the last few months
so it's possible this is a newly reported error, but I'd guess that the
resulting binaries have always been invalid.
Regardless of exactly why it's getting noticed now, R_RISCV_HI20 is very
much an absolute relocation (it maps to LUI, which just loads up a
constant address) and thus won't work for shared libraries. Given that
other ports skip this test that seems like the way to go for RISC-V
as well.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
tests/demo.at | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/demo.at b/tests/demo.at
index feb71dcd..b62a9215 100644
--- a/tests/demo.at
+++ b/tests/demo.at
@@ -511,7 +511,7 @@ AT_CLEANUP
AT_SETUP([force non-PIC objects])
AT_CHECK([case $host in
-hppa*|amd64*|x86_64*|s390*)
+hppa*|amd64*|x86_64*|s390*|riscv*)
# These hosts cannot use non-PIC shared libs
exit 77 ;;
*-solaris*|*-sunos*)
--
2.43.0