* [PR PATCH] gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl
@ 2019-05-05 20:14 voidlinux-github
2019-05-05 21:42 ` [PR PATCH] [Closed]: " voidlinux-github
0 siblings, 1 reply; 2+ messages in thread
From: voidlinux-github @ 2019-05-05 20:14 UTC (permalink / raw)
To: ml
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Closed]: gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl
2019-05-05 20:14 [PR PATCH] gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl voidlinux-github
@ 2019-05-05 21:42 ` voidlinux-github
0 siblings, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2019-05-05 21:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
There's a closed pull request on the void-packages repository
gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl
https://github.com/void-linux/void-packages/pull/11524
Description: 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-05 21:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-05 20:14 [PR PATCH] gcc + cross: remove default definition of __gnu_linux__ on ppc*-musl voidlinux-github
2019-05-05 21:42 ` [PR PATCH] [Closed]: " voidlinux-github
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).