Github messages for voidlinux
 help / color / mirror / Atom feed
From: pullmoll <pullmoll@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] yaboot: fix build w/ gcc10 and host i686/x86_64
Date: Tue, 22 Sep 2020 23:27:09 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25038@inbox.vuxu.org> (raw)

[-- 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

             reply	other threads:[~2020-09-22 21:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 21:27 pullmoll [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25038@inbox.vuxu.org \
    --to=pullmoll@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).