From dae35c05cd92ce0eaa5e065696cb2ceadb0abe26 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 6 Jul 2018 02:13:18 +0200 Subject: [PATCH] gcc: fixed lib64 dir installation, added default-pie and default ssp configure options --- gcc/.footprint | 139 ++++++++++++++++++------------------- gcc/.md5sum | 1 + gcc/Pkgfile | 14 ++-- gcc/gcc-aarch64-dirs.patch | 13 ++++ 4 files changed, 92 insertions(+), 75 deletions(-) create mode 100644 gcc/gcc-aarch64-dirs.patch diff --git a/gcc/.footprint b/gcc/.footprint index 872111c..9084453 100644 --- a/gcc/.footprint +++ b/gcc/.footprint @@ -1282,80 +1282,79 @@ lrwxrwxrwx root/root usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/plugin/libcc1pl lrwxrwxrwx root/root usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/plugin/libcp1plugin.so -> libcp1plugin.so.0.0.0 lrwxrwxrwx root/root usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/plugin/libcp1plugin.so.0 -> libcp1plugin.so.0.0.0 -rwxr-xr-x root/root usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/plugin/libcp1plugin.so.0.0.0 -drwxr-xr-x root/root usr/lib64/ --rw-r--r-- root/root usr/lib64/libasan.a --rwxr-xr-x root/root usr/lib64/libasan.la -lrwxrwxrwx root/root usr/lib64/libasan.so -> libasan.so.4.0.0 -lrwxrwxrwx root/root usr/lib64/libasan.so.4 -> libasan.so.4.0.0 --rwxr-xr-x root/root usr/lib64/libasan.so.4.0.0 --rw-r--r-- root/root usr/lib64/libasan_preinit.o --rw-r--r-- root/root usr/lib64/libatomic.a --rwxr-xr-x root/root usr/lib64/libatomic.la -lrwxrwxrwx root/root usr/lib64/libatomic.so -> libatomic.so.1.2.0 -lrwxrwxrwx root/root usr/lib64/libatomic.so.1 -> libatomic.so.1.2.0 --rwxr-xr-x root/root usr/lib64/libatomic.so.1.2.0 --rwxr-xr-x root/root usr/lib64/libcc1.la -lrwxrwxrwx root/root usr/lib64/libcc1.so -> libcc1.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/libcc1.so.0 -> libcc1.so.0.0.0 --rwxr-xr-x root/root usr/lib64/libcc1.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/libgcc_s.so -> libgcc_s.so.1 --rw-r--r-- root/root usr/lib64/libgcc_s.so.1 --rw-r--r-- root/root usr/lib64/libgomp.a --rwxr-xr-x root/root usr/lib64/libgomp.la -lrwxrwxrwx root/root usr/lib64/libgomp.so -> libgomp.so.1.0.0 -lrwxrwxrwx root/root usr/lib64/libgomp.so.1 -> libgomp.so.1.0.0 --rwxr-xr-x root/root usr/lib64/libgomp.so.1.0.0 --rw-r--r-- root/root usr/lib64/libgomp.spec --rw-r--r-- root/root usr/lib64/libitm.a --rwxr-xr-x root/root usr/lib64/libitm.la -lrwxrwxrwx root/root usr/lib64/libitm.so -> libitm.so.1.0.0 -lrwxrwxrwx root/root usr/lib64/libitm.so.1 -> libitm.so.1.0.0 --rwxr-xr-x root/root usr/lib64/libitm.so.1.0.0 --rw-r--r-- root/root usr/lib64/libitm.spec --rw-r--r-- root/root usr/lib64/liblsan.a --rwxr-xr-x root/root usr/lib64/liblsan.la -lrwxrwxrwx root/root usr/lib64/liblsan.so -> liblsan.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/liblsan.so.0 -> liblsan.so.0.0.0 --rwxr-xr-x root/root usr/lib64/liblsan.so.0.0.0 --rw-r--r-- root/root usr/lib64/libobjc.a --rwxr-xr-x root/root usr/lib64/libobjc.la -lrwxrwxrwx root/root usr/lib64/libobjc.so -> libobjc.so.4.0.0 -lrwxrwxrwx root/root usr/lib64/libobjc.so.4 -> libobjc.so.4.0.0 --rwxr-xr-x root/root usr/lib64/libobjc.so.4.0.0 --rw-r--r-- root/root usr/lib64/libsanitizer.spec --rw-r--r-- root/root usr/lib64/libssp.a --rwxr-xr-x root/root usr/lib64/libssp.la -lrwxrwxrwx root/root usr/lib64/libssp.so -> libssp.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/libssp.so.0 -> libssp.so.0.0.0 --rwxr-xr-x root/root usr/lib64/libssp.so.0.0.0 --rw-r--r-- root/root usr/lib64/libssp_nonshared.a --rwxr-xr-x root/root usr/lib64/libssp_nonshared.la --rw-r--r-- root/root usr/lib64/libstdc++.a --rwxr-xr-x root/root usr/lib64/libstdc++.la -lrwxrwxrwx root/root usr/lib64/libstdc++.so -> libstdc++.so.6.0.24 -lrwxrwxrwx root/root usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.24 --rwxr-xr-x root/root usr/lib64/libstdc++.so.6.0.24 --rw-r--r-- root/root usr/lib64/libstdc++fs.a --rwxr-xr-x root/root usr/lib64/libstdc++fs.la --rw-r--r-- root/root usr/lib64/libsupc++.a --rwxr-xr-x root/root usr/lib64/libsupc++.la --rw-r--r-- root/root usr/lib64/libtsan.a --rwxr-xr-x root/root usr/lib64/libtsan.la -lrwxrwxrwx root/root usr/lib64/libtsan.so -> libtsan.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/libtsan.so.0 -> libtsan.so.0.0.0 --rwxr-xr-x root/root usr/lib64/libtsan.so.0.0.0 --rw-r--r-- root/root usr/lib64/libtsan_preinit.o --rw-r--r-- root/root usr/lib64/libubsan.a --rwxr-xr-x root/root usr/lib64/libubsan.la -lrwxrwxrwx root/root usr/lib64/libubsan.so -> libubsan.so.0.0.0 -lrwxrwxrwx root/root usr/lib64/libubsan.so.0 -> libubsan.so.0.0.0 --rwxr-xr-x root/root usr/lib64/libubsan.so.0.0.0 +-rw-r--r-- root/root usr/lib/libasan.a +-rwxr-xr-x root/root usr/lib/libasan.la +lrwxrwxrwx root/root usr/lib/libasan.so -> libasan.so.4.0.0 +lrwxrwxrwx root/root usr/lib/libasan.so.4 -> libasan.so.4.0.0 +-rwxr-xr-x root/root usr/lib/libasan.so.4.0.0 +-rw-r--r-- root/root usr/lib/libasan_preinit.o +-rw-r--r-- root/root usr/lib/libatomic.a +-rwxr-xr-x root/root usr/lib/libatomic.la +lrwxrwxrwx root/root usr/lib/libatomic.so -> libatomic.so.1.2.0 +lrwxrwxrwx root/root usr/lib/libatomic.so.1 -> libatomic.so.1.2.0 +-rwxr-xr-x root/root usr/lib/libatomic.so.1.2.0 +-rwxr-xr-x root/root usr/lib/libcc1.la +lrwxrwxrwx root/root usr/lib/libcc1.so -> libcc1.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libcc1.so.0 -> libcc1.so.0.0.0 +-rwxr-xr-x root/root usr/lib/libcc1.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libgcc_s.so -> libgcc_s.so.1 +-rw-r--r-- root/root usr/lib/libgcc_s.so.1 +-rw-r--r-- root/root usr/lib/libgomp.a +-rwxr-xr-x root/root usr/lib/libgomp.la +lrwxrwxrwx root/root usr/lib/libgomp.so -> libgomp.so.1.0.0 +lrwxrwxrwx root/root usr/lib/libgomp.so.1 -> libgomp.so.1.0.0 +-rwxr-xr-x root/root usr/lib/libgomp.so.1.0.0 +-rw-r--r-- root/root usr/lib/libgomp.spec +-rw-r--r-- root/root usr/lib/libitm.a +-rwxr-xr-x root/root usr/lib/libitm.la +lrwxrwxrwx root/root usr/lib/libitm.so -> libitm.so.1.0.0 +lrwxrwxrwx root/root usr/lib/libitm.so.1 -> libitm.so.1.0.0 +-rwxr-xr-x root/root usr/lib/libitm.so.1.0.0 +-rw-r--r-- root/root usr/lib/libitm.spec +-rw-r--r-- root/root usr/lib/liblsan.a +-rwxr-xr-x root/root usr/lib/liblsan.la +lrwxrwxrwx root/root usr/lib/liblsan.so -> liblsan.so.0.0.0 +lrwxrwxrwx root/root usr/lib/liblsan.so.0 -> liblsan.so.0.0.0 +-rwxr-xr-x root/root usr/lib/liblsan.so.0.0.0 +-rw-r--r-- root/root usr/lib/libobjc.a +-rwxr-xr-x root/root usr/lib/libobjc.la +lrwxrwxrwx root/root usr/lib/libobjc.so -> libobjc.so.4.0.0 +lrwxrwxrwx root/root usr/lib/libobjc.so.4 -> libobjc.so.4.0.0 +-rwxr-xr-x root/root usr/lib/libobjc.so.4.0.0 +-rw-r--r-- root/root usr/lib/libsanitizer.spec +-rw-r--r-- root/root usr/lib/libssp.a +-rwxr-xr-x root/root usr/lib/libssp.la +lrwxrwxrwx root/root usr/lib/libssp.so -> libssp.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libssp.so.0 -> libssp.so.0.0.0 +-rwxr-xr-x root/root usr/lib/libssp.so.0.0.0 +-rw-r--r-- root/root usr/lib/libssp_nonshared.a +-rwxr-xr-x root/root usr/lib/libssp_nonshared.la +-rw-r--r-- root/root usr/lib/libstdc++.a +-rwxr-xr-x root/root usr/lib/libstdc++.la +lrwxrwxrwx root/root usr/lib/libstdc++.so -> libstdc++.so.6.0.24 +lrwxrwxrwx root/root usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.24 +-rwxr-xr-x root/root usr/lib/libstdc++.so.6.0.24 +-rw-r--r-- root/root usr/lib/libstdc++fs.a +-rwxr-xr-x root/root usr/lib/libstdc++fs.la +-rw-r--r-- root/root usr/lib/libsupc++.a +-rwxr-xr-x root/root usr/lib/libsupc++.la +-rw-r--r-- root/root usr/lib/libtsan.a +-rwxr-xr-x root/root usr/lib/libtsan.la +lrwxrwxrwx root/root usr/lib/libtsan.so -> libtsan.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libtsan.so.0 -> libtsan.so.0.0.0 +-rwxr-xr-x root/root usr/lib/libtsan.so.0.0.0 +-rw-r--r-- root/root usr/lib/libtsan_preinit.o +-rw-r--r-- root/root usr/lib/libubsan.a +-rwxr-xr-x root/root usr/lib/libubsan.la +lrwxrwxrwx root/root usr/lib/libubsan.so -> libubsan.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libubsan.so.0 -> libubsan.so.0.0.0 +-rwxr-xr-x root/root usr/lib/libubsan.so.0.0.0 drwxr-xr-x root/root usr/share/ drwxr-xr-x root/root usr/share/gdb/ drwxr-xr-x root/root usr/share/gdb/auto-load/ drwxr-xr-x root/root usr/share/gdb/auto-load/usr/ -drwxr-xr-x root/root usr/share/gdb/auto-load/usr/lib64/ --rw-r--r-- root/root usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.24-gdb.py +drwxr-xr-x root/root usr/share/gdb/auto-load/usr/lib/ +-rw-r--r-- root/root usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.24-gdb.py drwxr-xr-x root/root usr/share/man/ drwxr-xr-x root/root usr/share/man/man1/ -rw-r--r-- root/root usr/share/man/man1/cpp.1.gz diff --git a/gcc/.md5sum b/gcc/.md5sum index 63c9144..1ad2894 100644 --- a/gcc/.md5sum +++ b/gcc/.md5sum @@ -1,2 +1,3 @@ be2da21680f27624f3a87055c4ba5af2 gcc-7.3.0.tar.xz +dd44eeb6b7d12824ac0eb56e95713a59 gcc-aarch64-dirs.patch a617c4d3fa11e0c9410ac213eb061677 gcc-nocheck-fixincludes.patch diff --git a/gcc/Pkgfile b/gcc/Pkgfile index a733356..fbc1ce7 100644 --- a/gcc/Pkgfile +++ b/gcc/Pkgfile @@ -8,10 +8,11 @@ name=gcc version=7.3.0 release=1 source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz \ - $name-nocheck-fixincludes.patch) + $name-nocheck-fixincludes.patch $name-aarch64-dirs.patch) build() { patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch + patch -d $name-$version -p1 -i $SRC/gcc-aarch64-dirs.patch mkdir build cd build @@ -26,12 +27,15 @@ build() { --disable-nls \ --with-x=no \ --with-system-zlib \ + --enable-multilib \ + --enable-default-pie \ + --enable-default-ssp \ --with-pkgversion="CRUX-ARM 64b" - make + make bootstrap make -j1 DESTDIR=$PKG install - mkdir $PKG/lib + install -d $PKG/lib ln -sf ../usr/bin/cpp $PKG/lib/cpp ln -sf gcc $PKG/usr/bin/cc ln -sf g++ $PKG/usr/bin/c++ @@ -41,10 +45,10 @@ build() { rm -r $PKG/usr/bin/*-linux-gnu* rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed} - for D in lib64; do + for D in lib; do install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D} mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D} done - sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib64/{libstdc++.la,libsupc++.la} + sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la} } diff --git a/gcc/gcc-aarch64-dirs.patch b/gcc/gcc-aarch64-dirs.patch new file mode 100644 index 0000000..5989eb9 --- /dev/null +++ b/gcc/gcc-aarch64-dirs.patch @@ -0,0 +1,13 @@ +diff -Nru gcc-7.3.0.orig/gcc/config/aarch64/t-aarch64-linux gcc-7.3.0/gcc/config/aarch64/t-aarch64-linux +--- gcc-7.3.0.orig/gcc/config/aarch64/t-aarch64-linux 2018-06-20 13:36:39.756075935 +0200 ++++ gcc-7.3.0/gcc/config/aarch64/t-aarch64-linux 2018-06-20 13:36:49.900014648 +0200 +@@ -22,7 +22,7 @@ + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) + MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) + + MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32 + -- 2.26.2