Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl
Date: Sun, 05 May 2019 22:14:08 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-11524@inbox.vuxu.org> (raw)

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

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

https://github.com/void-ppc64/void-packages ppc64-musl-gnu-linux
https://github.com/void-linux/void-packages/pull/11524

gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl
The ppc compilers on musl define the `__gnu_linux__` macro by default, while on other architectures they do not. 

Expected output:
```
$ gcc -dM -E - < /dev/null|grep gnu_linux
$
```
Output before patching:
```
$ gcc -dM -E - < /dev/null|grep gnu_linux
#define __gnu_linux__ 1
$
```

This breaks compilation of gimp and maybe other things. It is fixed in gcc 9.1, but the patch is a part of a bigger refactor that's too big to apply, so just do it conditionally like this, we can remove it once we update gcc.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ppc64-musl-gnu-linux-11524.patch --]
[-- Type: application/text/x-diff, Size: 4338 bytes --]

From e34c5bdd8a1193a325e80fd6bf022e47e41973c6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 5 May 2019 21:37:54 +0200
Subject: [PATCH 1/4] gcc: patch out __gnu_linux__ for ppc*-musl

This macro should not be defined on non-glibc systems. It's not
defined on non-glibc systems on other architectures and has been
removed upstream, too.

[ci skip]
---
 srcpkgs/gcc/template | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 5f5432b6640..ef6ea28585d 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -163,6 +163,12 @@ pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
 	esac
+	# REMOVE WITH 9.1
+	case "$XBPS_TARGET_MACHINE" in
+		ppc*-musl)
+			sed -i 's/ \-D__gnu_linux__//' gcc/config/rs6000/sysv4.h
+			;;
+	esac
 }
 do_configure() {
 	local _langs _args _hash

From 750c519c2d7ab84bb04cb6233cd0bc9b6337a1a8 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 5 May 2019 21:39:06 +0200
Subject: [PATCH 2/4] cross-powerpc64le-linux-musl: patch out __gnu_linux__

See the matching change in gcc.

[ci skip]
---
 srcpkgs/cross-powerpc64le-linux-musl/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 9c08497f763..03e91752e9f 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -9,7 +9,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.30
-revision=3
+revision=4
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -89,6 +89,9 @@ _gcc_bootstrap() {
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
+	# REMOVE WITH 9.1
+	sed -i 's/ \-D__gnu_linux__//' gcc/config/rs6000/sysv4.h
+
 	msg_normal "Building cross gcc bootstrap\n"
 
 	[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap

From 236108eb63a639147f9dc860ead10afb5c8e5eb1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 5 May 2019 21:39:38 +0200
Subject: [PATCH 3/4] cross-powerpc64-linux-musl: patch out __gnu_linux__

See the matching change in gcc.

[ci skip]
---
 srcpkgs/cross-powerpc64-linux-musl/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 89575c4598d..c672e92f02e 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -9,7 +9,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.30
-revision=3
+revision=4
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -89,6 +89,9 @@ _gcc_bootstrap() {
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
+	# REMOVE WITH 9.1
+	sed -i 's/ \-D__gnu_linux__//' gcc/config/rs6000/sysv4.h
+
 	msg_normal "Building cross gcc bootstrap\n"
 
 	[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap

From 575b176e15455df4b2a655d9b4145a335dcf995a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 5 May 2019 21:39:51 +0200
Subject: [PATCH 4/4] cross-powerpc-linux-musl: patch out __gnu_linux__

See the matching change in gcc.

[ci skip]
---
 srcpkgs/cross-powerpc-linux-musl/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 59c0ead46f3..1d705ff32c9 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.30
-revision=3
+revision=4
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -92,6 +92,9 @@ _gcc_bootstrap() {
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 
+	# REMOVE WITH 9.1
+	sed -i 's/ \-D__gnu_linux__//' gcc/config/rs6000/sysv4.h
+
 	msg_normal "Building cross gcc bootstrap\n"
 
 	[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap

             reply	other threads:[~2019-05-05 20:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 20:14 voidlinux-github [this message]
2019-05-05 21:42 ` [PR PATCH] [Closed]: " voidlinux-github

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-11524@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --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).