mirror of
https://gitlab.postmarketos.org/postmarketOS/pmaports.git
synced 2025-07-24 15:25:13 +03:00
Done with pmb MR 2521. I've verified that gcc-aarch64 builds and the following packages can be cross compiled from aarch64 to x86_64: * hello-world * iskey * pbsplash * gcc-x86_64 Related: https://gitlab.postmarketos.org/postmarketOS/continuous-testing/upstream-compat/-/blob/master/docs/how-to-fix-upstream-compat-errors.md#gcc- Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6587 [ci:skip-build]: already built successfully in CI
78 lines
2.2 KiB
Diff
78 lines
2.2 KiB
Diff
From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001
|
|
From: Szabolcs Nagy <nsz@port70.net>
|
|
Date: Sat, 7 Nov 2015 02:08:05 +0000
|
|
Subject: [PATCH 13/35] nopie
|
|
|
|
---
|
|
gcc/configure | 25 +++++++++++++++++++++++++
|
|
gcc/configure.ac | 11 +++++++++++
|
|
2 files changed, 36 insertions(+)
|
|
|
|
--- a/gcc/configure
|
|
+++ b/gcc/configure
|
|
@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \
|
|
fi
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5
|
|
$as_echo "$gcc_cv_no_pie" >&6; }
|
|
+# Check if -nopie works.
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
|
|
+$as_echo_n "checking for -nopie option... " >&6; }
|
|
+if ${gcc_cv_nopie+:} false; then :
|
|
+ $as_echo_n "(cached) " >&6
|
|
+else
|
|
+ saved_LDFLAGS="$LDFLAGS"
|
|
+ LDFLAGS="$LDFLAGS -nopie"
|
|
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
+/* end confdefs.h. */
|
|
+int main(void) {return 0;}
|
|
+_ACEOF
|
|
+if ac_fn_cxx_try_link "$LINENO"; then :
|
|
+ gcc_cv_nopie=yes
|
|
+else
|
|
+ gcc_cv_nopie=no
|
|
+fi
|
|
+rm -f core conftest.err conftest.$ac_objext \
|
|
+ conftest$ac_exeext conftest.$ac_ext
|
|
+ LDFLAGS="$saved_LDFLAGS"
|
|
+fi
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
|
|
+$as_echo "$gcc_cv_nopie" >&6; }
|
|
|
|
if test x$enable_host_shared = xyes; then
|
|
PICFLAG=-fPIC
|
|
@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then
|
|
LD_PICFLAG=-pie
|
|
elif test x$gcc_cv_no_pie = xyes; then
|
|
LD_PICFLAG=-no-pie
|
|
+elif test x$gcc_cv_nopie = xyes; then
|
|
+ LD_PICFLAG=-nopie
|
|
else
|
|
LD_PICFLAG=
|
|
fi
|
|
--- a/gcc/configure.ac
|
|
+++ b/gcc/configure.ac
|
|
@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option],
|
|
[gcc_cv_no_pie=yes],
|
|
[gcc_cv_no_pie=no])
|
|
LDFLAGS="$saved_LDFLAGS"])
|
|
+# Check if -nopie works.
|
|
+AC_CACHE_CHECK([for -nopie option],
|
|
+ [gcc_cv_nopie],
|
|
+ [saved_LDFLAGS="$LDFLAGS"
|
|
+ LDFLAGS="$LDFLAGS -nopie"
|
|
+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
|
|
+ [gcc_cv_nopie=yes],
|
|
+ [gcc_cv_nopie=no])
|
|
+ LDFLAGS="$saved_LDFLAGS"])
|
|
|
|
if test x$enable_host_shared = xyes; then
|
|
PICFLAG=-fPIC
|
|
@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then
|
|
LD_PICFLAG=-pie
|
|
elif test x$gcc_cv_no_pie = xyes; then
|
|
LD_PICFLAG=-no-pie
|
|
+elif test x$gcc_cv_nopie = xyes; then
|
|
+ LD_PICFLAG=-nopie
|
|
else
|
|
LD_PICFLAG=
|
|
fi
|