sys-boot/aboot: fix link failure on recent gcc (force gnu90)
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Oct 2017 14:36:06 +0000 (15:36 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Oct 2017 14:36:06 +0000 (15:36 +0100)
Package-Manager: Portage-2.3.11, Repoman-2.3.3

sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild
sys-boot/aboot/files/aboot-gnu90.patch [new file with mode: 0644]

index d02ceb0724bc9d9cb4ff9560040d60ec4b9ca793..2fd4afa8a92a22ca71f8afdd2fe9b0016f203fe0 100644 (file)
@@ -34,6 +34,7 @@ src_unpack() {
        # Bug 364697
        epatch "${FILESDIR}/aboot-define_stat_only_in_userspace.patch"
        epatch "${FILESDIR}"/aboot-respect-AR.patch
+       epatch "${FILESDIR}"/aboot-gnu90.patch
 
        # Modified patch from Debian to add netboot support
        epatch "${WORKDIR}"/aboot_gentoo.diff
diff --git a/sys-boot/aboot/files/aboot-gnu90.patch b/sys-boot/aboot/files/aboot-gnu90.patch
new file mode 100644 (file)
index 0000000..2fb4b87
--- /dev/null
@@ -0,0 +1,26 @@
+This patch fixes multiple definitions of 'extern inline' functions.
+
+c99 and gnu90 have slightly different semantics
+WRT symbol definition: http://www.greenend.org.uk/rjk/tech/inline.html
+
+gcc-4 defaults to gnu90 and works, gcc-6 defaults to gnu-99
+and fails to link aboot as:
+  alpha-unknown-linux-gnu-ld: Disabling relaxation: it will not work with multiple definitions
+  lib/libaboot.a(isolib.o): In function `prefetchw':
+  (.text+0x60): multiple definition of `prefetchw'
+  fs/ext2.o:(.text+0xe68): first defined here
+
+The change is to force gnu90 explicitly.
+diff --git a/Makefile b/Makefile
+index b4245af..634ac87 100644
+--- a/Makefile
++++ b/Makefile
+@@ -40,6 +40,6 @@ ifeq ($(TESTING),)
+ CPPFLAGS       = $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include
+-CFLAGS         = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs
++CFLAGS         = $(CPPFLAGS) -std=gnu90 -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs
+ else
+ CPPFLAGS       = -DTESTING $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include
+-CFLAGS                = $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8
++CFLAGS                = $(CPPFLAGS) -std=gnu90 -O -g3 -Wall -D__KERNEL__ -ffixed-8
+ endif