0025-startup-Force-O2.patch 965 B

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