forked from felixonmars/archriscv-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b95fa6f
commit 3554126
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- PKGBUILD | ||
+++ PKGBUILD | ||
@@ -21,7 +21,6 @@ url='https://gcc.gnu.org' | ||
makedepends=( | ||
binutils | ||
doxygen | ||
- gcc-ada | ||
gcc-d | ||
git | ||
libisl | ||
@@ -41,6 +40,7 @@ _libdir=usr/lib/gcc/$CHOST/${pkgver%%+*} | ||
source=(git+https://sourceware.org/git/gcc.git#commit=${_commit} | ||
c89 c99 | ||
fix-asan-allocator-aslr.patch | ||
+ unfilter-default-library-path.patch | ||
) | ||
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # [email protected] | ||
86CFFCA918CF3AF47147588051E8B148A9999C34 # [email protected] | ||
@@ -49,7 +49,8 @@ validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux. | ||
sha256sums=('9ee55a2c27bf0110ffe06fe0356027480626169dbbb8ea94b7baed3ec24c8447' | ||
'de48736f6e4153f03d0a5d38ceb6c6fdb7f054e8f47ddd6af0a3dbf14f27b931' | ||
'2513c6d9984dd0a2058557bf00f06d8d5181734e41dcfe07be7ed86f2959622a' | ||
- '5ede1f5fec5b664428412a0849b28895be1c8d8982d3c0d246a4e95fd4730d65') | ||
+ '5ede1f5fec5b664428412a0849b28895be1c8d8982d3c0d246a4e95fd4730d65' | ||
+ '7183fdeea8fd148cf9dd03b0932f9d439b818a5ab3bc9a5e20d8e0b41c9e0efd') | ||
|
||
prepare() { | ||
[[ ! -d gcc ]] && ln -s gcc-${pkgver/+/-} gcc | ||
@@ -64,6 +65,15 @@ prepare() { | ||
#ASan: move allocator base to avoid conflict with high-entropy ASLR for x86-64 Linux' | ||
patch -Np3 < "$srcdir/fix-asan-allocator-aslr.patch" -d libsanitizer/ | ||
|
||
+ # Remove codes filtering default library paths to make mold work correctly | ||
+ patch -Np1 < ../unfilter-default-library-path.patch | ||
+ | ||
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110066 | ||
+ git cherry-pick -n bbc1a102735c72e3c5a4dede8ab382813d12b058 | ||
+ | ||
+ # https://github.com/golang/go/issues/57691 | ||
+ git cherry-pick -n 21a07620f4bfe38f12e6d5be8b1eeecc29fa6852 | ||
+ | ||
mkdir -p "$srcdir/gcc-build" | ||
} | ||
|
||
@@ -140,8 +150,6 @@ package_gcc13-libs() { | ||
|
||
cd gcc-build | ||
make -C $CHOST/libgcc DESTDIR="$pkgdir" install-shared | ||
- mv "${pkgdir}/${_libdir}"/../lib/* "${pkgdir}/${_libdir}" | ||
- rmdir "${pkgdir}/${_libdir}"/../lib | ||
rm -f "$pkgdir/$_libdir/libgcc_eh.a" | ||
|
||
for lib in libasan.so \ | ||
@@ -152,7 +160,6 @@ package_gcc13-libs() { | ||
liblsan.so \ | ||
libquadmath.so \ | ||
libstdc++.so \ | ||
- libtsan.so \ | ||
libubsan.so; do | ||
ln -s /usr/lib/$lib "$pkgdir/$_libdir/$lib" | ||
done | ||
@@ -183,7 +190,8 @@ package_gcc13() { | ||
install -m755 -t "$pkgdir/${_libdir}/" gcc/{cc1,cc1plus,collect2,lto1,gcov{,-tool}} | ||
|
||
make -C $CHOST/libgcc DESTDIR="$pkgdir" install | ||
- rm -f "$pkgdir"/usr/lib/libgcc_s.so* | ||
+ rm -rf "$pkgdir/${_libdir}"/../lib | ||
+ rm -f "$pkgdir/${_libdir}"/libgcc_s.so* | ||
|
||
make -C $CHOST/libstdc++-v3/src DESTDIR="$pkgdir" install | ||
make -C $CHOST/libstdc++-v3/include DESTDIR="$pkgdir" install | ||
@@ -204,7 +212,6 @@ package_gcc13() { | ||
make -C $CHOST/libquadmath DESTDIR="$pkgdir" install-nodist_libsubincludeHEADERS | ||
make -C $CHOST/libsanitizer DESTDIR="$pkgdir" install-nodist_{saninclude,toolexeclib}HEADERS | ||
make -C $CHOST/libsanitizer/asan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS | ||
- make -C $CHOST/libsanitizer/tsan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS | ||
make -C $CHOST/libsanitizer/lsan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS | ||
|
||
make -C libcpp DESTDIR="$pkgdir" install | ||
@@ -214,9 +221,9 @@ package_gcc13() { | ||
ln -s gcc "$pkgdir"/usr/bin/cc-13 | ||
|
||
# create cc-rs compatible symlinks | ||
- # https://github.com/rust-lang/cc-rs/blob/1.0.73/src/lib.rs#L2578-L2581 | ||
+ # https://github.com/rust-lang/cc-rs/blob/1.0.73/src/lib.rs#L2624 | ||
for binary in {c++,g++,gcc,gcc-ar,gcc-nm,gcc-ranlib}; do | ||
- ln -s /usr/bin/${binary} "${pkgdir}"/usr/bin/x86_64-linux-gnu-${binary}-13 | ||
+ ln -s /usr/bin/${binary} "${pkgdir}"/usr/bin/riscv64-linux-gnu-${binary}-13 | ||
done | ||
|
||
# POSIX conformance launcher scripts for c89 and c99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc | ||
index 16bb07f2cdc..1beb23ba279 100644 | ||
--- a/gcc/gcc.cc | ||
+++ b/gcc/gcc.cc | ||
@@ -7904,17 +7904,6 @@ is_directory (const char *path1, bool linker) | ||
*cp++ = '.'; | ||
*cp = '\0'; | ||
|
||
- /* Exclude directories that the linker is known to search. */ | ||
- if (linker | ||
- && IS_DIR_SEPARATOR (path[0]) | ||
- && ((cp - path == 6 | ||
- && filename_ncmp (path + 1, "lib", 3) == 0) | ||
- || (cp - path == 10 | ||
- && filename_ncmp (path + 1, "usr", 3) == 0 | ||
- && IS_DIR_SEPARATOR (path[4]) | ||
- && filename_ncmp (path + 5, "lib", 3) == 0))) | ||
- return 0; | ||
- | ||
return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode)); | ||
} | ||
|