Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] yaboot: fix build w/ gcc10 and host i686/x86_64
@ 2020-09-22 21:27 pullmoll
  2020-09-22 22:29 ` [PR REVIEW] " q66
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pullmoll @ 2020-09-22 21:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

There is a new pull request by pullmoll against master on the void-packages repository

https://github.com/pullmoll/void-packages yaboot
https://github.com/void-linux/void-packages/pull/25038

yaboot: fix build w/ gcc10 and host i686/x86_64
The -fcommon is required for gcc10 to build yaboot.
Adding --build=$XBPS_TRIPLET seems to be a good idea in any case
according to the autoconf manual, see the document at:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html

Still gives an error for me trying to build for ppc-musl using any
x86 host environment, be it glibc or musl libc.

More patches required or something else may be wrong?

A patch file from https://github.com/void-linux/void-packages/pull/25038.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-yaboot-25038.patch --]
[-- Type: text/x-diff, Size: 3235 bytes --]

From b17c0f79ecf1caa2a4a0bead408b6ec32adff120 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= <pullmoll@t-online.de>
Date: Tue, 22 Sep 2020 23:20:57 +0200
Subject: [PATCH] yaboot: fix build w/ gcc10 and host i686/x86_64

The -fcommon is required for gcc10 to build yaboot.
Adding --build=$XBPS_TRIPLET seems to be a good idea in any case
according to the autoconf manual, see the document at:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html

Still gives an error for me trying to build for ppc-musl using any
x86 host environment, be it glibc or musl libc.

More patches required or something else may be wrong?
---
 srcpkgs/yaboot/patches/0003-build-system.patch | 6 ++++--
 srcpkgs/yaboot/template                        | 8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/yaboot/patches/0003-build-system.patch b/srcpkgs/yaboot/patches/0003-build-system.patch
index 8fdf419f187..6dcd018b34c 100644
--- a/srcpkgs/yaboot/patches/0003-build-system.patch
+++ b/srcpkgs/yaboot/patches/0003-build-system.patch
@@ -22,7 +22,7 @@ Also do not strip the binaries upon install, xbps-src will take care of that.
  # command used to get root (needed for tarball creation)
  GETROOT = fakeroot
  
-@@ -32,14 +32,17 @@ LD		:= $(CROSS)ld
+@@ -32,14 +32,18 @@ LD		:= $(CROSS)ld
  AS		:= $(CROSS)as
  OBJCOPY		:= $(CROSS)objcopy
  
@@ -39,10 +39,11 @@ Also do not strip the binaries upon install, xbps-src will take care of that.
  YBCFLAGS += -DKERNELADDR=$(KERNELADDR)
 -YBCFLAGS += -Werror -fdiagnostics-show-option
 +YBCFLAGS += -fgnu89-inline -fno-builtin-malloc -fno-stack-protector -no-pie
++YBCFLAGS += -fcommon
  YBCFLAGS += -I ./include
  YBCFLAGS += -fno-strict-aliasing
  
-@@ -69,12 +72,12 @@ LFLAGS = -Ttext $(TEXTADDR) -Bstatic -melf32ppclinux
+@@ -69,12 +72,13 @@ LFLAGS = -Ttext $(TEXTADDR) -Bstatic -melf32ppclinux
  
  # Libraries
  #
@@ -54,6 +55,7 @@ Also do not strip the binaries upon install, xbps-src will take care of that.
  UCFLAGS = -Os $(CFLAGS) -Wall -I/usr/include
 -UCFLAGS += -Werror -fdiagnostics-show-option
 +UCFLAGS += -fdiagnostics-show-option
++UCFLAGS += -fcommon
  
  # For compiling build-tools that run on the host.
  #
diff --git a/srcpkgs/yaboot/template b/srcpkgs/yaboot/template
index bab154d8c93..c6105d3269d 100644
--- a/srcpkgs/yaboot/template
+++ b/srcpkgs/yaboot/template
@@ -23,7 +23,12 @@ nostrip_files=yaboot
 # We need to compile yaboot binary itself, as well as e2fsprogs libraries,
 # using a 32-bit ppc compiler; 64-bit with -m32 won't do because of libgcc etc.
 case "$XBPS_TARGET_MACHINE" in
-	ppc64*) _need_cross=powerpc-linux-musl ;;
+	ppc64*) if [ "$XBPS_LIBC" = "musl" ]; then
+			_need_cross="powerpc-linux-musl"
+		else
+			_need_cross="powerpc-linux-gnu"
+		fi
+	;;
 esac
 
 if [ -n "$_need_cross" ]; then
@@ -59,6 +64,7 @@ _build_e2fsprogs() {
 		if [ -n "$_need_cross" -o -n "$CROSS_BUILD" ]; then
 			# using a crosscompiler, set up configure/compiler for that
 			_args+=" --host=${_need_cross:-$XBPS_CROSS_TRIPLET}"
+			_args+=" --build=$XBPS_TRIPLET"
 			_ecc="${_need_cross:-$XBPS_CROSS_TRIPLET}-gcc"
 			_ear="${_need_cross:-$XBPS_CROSS_TRIPLET}-ar"
 		fi

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-19 11:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 21:27 [PR PATCH] yaboot: fix build w/ gcc10 and host i686/x86_64 pullmoll
2020-09-22 22:29 ` [PR REVIEW] " q66
2020-09-23 11:11 ` q66
2020-09-23 11:28 ` pullmoll
2020-09-23 11:43 ` [PR PATCH] [Updated] " pullmoll
2020-09-23 12:45 ` [PR REVIEW] " q66
2020-09-23 14:52 ` pullmoll
2021-01-29  2:54 ` ericonr
2022-04-19  2:12 ` github-actions
2022-04-19 11:19 ` [PR PATCH] [Merged]: " q66

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).