]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Add support for -ftrapv
authorJan Janssen <medhefgo@web.de>
Fri, 10 Mar 2023 08:21:08 +0000 (09:21 +0100)
committerJan Janssen <medhefgo@web.de>
Fri, 17 Mar 2023 09:35:29 +0000 (10:35 +0100)
src/boot/efi/log.c
src/boot/efi/meson.build

index 6ba8d2d58eccf4fbc14719da987885bf115fcd35..879ed766e3be506e5da18564e42fbcd89b95652a 100644 (file)
@@ -81,6 +81,12 @@ void __stack_chk_fail_local(void) {
         __stack_chk_fail();
 }
 
+/* Called by libgcc for some fatal errors like integer overflow with -ftrapv. */
+_used_ _noreturn_ void abort(void);
+void abort(void) {
+        panic(u"systemd-boot: Unknown error, halting.");
+}
+
 #if defined(__ARM_EABI__)
 /* These override the (weak) div0 handlers from libgcc as they would otherwise call raise() instead. */
 
index bfc3f9c27984f22502258658a044318ccb871c23..58bebe446e66c7fc4bb269d1304406f16115866b 100644 (file)
@@ -179,7 +179,6 @@ efi_disabled_c_args = cc.get_supported_arguments(
         '-fcf-protection=none',
         '-fno-asynchronous-unwind-tables',
         '-fno-exceptions',
-        '-fno-trapv',
         '-fno-sanitize=all',
         '-fno-unwind-tables',
 )