summarylogtreecommitdiffstats
path: root/no-reorder-functions.patch
diff options
context:
space:
mode:
authorWilken 'Akiko' Gottwalt2021-05-27 09:29:01 +0200
committerWilken 'Akiko' Gottwalt2021-05-27 09:29:01 +0200
commit79b08b2af3a551bcc32dd469ef8b50666c581c14 (patch)
treea5fddf03bc13818aaac4fdeaf41f72ecead86e84 /no-reorder-functions.patch
parent7c7ee87e51afb0b166e93fc399d39cf5c0729717 (diff)
downloadaur-79b08b2af3a551bcc32dd469ef8b50666c581c14.tar.gz
updated version to last maintained debian version (77)
Current binutils 2.36+ introduces an odd bug that causes the stage1 and stage2 files to bloat to over 100 MiB. This is not fixed yet.
Diffstat (limited to 'no-reorder-functions.patch')
-rw-r--r--no-reorder-functions.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/no-reorder-functions.patch b/no-reorder-functions.patch
new file mode 100644
index 000000000000..4ec4b3558552
--- /dev/null
+++ b/no-reorder-functions.patch
@@ -0,0 +1,27 @@
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,6 +112,22 @@
+ if test "x$grub_cv_cc_no_stack_protector" = xyes; then
+ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
+ fi
++ # GCC >= 3.3 supports -fno-reorder-functions; this defends us against
++ # unlikely-to-be-executed functions being linked before _start with GCC
++ # >= 4.6.
++ AC_CACHE_CHECK([whether gcc has -fno-reorder-functions],
++ no_reorder_functions_flag, [
++ saved_CFLAGS=$CFLAGS
++ CFLAGS="-fno-reorder-functions"
++ AC_TRY_COMPILE(,
++ ,
++ no_reorder_functions_flag=yes,
++ no_reorder_functions_flag=no)
++ CFLAGS=$saved_CFLAGS
++ ])
++ if test "x$no_reorder_functions_flag" = xyes; then
++ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-reorder-functions"
++ fi
+ fi
+ fi
+