blob: 1f3426295a081fe91a00de5d15938b62122e0910 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 5e635e5dc7d1b21a78f38109d4f43a03bec865c8 Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Sun, 7 Aug 2022 12:51:48 +0200
4Subject: [PATCH] startup: Force -O2
5
6Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=29249]
7
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
9---
10 sysdeps/unix/sysv/linux/startup.h | 5 +++++
11 1 file changed, 5 insertions(+)
12
13diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h
14index 39859b404a..e1fc1b682d 100644
15--- a/sysdeps/unix/sysv/linux/startup.h
16+++ b/sysdeps/unix/sysv/linux/startup.h
17@@ -21,6 +21,11 @@
18 #else
19 # include <sysdep.h>
20
21+# if !defined __OPTIMIZE__ || __OPTIMIZE__ < 2
22+/* Force to fold strlen. */
23+# pragma GCC optimize(2)
24+# endif
25+
26 /* Avoid a run-time invocation of strlen. */
27 #define _startup_fatal(message) \
28 do \