From a6b61353e41e5562ea06d39e29f550626638503a Mon Sep 17 00:00:00 2001 From: bouyer Date: Thu, 4 Feb 2021 23:51:51 +0000 Subject: When compiling with -fwhole-program gcc will omit functions which are not used in the file, even if not declared static. Add __attribute__((externally_visible)) to memcpy() to force gcc to include it. Fixes build on -current (gcc 9) This is a build fix so no PKGREVISION bump --- sysutils/xentools413/distinfo | 3 ++- .../patches/patch-.._seabios-rel-1.12.1_src_string.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 sysutils/xentools413/patches/patch-.._seabios-rel-1.12.1_src_string.c (limited to 'sysutils') diff --git a/sysutils/xentools413/distinfo b/sysutils/xentools413/distinfo index 36141b654de..44fbe210155 100644 --- a/sysutils/xentools413/distinfo +++ b/sysutils/xentools413/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2021/02/03 22:30:21 bouyer Exp $ +$NetBSD: distinfo,v 1.9 2021/02/04 23:51:51 bouyer Exp $ SHA1 (xen413/ipxe-1dd56dbd11082fb622c2ed21cfaced4f47d798a6.tar.gz) = b78d21457bc07b4c4d3e770109c169ddafdacdf5 RMD160 (xen413/ipxe-1dd56dbd11082fb622c2ed21cfaced4f47d798a6.tar.gz) = 846dbcc0f56e87fca8c87b00ca2ed031471d4246 @@ -12,6 +12,7 @@ SHA1 (xen413/xen-4.13.2.tar.gz) = d514f1de9582c58676420bb2c9fb1c765b44fbff RMD160 (xen413/xen-4.13.2.tar.gz) = 96727c20bd84338f8c67c7c584c01ef877bbcb18 SHA512 (xen413/xen-4.13.2.tar.gz) = cd3092281c97e9421e303aa288aac04dcccd5536ba7c0ff4d51fbf3d07b5ffacfe3456ba06f5cf63577dafbf8cf3a5d9825ceb5e9ef8ca1427900cc3e57b50a3 Size (xen413/xen-4.13.2.tar.gz) = 39037826 bytes +SHA1 (patch-.._seabios-rel-1.12.1_src_string.c) = 8b4091daf0b653cfd4db51d2c09b5b42a08f6311 SHA1 (patch-Config.mk) = c41005a60de2f94a72b0206030eb021c137653d3 SHA1 (patch-Makefile) = 6c580cbea532d08a38cf5e54228bd0210a98da21 SHA1 (patch-XSA115-c) = 7e3216a23c522fc73f47fa6deef8918c4dce7fae diff --git a/sysutils/xentools413/patches/patch-.._seabios-rel-1.12.1_src_string.c b/sysutils/xentools413/patches/patch-.._seabios-rel-1.12.1_src_string.c new file mode 100644 index 00000000000..22c44406ccc --- /dev/null +++ b/sysutils/xentools413/patches/patch-.._seabios-rel-1.12.1_src_string.c @@ -0,0 +1,18 @@ +$NetBSD: patch-.._seabios-rel-1.12.1_src_string.c,v 1.1 2021/02/04 23:51:51 bouyer Exp $ + +when the code is compiled -fwhole-program, memcpy() will be ommitted by gcc +because nothing in the file references it. Later the link fails with +undefined references to memcpy(). +Force the inclusion with (externally_visible) attribute + +--- ../seabios-rel-1.12.1/src/string.c.orig 2021-02-04 23:06:35.686612339 +0100 ++++ ../seabios-rel-1.12.1/src/string.c 2021-02-04 23:03:33.884883498 +0100 +@@ -149,7 +149,7 @@ + memcpy(d_fl, s_fl, len); + } + +-void * ++__attribute__((externally_visible)) void * + #undef memcpy + memcpy(void *d1, const void *s1, size_t len) + #if MODESEGMENT == 0 -- cgit v1.2.3