Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haikuports/haikuports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cb61a0f27211
Choose a base ref
...
head repository: haikuports/haikuports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 558523994f3a
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Oct 12, 2021

  1. gcc: fix -fstack-protector on x86

    linking stack-protected objects on x86 would fail if -fstack-protector
    wasn't passed to the linker. Only one symbol is missing, provided by
    libssp_nonshared. So merge it in libgcc.a, which is always linked in.
    korli committed Oct 12, 2021
    5
    Copy the full SHA
    5585239 View commit details
Showing with 18 additions and 62 deletions.
  1. +10 −1 sys-devel/gcc/gcc-8.3.0_2019_05_24.recipe
  2. +8 −61 sys-devel/gcc/patches/gcc-8.3.0_2019_05_24.patchset
11 changes: 10 additions & 1 deletion sys-devel/gcc/gcc-8.3.0_2019_05_24.recipe
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ HOMEPAGE="https://gcc.gnu.org/"
COPYRIGHT="1988-2019 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="11"
REVISION="12"
gccVersion="${portVersion%%_*}"
SOURCE_URI="https://ftpmirror.gnu.org/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz
https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz"
@@ -348,6 +348,15 @@ INSTALL()
$libDir/
cp $gccLibDir/libgcc*.a $developLibDir/

# merge libssp_nonshared.a in libgcc.a on x86
if [ "$targetArchitecture" = "x86_gcc2" ]; then
(mkdir temp_libgcc; cd temp_libgcc; ar x ../$gccLibDir/libssp_nonshared.a;
ar x ../$gccLibDir/libgcc.a; cd ..)
ar -qc $developLibDir/libgcc.a temp_libgcc/*.o
cp $developLibDir/libgcc.a $gccLibDir/libgcc.a
rm -rf temp_libgcc
fi

# gcc and c++ headers
mkdir -p $includeDir/gcc
cp -r $gccLibDir/include $includeDir/gcc/
69 changes: 8 additions & 61 deletions sys-devel/gcc/patches/gcc-8.3.0_2019_05_24.patchset
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fb71f0f070a6b615d1cb519a24f35208eaaaf705 Mon Sep 17 00:00:00 2001
From adc6ede27d2394559d88d637b006ebbe3dccc5e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sun, 19 Jul 2015 18:55:34 +0200
Subject: Haiku patch
@@ -2403,7 +2403,7 @@ index 24d13f3..94d96d9 100644
2.30.2


From 6983c6046434cc1ec0944238f128758079738989 Mon Sep 17 00:00:00 2001
From 01924134017f1fcd0081a891ba2eb95613f97258 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Mon, 27 Jul 2015 16:32:32 +0200
Subject: Haiku: disable -fno-PIE as this fails on x86_64.
@@ -2439,7 +2439,7 @@ index f42df7e..74d3ef4 100644
2.30.2


From 4db53b922f2ddf5013bd7e43c896b3380089fce3 Mon Sep 17 00:00:00 2001
From 21968c34fecc00d38a297603c432060d8454b4d0 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 5 May 2016 09:03:06 +0000
Subject: fix for libstdc++/69506
@@ -2461,7 +2461,7 @@ index 4674f7b..02c8693 100644
2.30.2


From 3fad5eddbd20d1bce50a680ac9bf5ecbcf280ab8 Mon Sep 17 00:00:00 2001
From 5d7df4f5e5a264b795bb4494475a521aff1c9eb4 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 5 May 2016 15:52:08 +0000
Subject: rename x86_elf_aligned_common.
@@ -2488,7 +2488,7 @@ index 76ba48e..e2fa55a 100644
2.30.2


From d07191c62dfd5b6354bbb3e3081e2b87ab38d0aa Mon Sep 17 00:00:00 2001
From 859d7f708f77d4dc9c72da5da6a2a796ec6c4b09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 2 May 2018 08:37:20 +0200
Subject: Enable libstdcxx_filesystem_ts for Haiku
@@ -2512,7 +2512,7 @@ index 4f37b6a..7d8fd79 100644
2.30.2


From 76c7ae4f9d781f8281ae81f2a7a6147463944946 Mon Sep 17 00:00:00 2001
From fdf77b1df64dd3246904e03e7a80bd4aef9ed932 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 12 Jul 2019 18:17:00 +0000
Subject: gcc: fix build configuration for libgcc.
@@ -2537,7 +2537,7 @@ index 26d080a..bdc2b1c 100644
2.30.2


From 6c3553452458b7475458091a6041612df0bad4c2 Mon Sep 17 00:00:00 2001
From e77f625295263a155c7ecfde11a828c473f42456 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 12 May 2017 23:49:00 +0200
Subject: Haiku: regenerate configure.
@@ -3287,7 +3287,7 @@ index 5535bfa..aa15c92 100755
2.30.2


From f1162a9c80caeb6557e89421aa5a4c55e9357eb2 Mon Sep 17 00:00:00 2001
From 4af6226f7b6c94c455ec3b9bfdb95460b055ad3b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 6 May 2021 19:15:37 +0200
Subject: Haiku: default to strict Dwarf4
@@ -3408,57 +3408,4 @@ index 587d1fb..ba1f7f5 100644
2.30.2


From 9af45c778fc6e188fdbe59099fd226eca0765610 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 10 Oct 2021 20:19:55 +0200
Subject: haiku: libroot provides ssp

links against libssp_nonshared for local symbols needed on x86

diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h
index 62e88cc..b204c9b 100644
--- a/gcc/config/haiku.h
+++ b/gcc/config/haiku.h
@@ -210,9 +210,10 @@ Boston, MA 02111-1307, USA. */
/* Haiku headers are C++-aware (and often use C++). */
#define NO_IMPLICIT_EXTERN_C

-/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */
-#ifndef TARGET_LIBC_PROVIDES_SSP
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}"
+#ifdef TARGET_LIBC_PROVIDES_SSP
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ "|fstack-protector-strong|fstack-protector-explicit" \
+ ":-lssp_nonshared}"
#endif

/* Do not use TM clone registry in Haiku for now */
diff --git a/gcc/configure b/gcc/configure
index a809740..1d6f30d 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29260,7 +29260,7 @@ fi
# realistically usable GNU/Hurd configurations.
# All supported versions of musl provide it as well
gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin* | *-*-freebsd* | *-*-netbsd*)
+ *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-haiku*)
ac_fn_cxx_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
if test "x$ac_cv_func___stack_chk_fail" = x""yes; then :
gcc_cv_libc_provides_ssp=yes
diff --git a/gcc/configure.ac b/gcc/configure.ac
index c3a3456..ee37a94 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5936,7 +5936,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
# realistically usable GNU/Hurd configurations.
# All supported versions of musl provide it as well
gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin* | *-*-freebsd* | *-*-netbsd*)
+ *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-haiku*)
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
[echo "no __stack_chk_fail on this target"])
;;
--
2.30.2