aports/main/s390-tools/zipl-disable-fortify-source.patch
Natanael Copa 9fa935396c main/s390-tools: disable _FORTIFY_SOURCE in zipl
Disabling _FORTIFY_SOURCE fixes SIGFPE in zipl:

Program received signal SIGFPE, Arithmetic exception.
memcpy (__n=7976, __os=<optimized out>, __od=0x3fffdff60c0) at /usr/include/fortify/string.h:53
53              return __builtin_memcpy(__od, __os, __n);

disassebly shows that the exception happens on the jump instruction to
memcpy. Work around it by disabling _FORTIFY_SOURCE for zipl.
2023-10-05 13:02:20 +02:00

13 lines
560 B
Diff

diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index 786bb7f..2a1e10a 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -4,7 +4,7 @@ include ../../common.mak
ALL_CPPFLAGS += -I../include -I../boot \
-DZFCPDUMP_IMAGE="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_IMAGE))" \
-DZFCPDUMP_INITRD="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_INITRD))" \
- -D_FILE_OFFSET_BITS=64 $(NO_PIE_CFLAGS)
+ -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE $(NO_PIE_CFLAGS)
ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
libs = $(rootdir)/libutil/libutil.a