add loongarch64 support

This commit is contained in:
Alexander Stefanov 2024-08-22 09:47:27 +00:00
parent ab05366d7b
commit 0704783219
2 changed files with 22 additions and 6 deletions

View file

@ -1,3 +1,3 @@
sources:
glibc-e9f05fa1c62c8044ff025963498063f73eb51c5f.tar.xz: 2e0d0760225685b8882184daf609774a3fe08354
glibc-c005d1bd6f0e88ab4b822844d75d10c8978f5404.tar.xz: 9f40a5d9523a0b63efc77ec77b658264a10dc067
glibc-manpages.tar.bz2: ca54bfb832b703c8e35170fcc1c1f5470b45ff0f

View file

@ -3,7 +3,7 @@
# Package from the last commit from there
# Only important patches are ported into it
# (instead of applying many commits as patches)
%define commit e9f05fa1c62c8044ff025963498063f73eb51c5f
%define commit c005d1bd6f0e88ab4b822844d75d10c8978f5404
%define commit_short %(echo %{commit} | head -c6)
%bcond_with crosscompilers
@ -150,7 +150,7 @@ Version: 2.38
#Source0: http://ftp.gnu.org/gnu/glibc/%%{oname}-%%{version}.tar.xz
# use ./upd.sh to make a tarball and automatically update Release
Source0: glibc-%{commit}.tar.xz
Release: 3.git%{commit_short}.1
Release: 4.git%{commit_short}.1
License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Group: System/Libraries
Url: http://www.gnu.org/software/libc/
@ -424,6 +424,9 @@ if st.type ~= "link" then
%endif
%ifarch riscv64
posix.symlink("%{_libdir}/ld-linux-riscv64-lp64d.so.1", "/%{_lib}/ld-linux-riscv64-lp64d.so.1")
%endif
%ifarch loongarch64
posix.symlink("%{_libdir}/ld-linux-loongarch-lp64d.so.1", "/%{_lib}/ld-linux-loongarch-lp64d.so.1")
%endif
posix.symlink("/usr/sbin/ldconfig", "%{_bindir}/ldconfig")
end
@ -506,6 +509,9 @@ if st.type ~= "link" then
%endif
%ifarch riscv64
posix.symlink("%{_libdir}/ld-linux-riscv64-lp64d.so.1", "/%{_lib}/ld-linux-riscv64-lp64d.so.1")
%endif
%ifarch loongarch64
posix.symlink("%{_libdir}/ld-linux-loongarch-lp64d.so.1", "/%{_lib}/ld-linux-loongarch-lp64d.so.1")
%endif
posix.symlink("%{_bindir}/ldconfig", "/usr/sbin/ldconfig")
end
@ -785,6 +791,11 @@ LANG variable to their preferred language in their
/lib/ld-linux-riscv64-lp64d.so.1
%{_libdir}/lp64d
%endif
%if %isarch loongarch64
%{_libdir}/ld-linux-loongarch-lp64d.so.1
/lib/ld-linux-loongarch-lp64d.so.1
%{_libdir}/lp64d
%endif
%{_libdir}/lib*.so.[0-9]*
%if "%{name}" == "glibc"
%dir %{_libdir}/audit
@ -1194,8 +1205,8 @@ find . -type f -size 0 -o -name "*.orig" -exec rm {} \;
#rm localedata/locales/[a-z_]*.*
# Regenerate autoconf files, some of our patches touch them
# Remove the autoconf 2.69 hardcode...
sed -e "s,2.69,$(autoconf --version |head -n1 |cut -d' ' -f4)," -i aclocal.m4
# Remove the autoconf 2.71 hardcode...
sed -e "s,2.71,$(autoconf --version |head -n1 |cut -d' ' -f4)," -i aclocal.m4
# fix nss headers location
sed -e 's@<hasht.h>@<nss/hasht.h>@g' -e 's@<nsslowhash.h>@<nss/nsslowhash.h>@g' -i configure*
@ -1924,7 +1935,7 @@ rm -f %{buildroot}%{_prefix}/lib/libcrypt.so
# Compat symlink -- some versions of ld hardcoded /lib/ld-linux-aarch64.so.1
# as dynamic loader (probably die to ABI spec saying this)
mkdir -p %{buildroot}/lib
ln -s /lib64/ld-linux-aarch64.so.1 %{buildroot}/lib/ld-linux-aarch64.so.1
ln -s %{_libdir}/ld-linux-aarch64.so.1 %{buildroot}/lib/ld-linux-aarch64.so.1
%endif
%ifarch riscv64
@ -1939,6 +1950,11 @@ mkdir -p %{buildroot}/lib
ln -s %{_libdir}/ld-linux-riscv64-lp64d.so.1 %{buildroot}/lib/ld-linux-riscv64-lp64d.so.1
%endif
%ifarch loongarch64
mkdir -p %{buildroot}/lib
ln -s %{_libdir}/ld-linux-riscv64-lp64d.so.1 %{buildroot}/lib/ld-linux-riscv64-lp64d.so.1
%endif
%ifarch %{x86_64}
# Needed for bootstrapping x32 compilers
[ -e %{buildroot}%{_includedir}/gnu/stubs-x32.h ] || cp %{buildroot}%{_includedir}/gnu/stubs-64.h %{buildroot}%{_includedir}/gnu/stubs-x32.h