public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
@ 2023-01-09 9:33 doko at gcc dot gnu.org
2023-01-09 10:08 ` [Bug target/108339] " marxin at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: doko at gcc dot gnu.org @ 2023-01-09 9:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
Bug ID: 108339
Summary: riscv64-linux-gnu: fails to link libgcc_s.so on the
GCC 10 branch
Product: gcc
Version: 10.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: doko at gcc dot gnu.org
Target Milestone: ---
the gcc-10 branch fails to build on riscv64-linux-gnu with the binutils-2.40
branch, trying to build a cross compiler, building libgcc_s.so:
/usr/riscv64-linux-gnu/bin/ld: relocation R_RISCV_JAL against `__udivdi3' which
may bind externally
can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:994: libgcc_s.so] Error 1
make[5]: Leaving directory
'/<<PKGBUILDDIR>>/gcc/build/riscv64-linux-gnu/libgcc'
all newer branches and the trunk successfully build with this binutils
versions, so assuming that some backport is needed for the gcc-10 branch to
work with recent binutils?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
@ 2023-01-09 10:08 ` marxin at gcc dot gnu.org
2023-01-09 16:49 ` [Bug target/108339] [10 only] " pinskia at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-09 10:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2023-01-09
CC| |kito at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
2023-01-09 10:08 ` [Bug target/108339] " marxin at gcc dot gnu.org
@ 2023-01-09 16:49 ` pinskia at gcc dot gnu.org
2023-01-09 16:51 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-09 16:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
2023-01-09 10:08 ` [Bug target/108339] " marxin at gcc dot gnu.org
2023-01-09 16:49 ` [Bug target/108339] [10 only] " pinskia at gcc dot gnu.org
@ 2023-01-09 16:51 ` pinskia at gcc dot gnu.org
2023-01-09 16:52 ` [Bug target/108339] [11/10 " pinskia at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-09 16:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
r12-5799-g45116f342057b7
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [11/10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
` (2 preceding siblings ...)
2023-01-09 16:51 ` pinskia at gcc dot gnu.org
@ 2023-01-09 16:52 ` pinskia at gcc dot gnu.org
2023-01-10 4:56 ` doko at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-09 16:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|11.3.1, 12.2.1 |12.1.0
Summary|[10 only] |[11/10 only]
|riscv64-linux-gnu: fails to |riscv64-linux-gnu: fails to
|link libgcc_s.so on the GCC |link libgcc_s.so on the GCC
|10 branch |10 branch
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Which was not backported to GCC 11 branch either.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [11/10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
` (3 preceding siblings ...)
2023-01-09 16:52 ` [Bug target/108339] [11/10 " pinskia at gcc dot gnu.org
@ 2023-01-10 4:56 ` doko at gcc dot gnu.org
2023-02-20 11:03 ` cvs-commit at gcc dot gnu.org
2023-02-20 11:05 ` kito at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: doko at gcc dot gnu.org @ 2023-01-10 4:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
--- Comment #3 from Matthias Klose <doko at gcc dot gnu.org> ---
thanks for the pointer. The GCC 11 branch already has the backport.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [11/10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
` (4 preceding siblings ...)
2023-01-10 4:56 ` doko at gcc dot gnu.org
@ 2023-02-20 11:03 ` cvs-commit at gcc dot gnu.org
2023-02-20 11:05 ` kito at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-20 11:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Kito Cheng <kito@gcc.gnu.org>:
https://gcc.gnu.org/g:951ca35bdbbde7bb348337d7db3919c4a0628e25
commit r10-11221-g951ca35bdbbde7bb348337d7db3919c4a0628e25
Author: Nelson Chu <nelson.chu@sifive.com>
Date: Mon Nov 29 04:48:20 2021 -0800
RISC-V: jal cannot refer to a default visibility symbol for shared object.
[PR 108339]
This is the original binutils bugzilla report,
https://sourceware.org/bugzilla/show_bug.cgi?id=28509
And this is the first version of the proposed binutils patch,
https://sourceware.org/pipermail/binutils/2021-November/118398.html
After applying the binutils patch, I get the the unexpected error when
building libgcc,
/scratch/nelsonc/riscv-gnu-toolchain/riscv-gcc/libgcc/config/riscv/div.S:42:
/scratch/nelsonc/build-upstream/rv64gc-linux/build-install/riscv64-unknown-linux-gnu/bin/ld:
relocation R_RISCV_JAL against `__udivdi3' which may bind externally can not be
used when making a shared object; recompile with -fPIC
Therefore, this patch add an extra hidden alias symbol for __udivdi3, and
then use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.
The solution is similar to glibc as follows,
https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b
libgcc/ChangeLog:
PR target/108339
* config/riscv/div.S: Add the hidden alias symbol for __udivdi3,
and
then use HIDDEN_JUMPTARGET to target it since it is
non-preemptible.
* config/riscv/riscv-asm.h: Added new macros HIDDEN_JUMPTARGET and
HIDDEN_DEF.
(cherry picked from commit 45116f342057b7facecd3d05c2091ce3a77eda59)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/108339] [11/10 only] riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
` (5 preceding siblings ...)
2023-02-20 11:03 ` cvs-commit at gcc dot gnu.org
@ 2023-02-20 11:05 ` kito at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: kito at gcc dot gnu.org @ 2023-02-20 11:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108339
Kito Cheng <kito at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Kito Cheng <kito at gcc dot gnu.org> ---
Backported to GCC 10 branch.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-02-20 11:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 9:33 [Bug target/108339] New: riscv64-linux-gnu: fails to link libgcc_s.so on the GCC 10 branch doko at gcc dot gnu.org
2023-01-09 10:08 ` [Bug target/108339] " marxin at gcc dot gnu.org
2023-01-09 16:49 ` [Bug target/108339] [10 only] " pinskia at gcc dot gnu.org
2023-01-09 16:51 ` pinskia at gcc dot gnu.org
2023-01-09 16:52 ` [Bug target/108339] [11/10 " pinskia at gcc dot gnu.org
2023-01-10 4:56 ` doko at gcc dot gnu.org
2023-02-20 11:03 ` cvs-commit at gcc dot gnu.org
2023-02-20 11:05 ` kito at gcc dot gnu.org
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).