I just want to send you first the two patches that I'm working with to build glibc on riscv64. I didn't of course push either of them yet. I should also say that I've only built glibc, not fully tested it yet. Results from testing later.
Since I wrote this on the first submission, the patches have now received extensive testing, used to build thousands of Fedora/RISC-V packages.
The first one as discussed adds the symlink from /usr/lib64/lp64d to /usr/lib64. It's both simple because it doesn't involve any downstream patching of glibc itself, but it's also a little bit ugly.
The second one is a pretty uncontroversial change to disable valgrind. We've discussed valgrind on RISC-V with upstream but as it's a lot of work to port valgrind to new architectures they understandably don't want to do anything until it's clear how popular or otherwise the architecture will be. So we don't expect valgrind any time soon.
I'd like to push the second one which seems uncontroversial.
The first one works for me ...
Rich.
--- glibc.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/glibc.spec b/glibc.spec index f00686a..ea5393f 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.27 %define glibcversion 2.27 -%define glibcrelease 1%{?dist} +%define glibcrelease 2%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -1009,6 +1009,16 @@ chmod 644 sysdeps/gnu/errlist.c # Reload compiler and build options that were used during %%build. GCC=`cat Gcc`
+%ifarch riscv64 +# RISC-V ABI wants to install everything in /lib64/lp64d or /usr/lib64/lp64d. +# Make these be symlinks to /lib64 or /usr/lib64 respectively. See: +# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/... +for d in $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT/%{_lib}; do + mkdir -p $d + (cd $d && ln -s . lp64d) +done +%endif + # Build and install. make -j1 install_root=$RPM_BUILD_ROOT install -C build-%{target}
@@ -2001,6 +2011,9 @@ fi %endif
%changelog +* Sat Feb 10 2018 Richard W.M. Jones rjones@redhat.com - 2.27-2 +- riscv64: Add symlink from /usr/lib64/lp64d -> /usr/lib64 for ABI compat. + * Mon Feb 05 2018 Carlos O'Donell carlos@redhat.com - 2.27-1 - Update to released glibc 2.27. - Auto-sync with upstream branch master,
"Richard W.M. Jones" rjones@redhat.com writes:
+for d in $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT/%{_lib}; do
- mkdir -p $d
- (cd $d && ln -s . lp64d)
If _libdir and _lib are the same, the second ln will fail.
On Mon, Feb 19, 2018 at 01:56:26PM -0500, DJ Delorie wrote:
"Richard W.M. Jones" rjones@redhat.com writes:
+for d in $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT/%{_lib}; do
- mkdir -p $d
- (cd $d && ln -s . lp64d)
If _libdir and _lib are the same, the second ln will fail.
True .. although on riscv64 they won't be. I guess I could change ln -s -> ln -sf?
Rich.
"Richard W.M. Jones" rjones@redhat.com writes:
True .. although on riscv64 they won't be. I guess I could change ln -s -> ln -sf?
That would work.
Patch LGTM then :-)
--- glibc.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/glibc.spec b/glibc.spec index ea5393f..63b7d27 100644 --- a/glibc.spec +++ b/glibc.spec @@ -38,8 +38,8 @@ # Run a valgrind smoke test to ensure that the release is compatible and # doesn't any new feature that might cause valgrind to abort. %if %{with valgrind} -%ifarch s390 ppc64 ppc64p7 %{mips} -# There is no valgrind support for 31-bit s390, nor for MIPS. +%ifarch s390 ppc64 ppc64p7 %{mips} riscv64 +# There is no valgrind support for 31-bit s390, nor for MIPS, nor RISC-V. # The valgrind test does not work on ppc64, ppc64p7 (bug 1273103). %undefine with_valgrind %endif @@ -2013,6 +2013,7 @@ fi %changelog * Sat Feb 10 2018 Richard W.M. Jones rjones@redhat.com - 2.27-2 - riscv64: Add symlink from /usr/lib64/lp64d -> /usr/lib64 for ABI compat. +- riscv64: Disable valgrind smoke test on this architecture.
* Mon Feb 05 2018 Carlos O'Donell carlos@redhat.com - 2.27-1 - Update to released glibc 2.27.
"Richard W.M. Jones" rjones@redhat.com writes:
+- riscv64: Disable valgrind smoke test on this architecture.
LGTM