Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7f174c4d1 | ||
|
|
a8cb82f327 | ||
|
|
481147a624 | ||
|
|
50523ef53b | ||
|
|
71e9aa2d66 | ||
|
|
53f854e98b | ||
|
|
13c8d5702b | ||
|
|
ba35b59a9c | ||
|
|
be76600439 | ||
|
|
91e58166ea | ||
|
|
2cf5f30d2e | ||
|
|
0938713dcb | ||
|
|
afd977d90c | ||
|
|
ed505f7fd6 | ||
|
|
764f3b58d7 | ||
|
|
2c7f28f335 | ||
|
|
8ef48add96 | ||
|
|
3052a172e9 | ||
|
|
4627e7bb30 | ||
|
|
43eccc264a | ||
|
|
b8435887c9 | ||
|
|
47b2ccfcca | ||
|
|
941382caa4 | ||
|
|
549e1139e6 | ||
|
|
20158c8519 | ||
|
|
7de33686eb | ||
|
|
df02d8d016 | ||
|
|
b206602254 | ||
|
|
b2bc65c8c1 | ||
|
|
21545ab5b9 | ||
|
|
ff0ec2244a | ||
|
|
76feb7a8a7 | ||
|
|
b6d5759ada | ||
|
|
a802e847f8 | ||
|
|
4c79fd7232 | ||
|
|
3d53345971 | ||
|
|
9cc21bbbcb | ||
|
|
f4f3f87630 | ||
|
|
e3bf4e33b8 | ||
|
|
5566fb4d7e | ||
|
|
ef63d03a5e | ||
|
|
f3b4ebbe5d | ||
|
|
749d75d041 | ||
|
|
539e856335 | ||
|
|
b90ebbfa6a | ||
|
|
6f7e61c8f7 | ||
|
|
25208ba258 | ||
|
|
f8c6591562 | ||
|
|
2c2ddfab1d | ||
|
|
d28e247eb8 | ||
|
|
c958bf087d | ||
|
|
c69f835eef | ||
|
|
fb9ff4d287 | ||
|
|
4c3297898e | ||
|
|
4716737c3a | ||
|
|
8c6465e780 | ||
|
|
0ffd9ec2d5 | ||
|
|
3ea2ec9ec2 | ||
|
|
bfcf243844 | ||
|
|
02306692a3 | ||
|
|
5baf7a2adf | ||
|
|
03ab5cae45 | ||
|
|
3396f200e8 | ||
|
|
6ab99a155e | ||
|
|
9e4ec1effa | ||
|
|
827d111eab | ||
|
|
4af257d432 | ||
|
|
4a7aa0d3f6 | ||
|
|
8de9c29216 | ||
|
|
83a56e9258 | ||
|
|
75982738e7 | ||
|
|
506c0983d5 | ||
|
|
de3a1c39ae | ||
|
|
e69b747261 | ||
|
|
a90755783d | ||
|
|
bf21ed76e0 | ||
|
|
b004d878e2 | ||
|
|
f68466cdb4 | ||
|
|
4653878ad2 | ||
|
|
f686fc33b7 | ||
|
|
c7dcaf92cf | ||
|
|
492a074497 | ||
|
|
b525c61980 | ||
|
|
404288041c | ||
|
|
bf5780b3c7 | ||
|
|
04bd40aa82 | ||
|
|
f678e78b7c | ||
|
|
d1566baf5c | ||
|
|
c1ac716353 | ||
|
|
9262a0cf78 | ||
|
|
378cee85d8 | ||
|
|
db179541b2 | ||
|
|
810fca389b | ||
|
|
76bca6a3c5 | ||
|
|
056b7d8b4d | ||
|
|
19c5527601 | ||
|
|
686cae013d | ||
|
|
522d833b00 | ||
|
|
f3c3e4d293 | ||
|
|
5e4493008b | ||
|
|
fb7a5525b5 | ||
|
|
da904a2a7e | ||
|
|
4217f537aa | ||
|
|
04150f24d7 | ||
|
|
347abb0971 | ||
|
|
3077cb2863 | ||
|
|
26b371de4a | ||
|
|
0c68b045cf | ||
|
|
876755cff9 | ||
|
|
edee33027b | ||
|
|
664c552e2c | ||
|
|
43bf56859c | ||
|
|
57dc0fab55 | ||
|
|
215eeab2b5 | ||
|
|
ae6b2f0c63 | ||
|
|
a9c5b42fe0 | ||
|
|
2d2dc61103 | ||
|
|
f6430a1c3b | ||
|
|
c3b626b1a0 | ||
|
|
3926582edf | ||
|
|
12f614e9cf | ||
|
|
10df419da7 | ||
|
|
834c40ed56 | ||
|
|
8d108c7ef1 | ||
|
|
b48d30c9e1 | ||
|
|
9eaa4ee251 | ||
|
|
b86a1b4d02 | ||
|
|
6511b5fab1 | ||
|
|
d5ddb65d56 | ||
|
|
4671f0aaa5 | ||
|
|
2c60a56b01 | ||
|
|
679e640038 | ||
|
|
83d7de0b5a | ||
|
|
faf15524e2 | ||
|
|
f4592196d1 | ||
|
|
9ac40f89f5 | ||
|
|
74070c81ad | ||
|
|
6cf348842d | ||
|
|
424a4ac5ba | ||
|
|
cf4fe51c3a | ||
|
|
2bdc4c5621 | ||
|
|
dc95220513 | ||
|
|
99dd802ed6 | ||
|
|
69b599b0f4 | ||
|
|
409635d4f6 | ||
|
|
506872dfd3 | ||
|
|
9299b8d07b | ||
|
|
ba5ba97370 | ||
|
|
a3563a6956 | ||
|
|
426538b29e | ||
|
|
785eab91ea | ||
|
|
394bf910c4 | ||
|
|
f8e678372b | ||
|
|
6bb588832f | ||
|
|
318aeaf2a0 | ||
|
|
b483a4231f | ||
|
|
0aaac413ba | ||
|
|
6772704b94 | ||
|
|
8d5df5ebe8 | ||
|
|
a4d52b3ef3 | ||
|
|
48617aade2 | ||
|
|
2c642154c7 | ||
|
|
4c6ecee1ec | ||
|
|
83140df9ce | ||
|
|
5eafbba043 | ||
|
|
d2b54b247f | ||
|
|
f330c909d0 | ||
|
|
9984809705 | ||
|
|
4b645abf55 | ||
|
|
a2f3ab0b05 | ||
|
|
dc553a129b | ||
|
|
713f04fdce | ||
|
|
323cab4b06 | ||
|
|
b2df088a3d | ||
|
|
1cce12ece3 | ||
|
|
62d839c60e | ||
|
|
05ba9bc06a | ||
|
|
88fc864fde | ||
|
|
1f76f17e58 | ||
|
|
fa8de434b2 | ||
|
|
ad50712d2c | ||
|
|
3a9a069cae | ||
|
|
2d536fdb92 | ||
|
|
c95354ee26 | ||
|
|
7d2df5c5d6 | ||
|
|
97910522ad | ||
|
|
7fa7061d0b | ||
|
|
3a622c63d7 | ||
|
|
b17a33ad59 | ||
|
|
91d28f724c | ||
|
|
88e52dc4fa | ||
|
|
8e08f02f80 | ||
|
|
72fc85b1b4 | ||
|
|
2f71538cc8 | ||
|
|
fc5477ddfb |
No files matched your search
+2
-8
@@ -18,7 +18,7 @@ stages:
|
||||
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
|
||||
.only-default: &only-default
|
||||
only:
|
||||
- master
|
||||
- v21.03
|
||||
- merge_requests
|
||||
- tags
|
||||
|
||||
@@ -109,7 +109,7 @@ kernel-kconfig:
|
||||
stage: lint
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
- v21.03
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
@@ -150,14 +150,8 @@ mr-settings:
|
||||
build-x86_64:
|
||||
extends: .build
|
||||
|
||||
build-x86:
|
||||
extends: .build
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
|
||||
build-armv7:
|
||||
extends: .build
|
||||
|
||||
build-armhf:
|
||||
extends: .build
|
||||
@@ -1,15 +0,0 @@
|
||||
# Reference: https://postmarketos.org/channels.cfg
|
||||
[channels.cfg]
|
||||
recommended=edge
|
||||
|
||||
[edge]
|
||||
description=Rolling release channel
|
||||
branch_pmaports=master
|
||||
branch_aports=master
|
||||
mirrordir_alpine=edge
|
||||
|
||||
[stable]
|
||||
description=Stable release channel (first beta v20.05, does not have many devices yet)
|
||||
branch_pmaports=v20.05
|
||||
branch_aports=3.12-stable
|
||||
mirrordir_alpine=v3.12
|
||||
@@ -3,7 +3,7 @@
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-aarch64
|
||||
pkgver=2.35.1
|
||||
pkgver=2.35.2
|
||||
pkgrel=1
|
||||
pkgdesc="Tools necessary to build programs for aarch64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
@@ -15,6 +15,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2021-3487.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
@@ -25,6 +26,8 @@ if [ "$CHOST" != "$CTARGET" ]; then
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
@@ -60,8 +63,9 @@ package() {
|
||||
|
||||
|
||||
|
||||
sha512sums="94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb binutils-2.35.1.tar.xz
|
||||
sha512sums="9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch"
|
||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b08384ed124a74ad3a424db370c107230f09a54378502ca4385deb738f7cf799857f2af0db52709c7eeab8fa6c0a3d972f891396cce1e2834a21f67682fc4355 CVE-2021-3487.patch"
|
||||
@@ -0,0 +1,72 @@
|
||||
From 647cebce12a6b0a26960220caff96ff38978cf24 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 26 Nov 2020 17:08:33 +0000
|
||||
Subject: [PATCH] Prevent a memory allocation failure when parsing corrupt
|
||||
DWARF debug sections.
|
||||
|
||||
PR 26946
|
||||
* dwarf2.c (read_section): Check for debug sections with excessive
|
||||
sizes.
|
||||
|
||||
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
|
||||
index 977bf43a6a1..8bbfc81d3e7 100644
|
||||
--- a/bfd/dwarf2.c
|
||||
+++ b/bfd/dwarf2.c
|
||||
@@ -531,22 +531,24 @@ read_section (bfd * abfd,
|
||||
bfd_byte ** section_buffer,
|
||||
bfd_size_type * section_size)
|
||||
{
|
||||
- asection *msec;
|
||||
const char *section_name = sec->uncompressed_name;
|
||||
bfd_byte *contents = *section_buffer;
|
||||
- bfd_size_type amt;
|
||||
|
||||
/* The section may have already been read. */
|
||||
if (contents == NULL)
|
||||
{
|
||||
+ bfd_size_type amt;
|
||||
+ asection *msec;
|
||||
+ ufile_ptr filesize;
|
||||
+
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
- if (! msec)
|
||||
+ if (msec == NULL)
|
||||
{
|
||||
section_name = sec->compressed_name;
|
||||
if (section_name != NULL)
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
}
|
||||
- if (! msec)
|
||||
+ if (msec == NULL)
|
||||
{
|
||||
_bfd_error_handler (_("DWARF error: can't find %s section."),
|
||||
sec->uncompressed_name);
|
||||
@@ -554,12 +556,23 @@ read_section (bfd * abfd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- *section_size = msec->rawsize ? msec->rawsize : msec->size;
|
||||
+ amt = bfd_get_section_limit_octets (abfd, msec);
|
||||
+ filesize = bfd_get_file_size (abfd);
|
||||
+ if (amt >= filesize)
|
||||
+ {
|
||||
+ /* PR 26946 */
|
||||
+ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"),
|
||||
+ section_name, (long) amt, (long) filesize);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ *section_size = amt;
|
||||
/* Paranoia - alloc one extra so that we can make sure a string
|
||||
section is NUL terminated. */
|
||||
- amt = *section_size + 1;
|
||||
+ amt += 1;
|
||||
if (amt == 0)
|
||||
{
|
||||
+ /* Paranoia - this should never happen. */
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return FALSE;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 30 Oct 2020 16:59:48 -0600
|
||||
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
|
||||
libraries"
|
||||
|
||||
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
|
||||
---
|
||||
bfd/ChangeLog | 6 ------
|
||||
bfd/elf32-tic6x.c | 3 ---
|
||||
ld/ChangeLog | 6 ------
|
||||
ld/ldlang.c | 9 ++++-----
|
||||
4 files changed, 4 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
|
||||
index 9fac12538a..b5461494e8 100644
|
||||
--- a/bfd/ChangeLog
|
||||
+++ b/bfd/ChangeLog
|
||||
@@ -1422,12 +1422,6 @@
|
||||
accessing root.u.def of symbols. Also check root.u.def.section
|
||||
is non-NULL. Reverse tests so as to make the logic positive.
|
||||
|
||||
-2020-05-01 Alan Modra <amodra@gmail.com>
|
||||
-
|
||||
- PR 25882
|
||||
- * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
|
||||
- Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
|
||||
-
|
||||
2020-05-01 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 25882
|
||||
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
|
||||
index b8b916bfd3..91bb6a10b1 100644
|
||||
--- a/bfd/elf32-tic6x.c
|
||||
+++ b/bfd/elf32-tic6x.c
|
||||
@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|
||||
|
||||
case Tag_ABI_PIC:
|
||||
case Tag_ABI_PID:
|
||||
- /* Don't transfer these tags from dynamic objects. */
|
||||
- if ((ibfd->flags & DYNAMIC) != 0)
|
||||
- continue;
|
||||
if (out_attr[i].i > in_attr[i].i)
|
||||
out_attr[i].i = in_attr[i].i;
|
||||
break;
|
||||
diff --git a/ld/ChangeLog b/ld/ChangeLog
|
||||
index 4eec7d2977..b93452f70c 100644
|
||||
--- a/ld/ChangeLog
|
||||
+++ b/ld/ChangeLog
|
||||
@@ -1319,12 +1319,6 @@
|
||||
* testsuite/ld-aarch64/farcall-group.d: New test driver.
|
||||
* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
|
||||
|
||||
-2020-05-01 Alan Modra <amodra@gmail.com>
|
||||
-
|
||||
- PR 25882
|
||||
- * ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
|
||||
- shared libraries.
|
||||
-
|
||||
2020-05-01 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* po/BLD-POTFILES.in: Regenerate.
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 9977195074..173d8ec349 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -6972,12 +6972,11 @@ lang_check (void)
|
||||
bfd_printable_name (input_bfd), input_bfd,
|
||||
bfd_printable_name (link_info.output_bfd));
|
||||
}
|
||||
-
|
||||
- /* If the input bfd has no contents, it shouldn't set the
|
||||
- private data of the output bfd. */
|
||||
- else if ((input_bfd->flags & DYNAMIC) != 0
|
||||
- || bfd_count_sections (input_bfd) != 0)
|
||||
+ else if (bfd_count_sections (input_bfd))
|
||||
{
|
||||
+ /* If the input bfd has no contents, it shouldn't set the
|
||||
+ private data of the output bfd. */
|
||||
+
|
||||
bfd_error_handler_type pfn = NULL;
|
||||
|
||||
/* If we aren't supposed to warn about mismatched input
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armhf
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-armhf
|
||||
pkgver=2.35.1
|
||||
pkgrel=1
|
||||
pkgdesc="Tools necessary to build programs for armhf targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec armhf)"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
--with-lib-path=/usr/lib \
|
||||
--prefix=/usr \
|
||||
--with-sysroot=/usr/$_target \
|
||||
--enable-ld=default \
|
||||
--enable-gold=yes \
|
||||
--enable-plugins \
|
||||
--enable-deterministic-archives \
|
||||
--disable-multilib \
|
||||
--disable-werror \
|
||||
--disable-nls
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
rm -rf "$pkgdir"/usr/share
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb binutils-2.35.1.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch"
|
||||
@@ -1,46 +0,0 @@
|
||||
This fixes static linking for our hardened toolchain
|
||||
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
|
||||
index e8126cb..9532bfb 100644
|
||||
--- a/ld/scripttempl/elf.sc
|
||||
+++ b/ld/scripttempl/elf.sc
|
||||
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
|
||||
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
|
||||
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
else
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
|
||||
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
- KEEP (*crtbegin.o(.ctors))
|
||||
- KEEP (*crtbegin?.o(.ctors))
|
||||
+ KEEP (*crtbegin*.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
${CONSTRUCTING+${CTOR_END}}
|
||||
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
DTOR=".dtors ${CONSTRUCTING-0} :
|
||||
{
|
||||
${CONSTRUCTING+${DTOR_START}}
|
||||
- KEEP (*crtbegin.o(.dtors))
|
||||
- KEEP (*crtbegin?.o(.dtors))
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
+ KEEP (*crtbegin*.o(.dtors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
${CONSTRUCTING+${DTOR_END}}
|
||||
@@ -1,39 +0,0 @@
|
||||
# DP: Fix gold on mips64 targets.
|
||||
|
||||
gold/
|
||||
|
||||
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
|
||||
|
||||
|
||||
--- a/gold/configure.tgt
|
||||
+++ b/gold/configure.tgt
|
||||
@@ -153,6 +153,13 @@ aarch64*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*el*-*-*|mips*64*le*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS_RS3_LE
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=false
|
||||
+ targ_extra_big_endian=true
|
||||
+ ;;
|
||||
mips*el*-*-*|mips*le*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS_RS3_LE
|
||||
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=true
|
||||
+ targ_extra_big_endian=false
|
||||
+ ;;
|
||||
mips*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ./ld/configure.tgt.orig
|
||||
+++ ./ld/configure.tgt
|
||||
@@ -541,12 +541,12 @@
|
||||
;;
|
||||
mips*-*-windiss) targ_emul=elf32mipswindiss
|
||||
;;
|
||||
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
|
||||
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
|
||||
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
|
||||
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
|
||||
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
|
||||
+mips64*-*-linux-*) targ_emul=elf64btsmip
|
||||
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
mips*el-*-linux-*) targ_emul=elf32ltsmip
|
||||
@@ -3,7 +3,7 @@
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-armv7
|
||||
pkgver=2.35.1
|
||||
pkgver=2.35.2
|
||||
pkgrel=1
|
||||
pkgdesc="Tools necessary to build programs for armv7 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
@@ -15,6 +15,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2021-3487.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
@@ -25,6 +26,8 @@ if [ "$CHOST" != "$CTARGET" ]; then
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
@@ -60,8 +63,9 @@ package() {
|
||||
|
||||
|
||||
|
||||
sha512sums="94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb binutils-2.35.1.tar.xz
|
||||
sha512sums="9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch"
|
||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b08384ed124a74ad3a424db370c107230f09a54378502ca4385deb738f7cf799857f2af0db52709c7eeab8fa6c0a3d972f891396cce1e2834a21f67682fc4355 CVE-2021-3487.patch"
|
||||
@@ -0,0 +1,72 @@
|
||||
From 647cebce12a6b0a26960220caff96ff38978cf24 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 26 Nov 2020 17:08:33 +0000
|
||||
Subject: [PATCH] Prevent a memory allocation failure when parsing corrupt
|
||||
DWARF debug sections.
|
||||
|
||||
PR 26946
|
||||
* dwarf2.c (read_section): Check for debug sections with excessive
|
||||
sizes.
|
||||
|
||||
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
|
||||
index 977bf43a6a1..8bbfc81d3e7 100644
|
||||
--- a/bfd/dwarf2.c
|
||||
+++ b/bfd/dwarf2.c
|
||||
@@ -531,22 +531,24 @@ read_section (bfd * abfd,
|
||||
bfd_byte ** section_buffer,
|
||||
bfd_size_type * section_size)
|
||||
{
|
||||
- asection *msec;
|
||||
const char *section_name = sec->uncompressed_name;
|
||||
bfd_byte *contents = *section_buffer;
|
||||
- bfd_size_type amt;
|
||||
|
||||
/* The section may have already been read. */
|
||||
if (contents == NULL)
|
||||
{
|
||||
+ bfd_size_type amt;
|
||||
+ asection *msec;
|
||||
+ ufile_ptr filesize;
|
||||
+
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
- if (! msec)
|
||||
+ if (msec == NULL)
|
||||
{
|
||||
section_name = sec->compressed_name;
|
||||
if (section_name != NULL)
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
}
|
||||
- if (! msec)
|
||||
+ if (msec == NULL)
|
||||
{
|
||||
_bfd_error_handler (_("DWARF error: can't find %s section."),
|
||||
sec->uncompressed_name);
|
||||
@@ -554,12 +556,23 @@ read_section (bfd * abfd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- *section_size = msec->rawsize ? msec->rawsize : msec->size;
|
||||
+ amt = bfd_get_section_limit_octets (abfd, msec);
|
||||
+ filesize = bfd_get_file_size (abfd);
|
||||
+ if (amt >= filesize)
|
||||
+ {
|
||||
+ /* PR 26946 */
|
||||
+ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"),
|
||||
+ section_name, (long) amt, (long) filesize);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ *section_size = amt;
|
||||
/* Paranoia - alloc one extra so that we can make sure a string
|
||||
section is NUL terminated. */
|
||||
- amt = *section_size + 1;
|
||||
+ amt += 1;
|
||||
if (amt == 0)
|
||||
{
|
||||
+ /* Paranoia - this should never happen. */
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
return FALSE;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.33.0
|
||||
pkgrel=2
|
||||
pkgver=1.32.1
|
||||
pkgrel=6
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-2.alpinelinux.org/alpine/"
|
||||
@@ -21,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-v3.13.apk::$_mirror/v3.13/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.13.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="2d259d9bdc5c30f597af57743fb8d0da219f762fd107a62f3fc5bf06e0a38f9bf875ed0a4913bd26d3ba11bd73b0136d85e310b565e2219c303eb6bb0cca914d busybox-static-1.33.0-r2-aarch64-edge.apk"
|
||||
sha512sums="7210d077e5efc5970fb6520cdd676ec8e98f888ac89bc40ef81ef3828a5da556e74fd096345a6c0d0fa286bac8b5ea9b3aaad4417f81233acd8dddc673f30371 busybox-static-1.32.1-r6-aarch64-v3.13.apk"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-armhf
|
||||
|
||||
# Stub for apkbuild-lint
|
||||
if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
arch_to_hostspec() { :; }
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armhf
|
||||
pkgver=1.33.0
|
||||
pkgrel=2
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-2.alpinelinux.org/alpine/"
|
||||
|
||||
url="http://busybox.net"
|
||||
license="GPL2"
|
||||
arch="x86_64"
|
||||
options="!check !strip"
|
||||
pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="5c45b456dcdaf640f8cb46813289e06d99f0ebe5e8821709a6d7acc67f31033d26f7ffc5a6ec176393e102b31f3c4f84dfcc9fbb1bbb9d3032bdaf371e3bc190 busybox-static-1.33.0-r2-armhf-edge.apk"
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.33.0
|
||||
pkgrel=2
|
||||
pkgver=1.32.1
|
||||
pkgrel=6
|
||||
|
||||
_arch="armv7"
|
||||
_mirror="http://dl-2.alpinelinux.org/alpine/"
|
||||
@@ -21,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-v3.13.apk::$_mirror/v3.13/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.13.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="030f6349a03aee294ab743b4a09156b120f8c1ddc081042f3c43597b97da31cb7036ac43248cbe601212b5aa8229c4ec7017a68f6a7682e419e24ab2adc817c4 busybox-static-1.33.0-r2-armv7-edge.apk"
|
||||
sha512sums="2bc95e9b443f124835ff293e701d9e146aa3d074b28323cb0e8f03f7c5fc90c59796bcc69dbfdc430ed831cd5ca49393207ef41de1ff04fda3a3099603a5924c busybox-static-1.32.1-r6-armv7-v3.13.apk"
|
||||
@@ -1,42 +0,0 @@
|
||||
From 61621c64caffb54ea82c5b573e55d16dcb732dea Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Fri, 26 Jan 2018 20:32:50 +0000
|
||||
Subject: [PATCH] posix_memalign
|
||||
|
||||
---
|
||||
gcc/config/i386/pmm_malloc.h | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
|
||||
index 87344d9383f..ece428df487 100644
|
||||
--- a/gcc/config/i386/pmm_malloc.h
|
||||
+++ b/gcc/config/i386/pmm_malloc.h
|
||||
@@ -27,12 +27,13 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
|
||||
- may not be visible. */
|
||||
+ may not be visible and we can't pollute the namespace either. */
|
||||
#ifndef __cplusplus
|
||||
-extern int posix_memalign (void **, size_t, size_t);
|
||||
+extern int _mm_posix_memalign (void **, size_t, size_t)
|
||||
#else
|
||||
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
||||
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
|
||||
#endif
|
||||
+__asm__("posix_memalign");
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t __size, size_t __alignment)
|
||||
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
|
||||
return malloc (__size);
|
||||
if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
|
||||
__alignment = sizeof (void *);
|
||||
- if (posix_memalign (&__ptr, __alignment, __size) == 0)
|
||||
+ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
|
||||
return __ptr;
|
||||
else
|
||||
return NULL;
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
From b6af6fd400def85c7f6933a991c888df16f12533 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 29 Mar 2013 08:59:00 +0400
|
||||
Subject: [PATCH] gcc: poison-system-directories
|
||||
|
||||
Add /sw/include and /opt/include based on the original
|
||||
zecke-no-host-includes.patch patch. The original patch checked for
|
||||
/usr/include, /sw/include and /opt/include and then triggered a failure and
|
||||
aborted.
|
||||
|
||||
Instead, we add the two missing items to the current scan. If the user
|
||||
wants this to be a failure, they can add "-Werror=poison-system-directories".
|
||||
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
---
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/configure | 16 ++++++++++++++++
|
||||
gcc/configure.ac | 10 ++++++++++
|
||||
gcc/doc/invoke.texi | 9 +++++++++
|
||||
gcc/gcc.c | 2 ++
|
||||
gcc/incpath.c | 21 +++++++++++++++++++++
|
||||
7 files changed, 68 insertions(+)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index dfed6ec76ba..8bb65e0e1af 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -682,6 +682,10 @@ Wreturn-local-addr
|
||||
Common Var(warn_return_local_addr) Init(1) Warning
|
||||
Warn about returning a pointer/reference to a local or temporary variable.
|
||||
|
||||
+Wpoison-system-directories
|
||||
+Common Var(flag_poison_system_directories) Init(1) Warning
|
||||
+Warn for -I and -L options using system directories if cross compiling
|
||||
+
|
||||
Wshadow
|
||||
Common Var(warn_shadow) Warning
|
||||
Warn when one variable shadows another. Same as -Wshadow=global.
|
||||
diff --git a/gcc/config.in b/gcc/config.in
|
||||
index 364eba47737..9551c0dfdf9 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -224,6 +224,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to warn for use of native system header directories */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if you want all operations on RTL (the basic data structure of the
|
||||
optimizer and back end) to be checked for dynamic type safety at runtime.
|
||||
This is quite expensive. */
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index b4088d8fd1e..793530e21cf 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -1010,6 +1010,7 @@ with_system_zlib
|
||||
enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1766,6 +1767,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
+ --enable-poison-system-directories
|
||||
+ warn for use of native system header directories
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -30271,6 +30274,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-poison-system-directories was given.
|
||||
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||
+ enableval=$enable_poison_system_directories;
|
||||
+else
|
||||
+ enable_poison_system_directories=no
|
||||
+fi
|
||||
+
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 070b9c6c497..0fd438e39e5 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -6605,6 +6605,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
+AC_ARG_ENABLE([poison-system-directories],
|
||||
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||
+ [warn for use of native system header directories]),,
|
||||
+ [enable_poison_system_directories=no])
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||
+ [1],
|
||||
+ [Define to warn for use of native system header directories])
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 7775bcc72eb..034d3066c2b 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
|
||||
-Wparentheses -Wno-pedantic-ms-format @gol
|
||||
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
|
||||
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
|
||||
-Wno-scalar-storage-order -Wsequence-point @gol
|
||||
@@ -6926,6 +6927,14 @@ made up of data only and thus requires no special treatment. But, for
|
||||
most targets, it is made up of code and thus requires the stack to be
|
||||
made executable in order for the program to work properly.
|
||||
|
||||
+@item -Wno-poison-system-directories
|
||||
+@opindex Wno-poison-system-directories
|
||||
+Do not warn for @option{-I} or @option{-L} options using system
|
||||
+directories such as @file{/usr/include} when cross compiling. This
|
||||
+option is intended for use in chroot environments when such
|
||||
+directories contain the correct headers and libraries for the target
|
||||
+system rather than the host.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 9f790db0daf..b2200c5185a 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1041,6 +1041,8 @@ proper position among the other output files. */
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
|
||||
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
|
||||
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
|
||||
diff --git a/gcc/incpath.c b/gcc/incpath.c
|
||||
index 8a2bda00f80..9098ab044ab 100644
|
||||
--- a/gcc/incpath.c
|
||||
+++ b/gcc/incpath.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[INC_QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
|
||||
+ || (!strncmp (p->name, "/sw/include", 11))
|
||||
+ || (!strncmp (p->name, "/opt/include", 12)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
From 8e8955cbd60155d131d3ac66cb2a1e7e41835278 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
||||
Subject: [PATCH] Turn on -Wl,-z,relro,-z,now by default.
|
||||
|
||||
---
|
||||
gcc/doc/invoke.texi | 3 +++
|
||||
gcc/gcc.c | 1 +
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 034d3066c2b..4885efe3247 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -14663,6 +14663,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
||||
linker. When using the GNU linker, you can also get the same effect with
|
||||
@option{-Wl,-Map=output.map}.
|
||||
|
||||
+NOTE: In Alpine Linux, for LDFLAGS, the option
|
||||
+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
|
||||
+
|
||||
@item -u @var{symbol}
|
||||
@opindex u
|
||||
Pretend the symbol @var{symbol} is undefined, to force linking of
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index b2200c5185a..625c9ab7902 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1039,6 +1039,7 @@ proper position among the other output files. */
|
||||
"%{flto|flto=*:%<fcompare-debug*} \
|
||||
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
+ "-z relro -z now " \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
%{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From c5924988157b27b60c28d20d971179bbacbd2ae3 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:46:22 +0000
|
||||
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
|
||||
ObjC++, if the optimization level is > 0
|
||||
|
||||
---
|
||||
gcc/c-family/c-cppbuiltin.c | 4 ++++
|
||||
gcc/doc/invoke.texi | 6 ++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
|
||||
index db91a36794a..ed976c71404 100644
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -1385,6 +1385,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
+ /* Fortify Source enabled by default for optimization levels > 0 */
|
||||
+ if (optimize)
|
||||
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
|
||||
+
|
||||
/* Misc. */
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 4885efe3247..a3e5e002fa5 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -9230,6 +9230,12 @@ also turns on the following optimization flags:
|
||||
Please note the warning under @option{-fgcse} about
|
||||
invoking @option{-O2} on programs that use computed gotos.
|
||||
|
||||
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
|
||||
+set by default, and is activated when @option{-O} is set to 2 or higher.
|
||||
+This enables additional compile-time and run-time checks for several libc
|
||||
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
|
||||
+@option{-D_FORTIFY_SOURCE=0}.
|
||||
+
|
||||
@item -O3
|
||||
@opindex O3
|
||||
Optimize yet more. @option{-O3} turns on all optimizations specified
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,269 +0,0 @@
|
||||
From 5b8de466aa959a6c929cee2c78e4159a0209b4f8 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:46:56 +0000
|
||||
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
|
||||
but always link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
---
|
||||
gcc/config/aarch64/aarch64-linux.h | 1 +
|
||||
gcc/config/alpha/linux-elf.h | 2 +-
|
||||
gcc/config/arm/linux-elf.h | 1 +
|
||||
gcc/config/gnu-user.h | 6 +++---
|
||||
gcc/config/i386/gnu-user.h | 2 +-
|
||||
gcc/config/i386/gnu-user64.h | 1 +
|
||||
gcc/config/ia64/linux.h | 2 +-
|
||||
gcc/config/mips/gnu-user.h | 1 +
|
||||
gcc/config/riscv/linux.h | 1 +
|
||||
gcc/config/rs6000/linux64.h | 4 ++--
|
||||
gcc/config/rs6000/sysv4.h | 2 +-
|
||||
gcc/config/s390/linux.h | 2 +-
|
||||
gcc/config/sparc/linux.h | 2 +-
|
||||
gcc/gcc.c | 28 ++++++++++++++++++++--------
|
||||
14 files changed, 36 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
|
||||
index e587e2e9ad6..1d1017aa523 100644
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
||||
+ --as-needed \
|
||||
%{static:-Bstatic} \
|
||||
%{shared:-shared} \
|
||||
%{symbolic:-Bsymbolic} \
|
||||
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
|
||||
index e25fcac3c59..22b2f7b0d14 100644
|
||||
--- a/gcc/config/alpha/linux-elf.h
|
||||
+++ b/gcc/config/alpha/linux-elf.h
|
||||
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
|
||||
|
||||
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
|
||||
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
|
||||
%{O*:-O3} %{!O*:-O1} \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
|
||||
index 0ec3aa53189..f8bda84de2a 100644
|
||||
--- a/gcc/config/arm/linux-elf.h
|
||||
+++ b/gcc/config/arm/linux-elf.h
|
||||
@@ -70,6 +70,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
|
||||
-X \
|
||||
+ --as-needed \
|
||||
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index ff2e880b1fa..7f30c363e4a 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -136,17 +136,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
|
||||
"%{static-libasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
|
||||
"%{static-libtsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
|
||||
"%{static-liblsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#endif
|
||||
|
||||
#undef TARGET_F951_OPTIONS
|
||||
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
|
||||
index ae4aa844f02..54b91c0492a 100644
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
{ "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
|
||||
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
|
||||
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{!static-pie: \
|
||||
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
|
||||
index 785c68220b8..21dd66b412a 100644
|
||||
--- a/gcc/config/i386/gnu-user64.h
|
||||
+++ b/gcc/config/i386/gnu-user64.h
|
||||
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
|
||||
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
|
||||
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
|
||||
+ --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
|
||||
index ee38e218aec..0325971d818 100644
|
||||
--- a/gcc/config/ia64/linux.h
|
||||
+++ b/gcc/config/ia64/linux.h
|
||||
@@ -58,7 +58,7 @@ do { \
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "\
|
||||
+#define LINK_SPEC " --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
|
||||
index 5d0782100bb..4be5fbb2191 100644
|
||||
--- a/gcc/config/mips/gnu-user.h
|
||||
+++ b/gcc/config/mips/gnu-user.h
|
||||
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#undef GNU_USER_TARGET_LINK_SPEC
|
||||
#define GNU_USER_TARGET_LINK_SPEC "\
|
||||
%{G*} %{EB} %{EL} %{mips*} %{shared} \
|
||||
+ -as-needed \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
|
||||
index 4afef7c228c..ba1a6e60e05 100644
|
||||
--- a/gcc/config/riscv/linux.h
|
||||
+++ b/gcc/config/riscv/linux.h
|
||||
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
"%{mabi=ilp32:_ilp32}"
|
||||
|
||||
#define LINK_SPEC "\
|
||||
+-as-needed \
|
||||
-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
|
||||
%{mno-relax:--no-relax} \
|
||||
%{shared} \
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index 2ded3301282..a1e44ddcc0d 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -457,13 +457,13 @@ extern int dot_symbols;
|
||||
" -m elf64ppc")
|
||||
#endif
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
|
||||
%{!static-pie: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
|
||||
%(link_os_extra_spec32)"
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
|
||||
%{!static-pie: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
|
||||
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
|
||||
index 9ade72114e9..9490b84a153 100644
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
|
||||
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
#endif
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
|
||||
|
||||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 6919b468f06..56d52d41b31 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
||||
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
|
||||
index 63853e60c03..de6d8675456 100644
|
||||
--- a/gcc/config/sparc/linux.h
|
||||
+++ b/gcc/config/sparc/linux.h
|
||||
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
|
||||
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
|
||||
%{!mno-relax:%{!r:-relax}} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 625c9ab7902..7aec9d3a016 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -695,8 +695,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBASAN_EARLY_SPEC
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
|
||||
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -lasan " \
|
||||
+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -713,8 +716,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
|
||||
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -ltsan " \
|
||||
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -731,8 +737,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
|
||||
- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -llsan " \
|
||||
+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -747,8 +756,11 @@ proper position among the other output files. */
|
||||
#define STATIC_LIBUBSAN_LIBS \
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
|
||||
- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -lubsan " \
|
||||
+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
From 7c79655102e756622211ca40384e8562be334973 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:47:43 +0000
|
||||
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
|
||||
|
||||
---
|
||||
gcc/c-family/c.opt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
|
||||
index c49da99d395..93f25319005 100644
|
||||
--- a/gcc/c-family/c.opt
|
||||
+++ b/gcc/c-family/c.opt
|
||||
@@ -599,7 +599,7 @@ Warn about function calls with format strings that write past the end
|
||||
of the destination region. Same as -Wformat-overflow=1.
|
||||
|
||||
Wformat-security
|
||||
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
Warn about possible security problems with format functions.
|
||||
|
||||
Wformat-signedness
|
||||
@@ -620,7 +620,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
|
||||
Warn about zero-length formats.
|
||||
|
||||
Wformat=
|
||||
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
|
||||
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
|
||||
Warn about printf/scanf/strftime/strfmon format string anomalies.
|
||||
|
||||
Wformat-overflow=
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 25eb9009f180c799647cfc81d27d8b67ba3f3b72 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:48:24 +0000
|
||||
Subject: [PATCH] Enable -Wtrampolines by default.
|
||||
|
||||
---
|
||||
gcc/common.opt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 8bb65e0e1af..ace932b300d 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers.
|
||||
|
||||
Wtrampolines
|
||||
-Common Var(warn_trampolines) Warning
|
||||
+Common Var(warn_trampolines) Init(1) Warning
|
||||
Warn whenever a trampoline is generated.
|
||||
|
||||
Wtype-limits
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From cfa0c7a3154415fe0e0ab6bd373a8f2164024ff5 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:49:40 +0000
|
||||
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
|
||||
Change the buffer size.
|
||||
|
||||
---
|
||||
gcc/gcc.c | 8 +++++++-
|
||||
gcc/params.opt | 2 +-
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 7aec9d3a016..daeb4d0c8ea 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -886,6 +886,12 @@ proper position among the other output files. */
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
|
||||
#endif
|
||||
|
||||
+#ifdef ENABLE_DEFAULT_SSP
|
||||
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
|
||||
+#else
|
||||
+#define NO_SSP_SPEC ""
|
||||
+#endif
|
||||
+
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
@@ -1170,7 +1176,7 @@ static const char *cc1_options =
|
||||
%{-version:--version}\
|
||||
%{-help=*:--help=%*}\
|
||||
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
|
||||
- %{fsyntax-only:-o %j} %{-param*}\
|
||||
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
|
||||
%{coverage:-fprofile-arcs -ftest-coverage}\
|
||||
%{fprofile-arcs|fprofile-generate*|coverage:\
|
||||
%{!fprofile-update=single:\
|
||||
diff --git a/gcc/params.opt b/gcc/params.opt
|
||||
index 4aec480798b..eaecfab37ad 100644
|
||||
--- a/gcc/params.opt
|
||||
+++ b/gcc/params.opt
|
||||
@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
|
||||
The maximum number of SSA_NAME assignments to follow in determining a value.
|
||||
|
||||
-param=ssp-buffer-size=
|
||||
-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
|
||||
+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
|
||||
The lower bound for a buffer to be considered for stack smashing protection.
|
||||
|
||||
-param=stack-clash-protection-guard-size=
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From 4733bb8115411c50028f7a583783ac10c63e8536 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:50:33 +0000
|
||||
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
|
||||
bootstrapping.
|
||||
|
||||
Solves error messages like the following:
|
||||
|
||||
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
|
||||
|
||||
The libgcc_s.so used during build doesn't satisfy the needs of the
|
||||
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
|
||||
is used as a stand-alone application here, and what library it uses
|
||||
behind the scenes is of no concern to the gcc build process.
|
||||
Therefore, simply invoking it "as usual", i.e. without any special
|
||||
library path, will make it work as expected here.
|
||||
|
||||
2011-09-19 Martin von Gagern
|
||||
|
||||
References:
|
||||
https://bugs.gentoo.org/372377
|
||||
https://bugs.gentoo.org/295480
|
||||
---
|
||||
libstdc++-v3/po/Makefile.am | 1 +
|
||||
libstdc++-v3/po/Makefile.in | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
|
||||
index a9391d8d167..f7eee24dc8c 100644
|
||||
--- a/libstdc++-v3/po/Makefile.am
|
||||
+++ b/libstdc++-v3/po/Makefile.am
|
||||
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
|
||||
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
|
||||
index a0f84b0cfa0..ab24a47a2fd 100644
|
||||
--- a/libstdc++-v3/po/Makefile.in
|
||||
+++ b/libstdc++-v3/po/Makefile.in
|
||||
@@ -548,6 +548,7 @@ uninstall-am:
|
||||
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 7d4ee7a90b87edd33a7f628ff89ce1b1e0576b4d Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:52:07 +0000
|
||||
Subject: [PATCH] Don't declare asprintf if defined as a macro.
|
||||
|
||||
---
|
||||
include/libiberty.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/include/libiberty.h b/include/libiberty.h
|
||||
index 141cb886a85..fa0e78eb62f 100644
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -645,8 +645,11 @@ extern int pwait (int, int *, int);
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/* Like asprintf but allocates memory without fail. This works like
|
||||
xmalloc. */
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From 84b959624e1371f1d02630b6e067f00f46dbe516 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:53:00 +0000
|
||||
Subject: [PATCH] libiberty: copy PIC objects during build process
|
||||
|
||||
---
|
||||
libiberty/Makefile.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
|
||||
index d6b302e02fd..fd39928546f 100644
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -263,6 +263,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 8ffd575380bc28aaf3c210ad838b205ce2403124 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:53:36 +0000
|
||||
Subject: [PATCH] libitm: disable FORTIFY
|
||||
|
||||
---
|
||||
libitm/configure.tgt | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
|
||||
index 04109160e91..107b957ece3 100644
|
||||
--- a/libitm/configure.tgt
|
||||
+++ b/libitm/configure.tgt
|
||||
@@ -46,6 +46,16 @@ if test "$gcc_cv_have_tls" = yes ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
+# FIXME: error: inlining failed in call to always_inline
|
||||
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’
|
||||
+# : function body can be overwritten at link time
|
||||
+# Disable Fortify in libitm for now. #508852
|
||||
+case "${target}" in
|
||||
+ *-*-linux*)
|
||||
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
# Map the target cpu to an ARCH sub-directory. At the same time,
|
||||
# work out any special compilation flags as necessary.
|
||||
case "${target_cpu}" in
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
From 0d83ea67b2e16658a88068ebce0e25cce22fe75e Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 24 Oct 2015 20:09:53 +0000
|
||||
Subject: [PATCH] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386-expand.c | 4 ++--
|
||||
libgcc/config/i386/cpuinfo.c | 6 +++---
|
||||
libgcc/config/i386/t-linux | 2 +-
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
|
||||
index c6033688f51..a60e5162995 100644
|
||||
--- a/gcc/config/i386/i386-expand.c
|
||||
+++ b/gcc/config/i386/i386-expand.c
|
||||
@@ -10966,10 +10966,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
- /* Make it call __cpu_indicator_init in libgcc. */
|
||||
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
|
||||
tree call_expr, fndecl, type;
|
||||
type = build_function_type_list (integer_type_node, NULL_TREE);
|
||||
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
|
||||
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
|
||||
call_expr = build_call_expr (fndecl, 0);
|
||||
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
|
||||
}
|
||||
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
|
||||
index cf5f0884bb4..ed0381e7744 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -510,7 +510,7 @@ __cpu_indicator_init (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if defined SHARED && defined USE_ELF_SYMVER
|
||||
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
|
||||
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
|
||||
+#ifndef SHARED
|
||||
+int __cpu_indicator_init_local (void)
|
||||
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
|
||||
#endif
|
||||
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
|
||||
index 8506a635790..564296f788e 100644
|
||||
--- a/libgcc/config/i386/t-linux
|
||||
+++ b/libgcc/config/i386/t-linux
|
||||
@@ -3,5 +3,5 @@
|
||||
# t-slibgcc-elf-ver and t-linux
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
|
||||
|
||||
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
|
||||
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
|
||||
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
From 99ccc2d68049c56519d49e21b6f13cf8d98ea163 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 7 Nov 2015 02:08:05 +0000
|
||||
Subject: [PATCH] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
gcc/configure.ac | 13 +++++++++++++
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 793530e21cf..2d874d3defe 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -30779,6 +30779,33 @@ fi
|
||||
$as_echo "$gcc_cv_no_pie" >&6; }
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
|
||||
+$as_echo_n "checking for -nopie option... " >&6; }
|
||||
+if test "${gcc_cv_nopie+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+int main(void) {return 0;}
|
||||
+_ACEOF
|
||||
+if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
+ gcc_cv_nopie=yes
|
||||
+else
|
||||
+ gcc_cv_nopie=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+ LDFLAGS="$saved_LDFLAGS"
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
|
||||
+$as_echo "$gcc_cv_nopie" >&6; }
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 0fd438e39e5..0b257e687ee 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -6863,6 +6863,19 @@ AC_CACHE_CHECK([for -no-pie option],
|
||||
LDFLAGS="$saved_LDFLAGS"])
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ AC_CACHE_CHECK([for -nopie option],
|
||||
+ [gcc_cv_nopie],
|
||||
+ [saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ AC_LINK_IFELSE([int main(void) {return 0;}],
|
||||
+ [gcc_cv_nopie=yes],
|
||||
+ [gcc_cv_nopie=no])
|
||||
+ LDFLAGS="$saved_LDFLAGS"])
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
AC_SUBST([NO_PIE_FLAG])
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From a5a7decc1944cf6831eebc10d71a52ef8496bff5 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:57:09 +0000
|
||||
Subject: [PATCH] libffi: use __linux__ instead of __gnu_linux__ for musl
|
||||
|
||||
---
|
||||
libffi/src/closures.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
|
||||
index 721ff00ea43..22a699c6340 100644
|
||||
--- a/libffi/src/closures.c
|
||||
+++ b/libffi/src/closures.c
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <ffi_common.h>
|
||||
|
||||
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
|
||||
-# if __gnu_linux__ && !defined(__ANDROID__)
|
||||
+# if __linux__ && !defined(__ANDROID__)
|
||||
/* This macro indicates it may be forbidden to map anonymous memory
|
||||
with both write and execute permission. Code compiled when this
|
||||
option is defined will attempt to map such pages once, but if it
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,425 +0,0 @@
|
||||
From 3554a4b751acce2a4f432d1bb24d9fc69a916889 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:57:51 +0000
|
||||
Subject: [PATCH] dlang: update zlib binding
|
||||
|
||||
---
|
||||
libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 196 insertions(+), 70 deletions(-)
|
||||
|
||||
diff --git a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
|
||||
index e6cce240fd5..bd2fe37ebec 100644
|
||||
--- a/libphobos/src/std/zlib.d
|
||||
+++ b/libphobos/src/std/zlib.d
|
||||
@@ -1,7 +1,7 @@
|
||||
// Written in the D programming language.
|
||||
|
||||
/**
|
||||
- * Compress/decompress data using the $(HTTP www._zlib.net, _zlib library).
|
||||
+ * Compress/decompress data using the $(HTTP www.zlib.net, zlib library).
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
@@ -43,12 +43,12 @@
|
||||
* References:
|
||||
* $(HTTP en.wikipedia.org/wiki/Zlib, Wikipedia)
|
||||
*
|
||||
- * Copyright: Copyright Digital Mars 2000 - 2011.
|
||||
+ * Copyright: Copyright The D Language Foundation 2000 - 2011.
|
||||
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
|
||||
* Authors: $(HTTP digitalmars.com, Walter Bright)
|
||||
- * Source: $(PHOBOSSRC std/_zlib.d)
|
||||
+ * Source: $(PHOBOSSRC std/zlib.d)
|
||||
*/
|
||||
-/* Copyright Digital Mars 2000 - 2011.
|
||||
+/* Copyright The D Language Foundation 2000 - 2011.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -75,9 +75,9 @@ enum
|
||||
|
||||
class ZlibException : Exception
|
||||
{
|
||||
- this(int errnum)
|
||||
- { string msg;
|
||||
-
|
||||
+ private static string getmsg(int errnum) nothrow @nogc pure @safe
|
||||
+ {
|
||||
+ string msg;
|
||||
switch (errnum)
|
||||
{
|
||||
case Z_STREAM_END: msg = "stream end"; break;
|
||||
@@ -90,7 +90,12 @@ class ZlibException : Exception
|
||||
case Z_VERSION_ERROR: msg = "version error"; break;
|
||||
default: msg = "unknown error"; break;
|
||||
}
|
||||
- super(msg);
|
||||
+ return msg;
|
||||
+ }
|
||||
+
|
||||
+ this(int errnum)
|
||||
+ {
|
||||
+ super(getmsg(errnum));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +109,7 @@ class ZlibException : Exception
|
||||
* buf = buffer containing input data
|
||||
*
|
||||
* Returns:
|
||||
- * A $(D uint) checksum for the provided input data and starting checksum
|
||||
+ * A `uint` checksum for the provided input data and starting checksum
|
||||
*
|
||||
* See_Also:
|
||||
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
|
||||
@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] buf)
|
||||
* buf = buffer containing input data
|
||||
*
|
||||
* Returns:
|
||||
- * A $(D uint) checksum for the provided input data and starting checksum
|
||||
+ * A `uint` checksum for the provided input data and starting checksum
|
||||
*
|
||||
* See_Also:
|
||||
* $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check)
|
||||
@@ -191,13 +196,14 @@ uint crc32(uint crc, const(void)[] buf)
|
||||
ubyte[] compress(const(void)[] srcbuf, int level)
|
||||
in
|
||||
{
|
||||
- assert(-1 <= level && level <= 9);
|
||||
+ assert(-1 <= level && level <= 9, "Compression level needs to be within [-1, 9].");
|
||||
}
|
||||
-body
|
||||
+do
|
||||
{
|
||||
import core.memory : GC;
|
||||
+ import std.array : uninitializedArray;
|
||||
auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12;
|
||||
- auto destbuf = new ubyte[destlen];
|
||||
+ auto destbuf = uninitializedArray!(ubyte[])(destlen);
|
||||
auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *) srcbuf.ptr, srcbuf.length, level);
|
||||
if (err)
|
||||
{
|
||||
@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf, size_t destlen = 0u, int winbits = 15)
|
||||
throw new ZlibException(err);
|
||||
}
|
||||
}
|
||||
- assert(0);
|
||||
+ assert(0, "Unreachable code");
|
||||
}
|
||||
|
||||
@system unittest
|
||||
@@ -370,9 +376,9 @@ class Compress
|
||||
this(int level, HeaderFormat header = HeaderFormat.deflate)
|
||||
in
|
||||
{
|
||||
- assert(1 <= level && level <= 9);
|
||||
+ assert(1 <= level && level <= 9, "Legal compression level are in [1, 9].");
|
||||
}
|
||||
- body
|
||||
+ do
|
||||
{
|
||||
this.level = level;
|
||||
this.gzip = header == HeaderFormat.gzip;
|
||||
@@ -406,6 +412,7 @@ class Compress
|
||||
const(void)[] compress(const(void)[] buf)
|
||||
{
|
||||
import core.memory : GC;
|
||||
+ import std.array : uninitializedArray;
|
||||
int err;
|
||||
ubyte[] destbuf;
|
||||
|
||||
@@ -420,7 +427,7 @@ class Compress
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
- destbuf = new ubyte[zs.avail_in + buf.length];
|
||||
+ destbuf = uninitializedArray!(ubyte[])(zs.avail_in + buf.length);
|
||||
zs.next_out = destbuf.ptr;
|
||||
zs.avail_out = to!uint(destbuf.length);
|
||||
|
||||
@@ -461,9 +468,10 @@ class Compress
|
||||
void[] flush(int mode = Z_FINISH)
|
||||
in
|
||||
{
|
||||
- assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH);
|
||||
+ assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH,
|
||||
+ "Mode must be either Z_FINISH, Z_SYNC_FLUSH or Z_FULL_FLUSH.");
|
||||
}
|
||||
- body
|
||||
+ do
|
||||
{
|
||||
import core.memory : GC;
|
||||
ubyte[] destbuf;
|
||||
@@ -523,6 +531,7 @@ class UnCompress
|
||||
z_stream zs;
|
||||
int inited;
|
||||
int done;
|
||||
+ bool inputEnded;
|
||||
size_t destbufsize;
|
||||
|
||||
HeaderFormat format;
|
||||
@@ -571,16 +580,16 @@ class UnCompress
|
||||
const(void)[] uncompress(const(void)[] buf)
|
||||
in
|
||||
{
|
||||
- assert(!done);
|
||||
+ assert(!done, "Buffer has been flushed.");
|
||||
}
|
||||
- body
|
||||
+ do
|
||||
{
|
||||
+ if (inputEnded || !buf.length)
|
||||
+ return null;
|
||||
+
|
||||
import core.memory : GC;
|
||||
+ import std.array : uninitializedArray;
|
||||
int err;
|
||||
- ubyte[] destbuf;
|
||||
-
|
||||
- if (buf.length == 0)
|
||||
- return null;
|
||||
|
||||
if (!inited)
|
||||
{
|
||||
@@ -598,26 +607,152 @@ class UnCompress
|
||||
|
||||
if (!destbufsize)
|
||||
destbufsize = to!uint(buf.length) * 2;
|
||||
- destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
|
||||
- zs.next_out = destbuf.ptr;
|
||||
- zs.avail_out = to!uint(destbuf.length);
|
||||
-
|
||||
- if (zs.avail_in)
|
||||
- buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
|
||||
+ auto destbuf = uninitializedArray!(ubyte[])(destbufsize);
|
||||
+ size_t destFill;
|
||||
|
||||
zs.next_in = cast(ubyte*) buf.ptr;
|
||||
zs.avail_in = to!uint(buf.length);
|
||||
|
||||
- err = inflate(&zs, Z_NO_FLUSH);
|
||||
- if (err != Z_STREAM_END && err != Z_OK)
|
||||
+ while (true)
|
||||
{
|
||||
- GC.free(destbuf.ptr);
|
||||
- error(err);
|
||||
+ auto oldAvailIn = zs.avail_in;
|
||||
+
|
||||
+ zs.next_out = destbuf[destFill .. $].ptr;
|
||||
+ zs.avail_out = to!uint(destbuf.length - destFill);
|
||||
+
|
||||
+ err = inflate(&zs, Z_NO_FLUSH);
|
||||
+ if (err == Z_STREAM_END)
|
||||
+ {
|
||||
+ inputEnded = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ else if (err != Z_OK)
|
||||
+ {
|
||||
+ GC.free(destbuf.ptr);
|
||||
+ error(err);
|
||||
+ }
|
||||
+ else if (!zs.avail_in)
|
||||
+ break;
|
||||
+
|
||||
+ /*
|
||||
+ According to the zlib manual inflate() stops when either there's
|
||||
+ no more data to uncompress or the output buffer is full
|
||||
+ So at this point, the output buffer is too full
|
||||
+ */
|
||||
+
|
||||
+ destFill = destbuf.length;
|
||||
+
|
||||
+ if (destbuf.capacity)
|
||||
+ {
|
||||
+ if (destbuf.length < destbuf.capacity)
|
||||
+ destbuf.length = destbuf.capacity;
|
||||
+ else
|
||||
+ {
|
||||
+ auto newLength = GC.extend(destbuf.ptr, destbufsize, destbufsize);
|
||||
+
|
||||
+ if (newLength && destbuf.length < destbuf.capacity)
|
||||
+ destbuf.length = destbuf.capacity;
|
||||
+ else
|
||||
+ destbuf.length += destbufsize;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ destbuf.length += destbufsize;
|
||||
}
|
||||
+
|
||||
destbuf.length = destbuf.length - zs.avail_out;
|
||||
return destbuf;
|
||||
}
|
||||
|
||||
+ // Test for issues 3191 and 9505
|
||||
+ @system unittest
|
||||
+ {
|
||||
+ import std.algorithm.comparison;
|
||||
+ import std.array;
|
||||
+ import std.file;
|
||||
+ import std.zlib;
|
||||
+
|
||||
+ // Data that can be easily compressed
|
||||
+ ubyte[1024] originalData;
|
||||
+
|
||||
+ // This should yield a compression ratio of at least 1/2
|
||||
+ auto compressedData = compress(originalData, 9);
|
||||
+ assert(compressedData.length < originalData.length / 2,
|
||||
+ "The compression ratio is too low to accurately test this situation");
|
||||
+
|
||||
+ auto chunkSize = compressedData.length / 4;
|
||||
+ assert(chunkSize < compressedData.length,
|
||||
+ "The length of the compressed data is too small to accurately test this situation");
|
||||
+
|
||||
+ auto decompressor = new UnCompress();
|
||||
+ ubyte[originalData.length] uncompressedData;
|
||||
+ ubyte[] reusedBuf;
|
||||
+ int progress;
|
||||
+
|
||||
+ reusedBuf.length = chunkSize;
|
||||
+
|
||||
+ for (int i = 0; i < compressedData.length; i += chunkSize)
|
||||
+ {
|
||||
+ auto len = min(chunkSize, compressedData.length - i);
|
||||
+ // simulate reading from a stream in small chunks
|
||||
+ reusedBuf[0 .. len] = compressedData[i .. i + len];
|
||||
+
|
||||
+ // decompress using same input buffer
|
||||
+ auto chunk = decompressor.uncompress(reusedBuf);
|
||||
+ assert(progress + chunk.length <= originalData.length,
|
||||
+ "The uncompressed result is bigger than the original data");
|
||||
+
|
||||
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
|
||||
+ progress += chunk.length;
|
||||
+ }
|
||||
+
|
||||
+ auto chunk = decompressor.flush();
|
||||
+ assert(progress + chunk.length <= originalData.length,
|
||||
+ "The uncompressed result is bigger than the original data");
|
||||
+
|
||||
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
|
||||
+ progress += chunk.length;
|
||||
+
|
||||
+ assert(progress == originalData.length,
|
||||
+ "The uncompressed and the original data sizes differ");
|
||||
+ assert(originalData[] == uncompressedData[],
|
||||
+ "The uncompressed and the original data differ");
|
||||
+ }
|
||||
+
|
||||
+ @system unittest
|
||||
+ {
|
||||
+ ubyte[1024] invalidData;
|
||||
+ auto decompressor = new UnCompress();
|
||||
+
|
||||
+ try
|
||||
+ {
|
||||
+ auto uncompressedData = decompressor.uncompress(invalidData);
|
||||
+ }
|
||||
+ catch (ZlibException e)
|
||||
+ {
|
||||
+ assert(e.msg == "data error");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ assert(false, "Corrupted data didn't result in an error");
|
||||
+ }
|
||||
+
|
||||
+ @system unittest
|
||||
+ {
|
||||
+ ubyte[2014] originalData = void;
|
||||
+ auto compressedData = compress(originalData, 9);
|
||||
+
|
||||
+ auto decompressor = new UnCompress();
|
||||
+ auto uncompressedData = decompressor.uncompress(compressedData ~ cast(ubyte[]) "whatever");
|
||||
+
|
||||
+ assert(originalData.length == uncompressedData.length,
|
||||
+ "The uncompressed and the original data sizes differ");
|
||||
+ assert(originalData[] == uncompressedData[],
|
||||
+ "The uncompressed and the original data differ");
|
||||
+ assert(!decompressor.uncompress("whatever").length,
|
||||
+ "Compression continued after the end");
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Decompress and return any remaining data.
|
||||
* The returned data should be appended to that returned by uncompress().
|
||||
@@ -626,49 +761,40 @@ class UnCompress
|
||||
void[] flush()
|
||||
in
|
||||
{
|
||||
- assert(!done);
|
||||
+ assert(!done, "Buffer has been flushed before.");
|
||||
}
|
||||
out
|
||||
{
|
||||
- assert(done);
|
||||
+ assert(done, "Flushing failed.");
|
||||
}
|
||||
- body
|
||||
+ do
|
||||
{
|
||||
- import core.memory : GC;
|
||||
- ubyte[] extra;
|
||||
- ubyte[] destbuf;
|
||||
- int err;
|
||||
-
|
||||
done = 1;
|
||||
- if (!inited)
|
||||
- return null;
|
||||
+ return null;
|
||||
+ }
|
||||
|
||||
- L1:
|
||||
- destbuf = new ubyte[zs.avail_in * 2 + 100];
|
||||
- zs.next_out = destbuf.ptr;
|
||||
- zs.avail_out = to!uint(destbuf.length);
|
||||
+ /// Returns true if all input data has been decompressed and no further data
|
||||
+ /// can be decompressed (inflate() returned Z_STREAM_END)
|
||||
+ @property bool empty() const
|
||||
+ {
|
||||
+ return inputEnded;
|
||||
+ }
|
||||
|
||||
- err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
|
||||
- if (err == Z_OK && zs.avail_out == 0)
|
||||
- {
|
||||
- extra ~= destbuf;
|
||||
- goto L1;
|
||||
- }
|
||||
- if (err != Z_STREAM_END)
|
||||
- {
|
||||
- GC.free(destbuf.ptr);
|
||||
- if (err == Z_OK)
|
||||
- err = Z_BUF_ERROR;
|
||||
- error(err);
|
||||
- }
|
||||
- destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr];
|
||||
- err = etc.c.zlib.inflateEnd(&zs);
|
||||
- inited = 0;
|
||||
- if (err)
|
||||
- error(err);
|
||||
- if (extra.length)
|
||||
- destbuf = extra ~ destbuf;
|
||||
- return destbuf;
|
||||
+ ///
|
||||
+ @system unittest
|
||||
+ {
|
||||
+ // some random data
|
||||
+ ubyte[1024] originalData = void;
|
||||
+
|
||||
+ // append garbage data (or don't, this works in both cases)
|
||||
+ auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever";
|
||||
+
|
||||
+ auto decompressor = new UnCompress();
|
||||
+ auto uncompressedData = decompressor.uncompress(compressedData);
|
||||
+
|
||||
+ assert(uncompressedData[] == originalData[],
|
||||
+ "The uncompressed and the original data differ");
|
||||
+ assert(decompressor.empty, "The UnCompressor reports not being done");
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From abf18c3f7d908f8f4a365bd4d8f9a4743f1d8f0c Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:58:22 +0000
|
||||
Subject: [PATCH] dlang: fix fcntl on mips, add libucontext dep
|
||||
|
||||
---
|
||||
libphobos/configure.tgt | 1 +
|
||||
libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
|
||||
index 94e42bf5509..73f2e4b7f01 100644
|
||||
--- a/libphobos/configure.tgt
|
||||
+++ b/libphobos/configure.tgt
|
||||
@@ -35,6 +35,7 @@ case "${target}" in
|
||||
;;
|
||||
mips*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
|
||||
;;
|
||||
power*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
index 9febcff849b..cb34e2108bd 100644
|
||||
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
@@ -870,6 +870,21 @@ else version (CRuntime_Musl)
|
||||
F_SETLKW = 7,
|
||||
}
|
||||
}
|
||||
+ else version (MIPS_Any)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x010000, // octal 0200000
|
||||
+ O_NOFOLLOW = 0x020000, // octal 0400000
|
||||
+ O_DIRECT = 0x008000, // octal 0100000
|
||||
+ O_LARGEFILE = 0x002000, // octal 0020000
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 33,
|
||||
+ F_SETLK = 34,
|
||||
+ F_SETLKW = 35,
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
static assert(0, "Platform not supported");
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
From 277c3317929f41e514632d29ff00354c511deb0e Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:59:16 +0000
|
||||
Subject: [PATCH] ada: fix shared linking
|
||||
|
||||
---
|
||||
gcc/ada/link.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
|
||||
index 02c413a412f..f0e52a87d6e 100644
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|
||||
|| defined (__NetBSD__) || defined (__OpenBSD__) \
|
||||
|| defined (__QNX__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|
||||
|
||||
#elif defined (__linux__) || defined (__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From b1e3ea43462684675cc4f75c2ca4e984a6d511fb Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:59:43 +0000
|
||||
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
|
||||
|
||||
---
|
||||
Makefile.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 36e369df6e7..63627db68cf 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -170,6 +170,7 @@ BUILD_EXPORTS = \
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From ea75db47e243b59e7cf793623a87295c0d2aada2 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:01:06 +0000
|
||||
Subject: [PATCH] add fortify-headers paths
|
||||
|
||||
---
|
||||
gcc/config/linux.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
|
||||
index 95654bcdb5a..d88df8f154a 100644
|
||||
--- a/gcc/config/linux.h
|
||||
+++ b/gcc/config/linux.h
|
||||
@@ -167,6 +167,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
|
||||
#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 42637405a9cf90d96627406c72dbaf19cca34164 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
|
||||
Date: Fri, 21 Aug 2020 07:03:00 +0000
|
||||
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
|
||||
it unconditionally, as otherwise we get link failures if some objects are
|
||||
-fstack-protector built and final link happens with -fno-stack-protector.
|
||||
This seems to be the common case when bootstrapping gcc, the piepatches do
|
||||
not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
|
||||
stack-protector flag usage.
|
||||
|
||||
---
|
||||
gcc/gcc.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index daeb4d0c8ea..6920bec0fa0 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -894,8 +894,7 @@ proper position among the other output files. */
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
- "|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
+#define LINK_SSP_SPEC "-lssp_nonshared"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
From 64f209a51a7277d778c196c31c58422a04a69238 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:03:42 +0000
|
||||
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
|
||||
linking libtsan.
|
||||
|
||||
---
|
||||
gcc/gcc.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 6920bec0fa0..40e07354b3d 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -696,10 +696,10 @@ proper position among the other output files. */
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libasan:--push-state --no-as-needed}" \
|
||||
" -lasan " \
|
||||
" %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libasan:--pop-state}" \
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -717,10 +717,10 @@ proper position among the other output files. */
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libtsan:--push-state --no-as-needed}" \
|
||||
" -ltsan " \
|
||||
" %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libtsan:--pop-state}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -738,10 +738,10 @@ proper position among the other output files. */
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-liblsan:--push-state --no-as-needed}" \
|
||||
" -llsan " \
|
||||
" %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-liblsan:--pop-state}" \
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -757,10 +757,10 @@ proper position among the other output files. */
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libubsan:--push-state --no-as-needed}" \
|
||||
" -lubsan " \
|
||||
" %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libubsan:--pop-state}" \
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
From a57f530ace0ce215b1d6e2073223f05417ca2ed4 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Andreas Svee <me@lochnair.net>
|
||||
Date: Thu, 21 Dec 2017 03:14:33 +0100
|
||||
Subject: [PATCH] Pure 64-bit MIPS
|
||||
|
||||
---
|
||||
gcc/config/mips/mips.h | 8 ++++----
|
||||
gcc/config/mips/t-linux64 | 6 +++---
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
|
||||
index 3ce0c19a29a..b9920b49167 100644
|
||||
--- a/gcc/config/mips/mips.h
|
||||
+++ b/gcc/config/mips/mips.h
|
||||
@@ -3424,11 +3424,11 @@ struct GTY(()) machine_function {
|
||||
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
|
||||
need to change these from /lib and /usr/lib. */
|
||||
#if MIPS_ABI_DEFAULT == ABI_N32
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#elif MIPS_ABI_DEFAULT == ABI_64
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#endif
|
||||
|
||||
/* Load store bonding is not supported by micromips and fix_24k. The
|
||||
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
|
||||
index ceb58d3b5f3..8116e23ebba 100644
|
||||
--- a/gcc/config/mips/t-linux64
|
||||
+++ b/gcc/config/mips/t-linux64
|
||||
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
|
||||
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
|
||||
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
|
||||
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
|
||||
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
|
||||
+ ../lib \
|
||||
+ ../lib32 \
|
||||
+ ../lib
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
From 4571e0787fc992d647991e64a64d2b9c82e9a0e6 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:04:40 +0000
|
||||
Subject: [PATCH] use pure 64-bit configuration where appropriate
|
||||
|
||||
---
|
||||
gcc/config/aarch64/t-aarch64-linux | 2 +-
|
||||
gcc/config/i386/t-linux64 | 4 ++--
|
||||
gcc/config/rs6000/t-linux | 6 ++++--
|
||||
gcc/config/rs6000/t-linux64 | 4 ++--
|
||||
gcc/config/rs6000/t-linux64bele | 4 ++--
|
||||
gcc/config/rs6000/t-linux64lebe | 4 ++--
|
||||
gcc/config/s390/t-linux64 | 4 ++--
|
||||
7 files changed, 15 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
|
||||
index 83e59e33b85..6ec56fdf6a8 100644
|
||||
--- a/gcc/config/aarch64/t-aarch64-linux
|
||||
+++ b/gcc/config/aarch64/t-aarch64-linux
|
||||
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
|
||||
LIB1ASMFUNCS = _aarch64_sync_cache_range
|
||||
|
||||
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
|
||||
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib
|
||||
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
|
||||
|
||||
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
|
||||
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
|
||||
index 1171e218578..256f8c079ba 100644
|
||||
--- a/gcc/config/i386/t-linux64
|
||||
+++ b/gcc/config/i386/t-linux64
|
||||
@@ -33,6 +33,6 @@
|
||||
comma=,
|
||||
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
|
||||
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
|
||||
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
|
||||
index aeb7440c492..ab14c455d8d 100644
|
||||
--- a/gcc/config/rs6000/t-linux
|
||||
+++ b/gcc/config/rs6000/t-linux
|
||||
@@ -2,7 +2,8 @@
|
||||
# or soft-float.
|
||||
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
|
||||
ifneq (,$(findstring powerpc64,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
else
|
||||
MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
|
||||
endif
|
||||
@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target)))
|
||||
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
|
||||
endif
|
||||
ifneq (,$(findstring powerpc64le,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
endif
|
||||
endif
|
||||
|
||||
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
|
||||
index 264a7e27524..d1e460811cc 100644
|
||||
--- a/gcc/config/rs6000/t-linux64
|
||||
+++ b/gcc/config/rs6000/t-linux64
|
||||
@@ -28,8 +28,8 @@
|
||||
MULTILIB_OPTIONS := m64/m32
|
||||
MULTILIB_DIRNAMES := 64 32
|
||||
MULTILIB_EXTRA_OPTS :=
|
||||
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
|
||||
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
|
||||
$(COMPILE) $<
|
||||
diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele
|
||||
index 97c1ee6fb4d..08d72639cb6 100644
|
||||
--- a/gcc/config/rs6000/t-linux64bele
|
||||
+++ b/gcc/config/rs6000/t-linux64bele
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mlittle
|
||||
MULTILIB_DIRNAMES += le
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe
|
||||
index 2e63bdb9fc9..c6e1c5db65d 100644
|
||||
--- a/gcc/config/rs6000/t-linux64lebe
|
||||
+++ b/gcc/config/rs6000/t-linux64lebe
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mbig
|
||||
MULTILIB_DIRNAMES += be
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64
|
||||
index cc6ab367072..7f498ee1cdc 100644
|
||||
--- a/gcc/config/s390/t-linux64
|
||||
+++ b/gcc/config/s390/t-linux64
|
||||
@@ -7,5 +7,5 @@
|
||||
|
||||
MULTILIB_OPTIONS = m64/m31
|
||||
MULTILIB_DIRNAMES = 64 32
|
||||
-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From a1fb957dd7fe9a8dd99d256d7b0a676f87a9d80c Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:05:41 +0000
|
||||
Subject: [PATCH] always build libgcc_eh.a
|
||||
|
||||
highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
---
|
||||
libgcc/Makefile.in | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
|
||||
index 851e7657d07..99ec513a1a6 100644
|
||||
--- a/libgcc/Makefile.in
|
||||
+++ b/libgcc/Makefile.in
|
||||
@@ -956,8 +956,9 @@ ifneq ($(LIBUNWIND),)
|
||||
all: libunwind.a
|
||||
endif
|
||||
|
||||
+all: libgcc_eh.a
|
||||
ifeq ($(enable_shared),yes)
|
||||
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
|
||||
+all: libgcc_s$(SHLIB_EXT)
|
||||
ifneq ($(LIBUNWIND),)
|
||||
all: libunwind$(SHLIB_EXT)
|
||||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
|
||||
@@ -1159,10 +1160,6 @@ install-libunwind:
|
||||
install-shared:
|
||||
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
|
||||
|
||||
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
-
|
||||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
|
||||
@shlib_base_name@,libgcc_s,$(subst \
|
||||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
|
||||
@@ -1179,6 +1176,10 @@ ifeq ($(enable_gcov),yes)
|
||||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
endif
|
||||
|
||||
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+
|
||||
parts="$(INSTALL_PARTS)"; \
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
From 3a0a3d3843edd30ce72c96a40caa9e1334233558 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:06:30 +0000
|
||||
Subject: [PATCH] ada: libgnarl compatibility for musl
|
||||
|
||||
---
|
||||
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
|
||||
gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++--------------------------
|
||||
2 files changed, 3 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
index 80cb2b2a793..701b7a3aeab 100644
|
||||
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
@@ -399,12 +399,6 @@ package System.OS_Interface is
|
||||
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
|
||||
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
|
||||
|
||||
- function pthread_rwlockattr_setkind_np
|
||||
- (attr : access pthread_rwlockattr_t;
|
||||
- pref : int) return int;
|
||||
- pragma Import
|
||||
- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
|
||||
-
|
||||
function pthread_rwlock_init
|
||||
(mutex : access pthread_rwlock_t;
|
||||
attr : access pthread_rwlockattr_t) return int;
|
||||
@@ -466,11 +460,6 @@ package System.OS_Interface is
|
||||
protocol : int) return int;
|
||||
pragma Import (C, pthread_mutexattr_setprotocol);
|
||||
|
||||
- function pthread_mutexattr_setprioceiling
|
||||
- (attr : access pthread_mutexattr_t;
|
||||
- prioceiling : int) return int;
|
||||
- pragma Import (C, pthread_mutexattr_setprioceiling);
|
||||
-
|
||||
type struct_sched_param is record
|
||||
sched_priority : int; -- scheduling priority
|
||||
end record;
|
||||
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
index c45559e5ba0..0b0f173e7d4 100644
|
||||
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
@@ -202,9 +202,6 @@ package body System.Task_Primitives.Operations is
|
||||
pragma Import
|
||||
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
|
||||
|
||||
- function GNAT_has_cap_sys_nice return C.int;
|
||||
- pragma Import
|
||||
- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice");
|
||||
-- We do not have pragma Linker_Options ("-lcap"); here, because this
|
||||
-- library is not present on many Linux systems. 'libcap' is the Linux
|
||||
-- "capabilities" library, called by __gnat_has_cap_sys_nice.
|
||||
@@ -214,38 +211,6 @@ package body System.Task_Primitives.Operations is
|
||||
-- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
|
||||
-- GNU/Linux, so we map 0 .. 98 to 1 .. 99.
|
||||
|
||||
- function Get_Ceiling_Support return Boolean;
|
||||
- -- Get the value of the Ceiling_Support constant (see below).
|
||||
- -- Note well: If this function or related code is modified, it should be
|
||||
- -- tested by hand, because automated testing doesn't exercise it.
|
||||
-
|
||||
- -------------------------
|
||||
- -- Get_Ceiling_Support --
|
||||
- -------------------------
|
||||
-
|
||||
- function Get_Ceiling_Support return Boolean is
|
||||
- Ceiling_Support : Boolean := False;
|
||||
- begin
|
||||
- if Locking_Policy /= 'C' then
|
||||
- return False;
|
||||
- end if;
|
||||
-
|
||||
- declare
|
||||
- function geteuid return Integer;
|
||||
- pragma Import (C, geteuid, "geteuid");
|
||||
- Superuser : constant Boolean := geteuid = 0;
|
||||
- Has_Cap : constant C.int := GNAT_has_cap_sys_nice;
|
||||
- pragma Assert (Has_Cap in 0 | 1);
|
||||
- begin
|
||||
- Ceiling_Support := Superuser or else Has_Cap = 1;
|
||||
- end;
|
||||
-
|
||||
- return Ceiling_Support;
|
||||
- end Get_Ceiling_Support;
|
||||
-
|
||||
- pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
|
||||
- Ceiling_Support : constant Boolean := Get_Ceiling_Support;
|
||||
- pragma Warnings (On, "non-static call not allowed in preelaborated unit");
|
||||
-- True if the locking policy is Ceiling_Locking, and the current process
|
||||
-- has permission to use this policy. The process has permission if it is
|
||||
-- running as 'root', or if the capability was set by the setcap command,
|
||||
@@ -348,7 +313,9 @@ package body System.Task_Primitives.Operations is
|
||||
-- Init_Mutex --
|
||||
----------------
|
||||
|
||||
+ pragma Warnings (Off, "formal parameter * is not referenced");
|
||||
function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is
|
||||
+ pragma Warnings (On, "formal parameter * is not referenced");
|
||||
Mutex_Attr : aliased pthread_mutexattr_t;
|
||||
Result, Result_2 : C.int;
|
||||
|
||||
@@ -360,16 +327,7 @@ package body System.Task_Primitives.Operations is
|
||||
return Result;
|
||||
end if;
|
||||
|
||||
- if Ceiling_Support then
|
||||
- Result := pthread_mutexattr_setprotocol
|
||||
- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT);
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
- Result := pthread_mutexattr_setprioceiling
|
||||
- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio));
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
- elsif Locking_Policy = 'I' then
|
||||
+ if Locking_Policy = 'I' then
|
||||
Result := pthread_mutexattr_setprotocol
|
||||
(Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
|
||||
pragma Assert (Result = 0);
|
||||
@@ -409,11 +367,6 @@ package body System.Task_Primitives.Operations is
|
||||
Result := pthread_rwlockattr_init (RWlock_Attr'Access);
|
||||
pragma Assert (Result = 0);
|
||||
|
||||
- Result := pthread_rwlockattr_setkind_np
|
||||
- (RWlock_Attr'Access,
|
||||
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
|
||||
|
||||
pragma Assert (Result in 0 | ENOMEM);
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
From d0716e14d5bd652a7e21d0e3c75ea8ed32e6b4c7 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:07:48 +0000
|
||||
Subject: [PATCH] ada: musl support fixes
|
||||
|
||||
---
|
||||
gcc/ada/Makefile.rtl | 10 +++++-----
|
||||
gcc/ada/adaint.c | 34 +++++++++++++++++++---------------
|
||||
gcc/ada/adaint.h | 10 ++++------
|
||||
gcc/ada/terminals.c | 8 ++++----
|
||||
4 files changed, 32 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
|
||||
index 55ff9b0f3d5..0fadf4e4b79 100644
|
||||
--- a/gcc/ada/Makefile.rtl
|
||||
+++ b/gcc/ada/Makefile.rtl
|
||||
@@ -1533,7 +1533,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
|
||||
s-intman.adb<libgnarl/s-intman__posix.adb \
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
a-exetim.adb<libgnarl/a-exetim__posix.adb \
|
||||
a-exetim.ads<libgnarl/a-exetim__default.ads \
|
||||
s-linux.ads<libgnarl/s-linux.ads \
|
||||
@@ -2083,7 +2083,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
|
||||
s-osinte.adb<libgnarl/s-osinte__posix.adb \
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-ppc.ads
|
||||
@@ -2112,7 +2112,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
|
||||
endif
|
||||
|
||||
# ARM linux, GNU eabi
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
|
||||
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<libgnarl/a-intnam__linux.ads \
|
||||
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
|
||||
@@ -2305,7 +2305,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-ia64.ads
|
||||
@@ -2401,7 +2401,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
s-taspri.ads<libgnarl/s-taspri__posix.ads \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(X86_64_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-x86.ads
|
||||
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
|
||||
index 595abf87d65..00858c24f53 100644
|
||||
--- a/gcc/ada/adaint.c
|
||||
+++ b/gcc/ada/adaint.c
|
||||
@@ -90,6 +90,11 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
#endif
|
||||
+
|
||||
+#if defined (linux)
|
||||
+#define _GNU_SOURCE 1
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
|
||||
#ifdef __PikeOS__
|
||||
#define __BSD_VISIBLE 1
|
||||
@@ -3308,7 +3313,6 @@ __gnat_lwp_self (void)
|
||||
#endif
|
||||
|
||||
#if defined (__linux__)
|
||||
-#include <sched.h>
|
||||
|
||||
/* glibc versions earlier than 2.7 do not define the routines to handle
|
||||
dynamically allocated CPU sets. For these targets, we use the static
|
||||
@@ -3318,7 +3322,7 @@ __gnat_lwp_self (void)
|
||||
|
||||
/* Dynamic cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count)
|
||||
{
|
||||
return CPU_ALLOC (count);
|
||||
@@ -3331,33 +3335,33 @@ __gnat_cpu_alloc_size (size_t count)
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
- CPU_FREE (set);
|
||||
+ CPU_FREE ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count, void *set)
|
||||
{
|
||||
- CPU_ZERO_S (count, set);
|
||||
+ CPU_ZERO_S (count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET_S (cpu - 1, count, set);
|
||||
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
#else /* !CPU_ALLOC */
|
||||
|
||||
/* Static cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
|
||||
+ return xmalloc (sizeof (cpu_set_t));
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -3367,23 +3371,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
free (set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
- CPU_ZERO (set);
|
||||
+ CPU_ZERO ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET (cpu - 1, set);
|
||||
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
|
||||
}
|
||||
#endif /* !CPU_ALLOC */
|
||||
#endif /* __linux__ */
|
||||
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
|
||||
index 311e240dfcc..1c4d0050103 100644
|
||||
--- a/gcc/ada/adaint.h
|
||||
+++ b/gcc/ada/adaint.h
|
||||
@@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void);
|
||||
|
||||
/* Routines for interface to required CPU set primitives */
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
|
||||
+extern void * __gnat_cpu_alloc (size_t);
|
||||
extern size_t __gnat_cpu_alloc_size (size_t);
|
||||
-extern void __gnat_cpu_free (cpu_set_t *);
|
||||
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
|
||||
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
|
||||
+extern void __gnat_cpu_free (void *);
|
||||
+extern void __gnat_cpu_zero (size_t, void *);
|
||||
+extern void __gnat_cpu_set (int, size_t, void *);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
|
||||
index af4417fab90..bab6bf3ca87 100644
|
||||
--- a/gcc/ada/terminals.c
|
||||
+++ b/gcc/ada/terminals.c
|
||||
@@ -1145,7 +1145,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
|
||||
/* POSIX does not specify how to open the master side of a terminal.Several
|
||||
methods are available (system specific):
|
||||
1- using a cloning device (USE_CLONE_DEVICE)
|
||||
- 2- getpt (USE_GETPT)
|
||||
+ 2- posix_openpt (USE_POSIX_OPENPT)
|
||||
3- openpty (USE_OPENPTY)
|
||||
|
||||
When using the cloning device method, the macro USE_CLONE_DEVICE should
|
||||
@@ -1159,7 +1159,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
|
||||
#if defined (__APPLE__) || defined (BSD)
|
||||
#define USE_OPENPTY
|
||||
#elif defined (__linux__)
|
||||
-#define USE_GETPT
|
||||
+#define USE_POSIX_OPENPT
|
||||
#elif defined (__sun__)
|
||||
#define USE_CLONE_DEVICE "/dev/ptmx"
|
||||
#elif defined (_AIX)
|
||||
@@ -1208,8 +1208,8 @@ allocate_pty_desc (pty_desc **desc) {
|
||||
int master_fd = -1;
|
||||
char *slave_name = NULL;
|
||||
|
||||
-#ifdef USE_GETPT
|
||||
- master_fd = getpt ();
|
||||
+#if defined(USE_POSIX_OPENPT)
|
||||
+ master_fd = posix_openpt(O_RDWR | O_NOCTTY);
|
||||
#elif defined (USE_OPENPTY)
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
From e30511caa0046a09e09d08e01541ee89ebbf56f3 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 17:58:08 +0200
|
||||
Subject: [PATCH] gcc-go: Use _off_t type instead of _loff_t
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/go/syscall/libcall_linux.go | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
|
||||
index 88286c07b6e..f8f5cfb5011 100644
|
||||
--- a/libgo/go/syscall/libcall_linux.go
|
||||
+++ b/libgo/go/syscall/libcall_linux.go
|
||||
@@ -206,19 +206,19 @@ func Gettid() (tid int) {
|
||||
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
||||
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
|
||||
|
||||
-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
|
||||
-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
|
||||
+//sys splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
|
||||
+//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
|
||||
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
|
||||
- var lroff _loff_t
|
||||
- var plroff *_loff_t
|
||||
+ var lroff _off_t
|
||||
+ var plroff *_off_t
|
||||
if roff != nil {
|
||||
- lroff = _loff_t(*roff)
|
||||
+ lroff = _off_t(*roff)
|
||||
plroff = &lroff
|
||||
}
|
||||
- var lwoff _loff_t
|
||||
- var plwoff *_loff_t
|
||||
+ var lwoff _off_t
|
||||
+ var plwoff *_off_t
|
||||
if woff != nil {
|
||||
- lwoff = _loff_t(*woff)
|
||||
+ lwoff = _off_t(*woff)
|
||||
plwoff = &lwoff
|
||||
}
|
||||
n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From dd4c21ab43314e9dd6853f4157c0b2f530b46a3e Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 17:58:21 +0200
|
||||
Subject: [PATCH] gcc-go: Don't include sys/user.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/sysinfo.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
|
||||
index 0692fd41eb7..c8d987358d9 100644
|
||||
--- a/libgo/sysinfo.c
|
||||
+++ b/libgo/sysinfo.c
|
||||
@@ -73,9 +73,6 @@
|
||||
#include <sys/times.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/un.h>
|
||||
-#if defined(HAVE_SYS_USER_H)
|
||||
-#include <sys/user.h>
|
||||
-#endif
|
||||
#if defined(HAVE_SYS_UTSNAME_H)
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 9f85680c5e156d7ac95260e43bc06fe52468bb6e Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 17:59:22 +0200
|
||||
Subject: [PATCH] gcc-go: Fix ucontext_t on PPC64
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/runtime/go-signal.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
|
||||
index b429fdb2403..fd1c885f043 100644
|
||||
--- a/libgo/runtime/go-signal.c
|
||||
+++ b/libgo/runtime/go-signal.c
|
||||
@@ -224,7 +224,7 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
|
||||
#elif defined(__alpha__) && defined(__linux__)
|
||||
ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc;
|
||||
#elif defined(__PPC__) && defined(__linux__)
|
||||
- ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
|
||||
+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
|
||||
#elif defined(__PPC__) && defined(_AIX)
|
||||
ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
|
||||
#elif defined(__aarch64__) && defined(__linux__)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
From e8162b88725980771aaf473353a7a684aa31e974 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 17:59:45 +0200
|
||||
Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/mksigtab.sh | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
|
||||
index 11e4ec436bd..fe866eacb27 100644
|
||||
--- a/libgo/mksigtab.sh
|
||||
+++ b/libgo/mksigtab.sh
|
||||
@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
|
||||
checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}'
|
||||
checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}'
|
||||
checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}'
|
||||
-checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}'
|
||||
+#checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}'
|
||||
checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
|
||||
checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
|
||||
checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
|
||||
@@ -95,10 +95,12 @@ checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
|
||||
|
||||
# Special handling of signals 32 and 33 on GNU/Linux systems,
|
||||
# because they are special to glibc.
|
||||
+# Signal 34 is additionally special to Linux systems with musl.
|
||||
if test "${GOOS}" = "linux"; then
|
||||
- SIGLIST=$SIGLIST"_32__33_"
|
||||
+ SIGLIST=$SIGLIST"_32__33__34_"
|
||||
echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
|
||||
echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
|
||||
+ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
|
||||
fi
|
||||
|
||||
if test "${GOOS}" = "aix"; then
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From e52442cf9860963ce5d896436efaa032f9d03d86 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 18:01:03 +0200
|
||||
Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/go/runtime/mem_gccgo.go | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go
|
||||
index ba38ebaa9ab..3c9e5ce9461 100644
|
||||
--- a/libgo/go/runtime/mem_gccgo.go
|
||||
+++ b/libgo/go/runtime/mem_gccgo.go
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
//go:linkname sysFree
|
||||
|
||||
//extern mmap
|
||||
-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
|
||||
+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
|
||||
|
||||
//extern munmap
|
||||
func munmap(addr unsafe.Pointer, length uintptr) int32
|
||||
@@ -37,7 +37,7 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
|
||||
+func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
|
||||
p := sysMmap(addr, n, prot, flags, fd, off)
|
||||
if uintptr(p) == _MAP_FAILED {
|
||||
return nil, errno()
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
From d374c7d1d9f6fab654a5ece60a7ea74aeaf90970 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 18:02:28 +0200
|
||||
Subject: [PATCH] gcc-go: Fix st_{a,m,c}tim fields in generated sysinfo.go
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
There are more than one st_{a,m,c}tim fields in struct stat on time64 machines.
|
||||
|
||||
Run the Go-isation on all of them.
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/mksysinfo.sh | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
|
||||
index bd2ba32cba1..972e2c379bc 100755
|
||||
--- a/libgo/mksysinfo.sh
|
||||
+++ b/libgo/mksysinfo.sh
|
||||
@@ -510,9 +510,9 @@ fi | sed -e 's/type _stat64/type Stat_t/' \
|
||||
-e 's/st_size/Size/' \
|
||||
-e 's/st_blksize/Blksize/' \
|
||||
-e 's/st_blocks/Blocks/' \
|
||||
- -e 's/st_atim/Atim/' \
|
||||
- -e 's/st_mtim/Mtim/' \
|
||||
- -e 's/st_ctim/Ctim/' \
|
||||
+ -e 's/st_atim/Atim/g' \
|
||||
+ -e 's/st_mtim/Mtim/g' \
|
||||
+ -e 's/st_ctim/Ctim/g' \
|
||||
-e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \
|
||||
-e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \
|
||||
-e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 03365f764ffe09acbfaa08ede12c48d5cbafe37f Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 18:03:03 +0200
|
||||
Subject: [PATCH] gcc-go: signal 34 is special on musl libc
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Taken from Adélie Linux.
|
||||
---
|
||||
libgo/go/runtime/signal_gccgo.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go
|
||||
index c555712a03c..9e228580d37 100644
|
||||
--- a/libgo/go/runtime/signal_gccgo.go
|
||||
+++ b/libgo/go/runtime/signal_gccgo.go
|
||||
@@ -106,7 +106,7 @@ func getsig(i uint32) uintptr {
|
||||
if sigaction(i, nil, &sa) < 0 {
|
||||
// On GNU/Linux glibc rejects attempts to call
|
||||
// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
|
||||
- if GOOS == "linux" && (i == 32 || i == 33) {
|
||||
+ if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
|
||||
return _SIG_DFL
|
||||
}
|
||||
throw("sigaction read failure")
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From 8f432a1e00956bc2fcb6242571860a69fb32131d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sun, 30 Aug 2020 19:26:53 +0200
|
||||
Subject: [PATCH] gcc-go: Prefer _off_t over _off64_t
|
||||
|
||||
musl does not seem to have _off64_t.
|
||||
---
|
||||
libgo/mksysinfo.sh | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
|
||||
index 972e2c379bc..8d6da15f983 100755
|
||||
--- a/libgo/mksysinfo.sh
|
||||
+++ b/libgo/mksysinfo.sh
|
||||
@@ -379,11 +379,7 @@ fi
|
||||
# Some basic types.
|
||||
echo 'type Size_t _size_t' >> ${OUT}
|
||||
echo "type Ssize_t _ssize_t" >> ${OUT}
|
||||
-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
|
||||
- echo "type Offset_t _off64_t" >> ${OUT}
|
||||
-else
|
||||
- echo "type Offset_t _off_t" >> ${OUT}
|
||||
-fi
|
||||
+echo "type Offset_t _off_t" >> ${OUT}
|
||||
echo "type Mode_t _mode_t" >> ${OUT}
|
||||
echo "type Pid_t _pid_t" >> ${OUT}
|
||||
echo "type Uid_t _uid_t" >> ${OUT}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 8438932b8a20156459589e9d6b3fcf11989db0e8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sun, 30 Aug 2020 19:27:51 +0200
|
||||
Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c
|
||||
|
||||
---
|
||||
libgo/runtime/proc.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
|
||||
index 274ce01c0bf..92a540bdde9 100644
|
||||
--- a/libgo/runtime/proc.c
|
||||
+++ b/libgo/runtime/proc.c
|
||||
@@ -66,6 +66,10 @@ static void gscanstack(G*);
|
||||
|
||||
__thread G *g __asm__(GOSYM_PREFIX "runtime.g");
|
||||
|
||||
+/* libucontext does not seem to support tlsbase, undef the macro
|
||||
+ * here to make sure we define initcontext and fixcontext as dummies. */
|
||||
+#undef SETCONTEXT_CLOBBERS_TLS
|
||||
+
|
||||
#ifndef SETCONTEXT_CLOBBERS_TLS
|
||||
|
||||
static inline void
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 31375289a4c1a0f32c97ae3d73ab950014729392 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Mon, 31 Aug 2020 08:59:40 +0200
|
||||
Subject: [PATCH] gcc-go: link to libucontext
|
||||
|
||||
---
|
||||
Makefile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 63627db68cf..c7f1f84d683 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -48823,7 +48823,7 @@ configure-target-libgo:
|
||||
esac; \
|
||||
module_srcdir=libgo; \
|
||||
rm -f no-such-file || : ; \
|
||||
- CONFIG_SITE=no-such-file $(SHELL) \
|
||||
+ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
|
||||
$$s/$$module_srcdir/configure \
|
||||
--srcdir=$${topdir}/$$module_srcdir \
|
||||
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From 84fb75f5e30bfde3a076564f566d2f85caf5e6dd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Mon, 31 Aug 2020 20:26:56 +0200
|
||||
Subject: [PATCH] gcc-go: Disable printing of unaccessible ppc64 struct members
|
||||
|
||||
These struct members do not seem to exist on musl.
|
||||
---
|
||||
libgo/runtime/go-signal.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
|
||||
index fd1c885f043..e845e453332 100644
|
||||
--- a/libgo/runtime/go-signal.c
|
||||
+++ b/libgo/runtime/go-signal.c
|
||||
@@ -333,7 +333,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
|
||||
runtime_printf("sp %X\n", m->sc_regs[30]);
|
||||
runtime_printf("pc %X\n", m->sc_pc);
|
||||
}
|
||||
-#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__)
|
||||
+#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
|
||||
{
|
||||
mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
|
||||
int i;
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From a3ed90c4579725a21f3375a8fe0abb626be7c250 Mon Sep 17 00:00:00 2001
|
||||
From: Geod24 <pro.mathias.lang@gmail.com>
|
||||
Date: Mon, 16 Nov 2020 18:40:46 +0100
|
||||
Subject: [PATCH] CRuntime_Musl: Support v1.2.0 for 32 bits
|
||||
|
||||
As explained in the comment, `time_t` on Musl is now always 64 bits,
|
||||
but used to be 32 bits on 32 bits systems.
|
||||
---
|
||||
.../libdruntime/core/sys/posix/sys/types.d | 25 ++++++++++++++++++-
|
||||
1 file changed, 24 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
|
||||
index 451c8b4fccc..ca654fbe424 100644
|
||||
--- a/libphobos/libdruntime/core/sys/posix/sys/types.d
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d
|
||||
@@ -139,10 +139,33 @@ else version (CRuntime_Musl)
|
||||
alias int pid_t;
|
||||
alias uint uid_t;
|
||||
alias uint gid_t;
|
||||
+
|
||||
+ /**
|
||||
+ * Musl versions before v1.2.0 (up to v1.1.24) had different
|
||||
+ * definitions for `time_t` for 32 bits.
|
||||
+ * This was changed to always be 64 bits in v1.2.0:
|
||||
+ * https://musl.libc.org/time64.html
|
||||
+ * This change was only for 32 bits system and
|
||||
+ * didn't affect 64 bits systems
|
||||
+ *
|
||||
+ * To check previous definitions, `grep` for `time_t` in `arch/`,
|
||||
+ * and the result should be (in v1.1.24):
|
||||
+ * ---
|
||||
+ * // arch/riscv64/bits/alltypes.h.in:20:TYPEDEF long time_t;
|
||||
+ * // arch/s390x/bits/alltypes.h.in:17:TYPEDEF long time_t;
|
||||
+ * // arch/sh/bits/alltypes.h.in:21:TYPEDEF long time_t;
|
||||
+ * ---
|
||||
+ *
|
||||
+ * In order to be compatible with old versions of Musl,
|
||||
+ * one can recompile druntime with `CRuntime_Musl_Pre_Time64`.
|
||||
+ */
|
||||
version (D_X32)
|
||||
alias long time_t;
|
||||
- else
|
||||
+ else version (CRuntime_Musl_Pre_Time64)
|
||||
alias c_long time_t;
|
||||
+ else
|
||||
+ alias long time_t;
|
||||
+
|
||||
alias c_long clock_t;
|
||||
alias c_ulong pthread_t;
|
||||
version (D_LP64)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,700 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen gcc-armhf
|
||||
# Based on: main/gcc (from Alpine)
|
||||
|
||||
CTARGET_ARCH=armhf
|
||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||
LANG_D=false
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||
# when this variable matches "no*"
|
||||
BOOTSTRAP="nobuildbase"
|
||||
|
||||
# abuild will only cross compile when this variable is set, but it
|
||||
# needs to find a valid package database in there for dependency
|
||||
# resolving, so we set it to /.
|
||||
CBUILDROOT="/"
|
||||
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname=gcc-armhf
|
||||
_pkgbase=10.2.1
|
||||
pkgver=10.2.1_pre1
|
||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname=gcc-armhf
|
||||
pkgrel=3
|
||||
pkgdesc="Stage2 cross-compiler for armhf"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later LGPL-2.1-or-later"
|
||||
_gccrel=$pkgver-r$pkgrel
|
||||
depends="isl binutils-armhf mpc1"
|
||||
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
||||
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
|
||||
subpackages="g++-armhf:gpp"
|
||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
||||
replaces="libstdc++ binutils"
|
||||
|
||||
: "${LANG_CXX:=true}"
|
||||
: "${LANG_D:=true}"
|
||||
: "${LANG_OBJC:=true}"
|
||||
: "${LANG_GO:=true}"
|
||||
: "${LANG_FORTRAN:=true}"
|
||||
: "${LANG_ADA:=true}"
|
||||
|
||||
_libgomp=true
|
||||
_libgcc=true
|
||||
_libatomic=true
|
||||
_libitm=true
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||
LANG_CXX=false
|
||||
LANG_ADA=false
|
||||
_libgcc=false
|
||||
_builddir="$srcdir/build-cross-pass2"
|
||||
else
|
||||
_builddir="$srcdir/build-cross-final"
|
||||
fi
|
||||
LANG_OBJC=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_D=false
|
||||
_libgomp=false
|
||||
_libatomic=false
|
||||
_libitm=false
|
||||
|
||||
# reset target flags (should be set in crosscreate abuild)
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
STRIP_FOR_TARGET="$CTARGET-strip"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
|
||||
# reset flags and cc for build
|
||||
export CC_FOR_BUILD="gcc"
|
||||
export CXX_FOR_BUILD="g++"
|
||||
export CFLAGS_FOR_BUILD=" "
|
||||
export CXXFLAGS_FOR_BUILD=" "
|
||||
export LDFLAGS_FOR_BUILD=" "
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
# Languages that do not need bootstrapping
|
||||
LANG_OBJC=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_D=false
|
||||
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build-cross-native"
|
||||
else
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build"
|
||||
fi
|
||||
|
||||
# GDC hasn't been ported to PowerPC
|
||||
# See libphobos/configure.tgt in GCC sources for supported targets
|
||||
[ "$CARCH" = ppc64le ] && LANG_D=false
|
||||
|
||||
# libitm has TEXTRELs in ARM build, so disable for now
|
||||
case "$CTARGET_ARCH" in
|
||||
arm*) _libitm=false ;;
|
||||
mips*) _libitm=false ;;
|
||||
esac
|
||||
|
||||
# Internal libffi fails to build on MIPS at the moment, need to
|
||||
# investigate further. We disable LANG_GO on mips64 as it requires
|
||||
# the internal libffi.
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) LANG_GO=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
# currently on x86, x86_64 and ia64
|
||||
_libquadmath=$LANG_FORTRAN
|
||||
case "$CTARGET_ARCH" in
|
||||
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
|
||||
*) _libquadmath=false ;;
|
||||
esac
|
||||
|
||||
# libatomic is a dependency for openvswitch
|
||||
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||
if $_libgomp; then
|
||||
depends="$depends libgomp=$_gccrel"
|
||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||
fi
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
fi
|
||||
if $LANG_D; then
|
||||
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
|
||||
_languages="$_languages,d"
|
||||
makedepends_build="$makedepends_build libucontext-dev"
|
||||
fi
|
||||
if $LANG_OBJC; then
|
||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||
_languages="$_languages,objc"
|
||||
fi
|
||||
if $LANG_GO; then
|
||||
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
||||
_languages="$_languages,go"
|
||||
fi
|
||||
if $LANG_FORTRAN; then
|
||||
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
||||
_languages="$_languages,fortran"
|
||||
fi
|
||||
if $LANG_ADA; then
|
||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
||||
_languages="$_languages,ada"
|
||||
[ "$CBUILD" = "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat-bootstrap"
|
||||
[ "$CBUILD" != "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||
fi
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
|
||||
# when using upstream releases, use this URI template
|
||||
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
||||
#
|
||||
# right now, we are using a git snapshot.
|
||||
#
|
||||
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
|
||||
# so that they can be properly tracked and easily rebased if needed.
|
||||
source="https://dev.alpinelinux.org/~nenolod/gcc-${pkgver}.tar.xz
|
||||
0001-posix_memalign.patch
|
||||
0002-gcc-poison-system-directories.patch
|
||||
0003-Turn-on-Wl-z-relro-z-now-by-default.patch
|
||||
0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
0007-Enable-Wtrampolines-by-default.patch
|
||||
0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
0012-libitm-disable-FORTIFY.patch
|
||||
0013-libgcc_s.patch
|
||||
0014-nopie.patch
|
||||
0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
||||
0016-dlang-update-zlib-binding.patch
|
||||
0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
|
||||
0018-ada-fix-shared-linking.patch
|
||||
0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
0020-add-fortify-headers-paths.patch
|
||||
0021-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
0023-Pure-64-bit-MIPS.patch
|
||||
0024-use-pure-64-bit-configuration-where-appropriate.patch
|
||||
0025-always-build-libgcc_eh.a.patch
|
||||
0026-ada-libgnarl-compatibility-for-musl.patch
|
||||
0027-ada-musl-support-fixes.patch
|
||||
0028-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch
|
||||
0029-gcc-go-Don-t-include-sys-user.h.patch
|
||||
0030-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
||||
0031-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
||||
0032-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||
0033-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch
|
||||
0034-gcc-go-signal-34-is-special-on-musl-libc.patch
|
||||
0035-gcc-go-Prefer-_off_t-over-_off64_t.patch
|
||||
0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
||||
0037-gcc-go-link-to-libucontext.patch
|
||||
0038-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
||||
0040-CRuntime_Musl-Support-v1.2.0-for-32-bits.patch
|
||||
"
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-$pkgver
|
||||
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||
|
||||
prepare() {
|
||||
cd "$_gccdir"
|
||||
|
||||
_err=
|
||||
for i in $source; do
|
||||
case "$i" in
|
||||
*.patch)
|
||||
msg "Applying $i"
|
||||
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$_err" ]; then
|
||||
error "The following patches failed:"
|
||||
for i in $_err; do
|
||||
echo " $i"
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
|
||||
}
|
||||
|
||||
build() {
|
||||
local _arch_configure=
|
||||
local _libc_configure=
|
||||
local _bootstrap_configure=
|
||||
local _symvers=
|
||||
|
||||
cd "$_gccdir"
|
||||
|
||||
case "$CTARGET" in
|
||||
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
||||
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
||||
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
||||
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
||||
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
||||
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_LIBC" in
|
||||
musl)
|
||||
# musl does not support mudflap, or libsanitizer
|
||||
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
||||
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
||||
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
||||
_symvers="--disable-symvers"
|
||||
export libat_cv_have_ifunc=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "$BOOTSTRAP" in
|
||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||
esac
|
||||
|
||||
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||
|
||||
msg "Building the following:"
|
||||
echo ""
|
||||
echo " CBUILD=$CBUILD"
|
||||
echo " CHOST=$CHOST"
|
||||
echo " CTARGET=$CTARGET"
|
||||
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
||||
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
||||
echo " languages=$_languages"
|
||||
echo " arch_configure=$_arch_configure"
|
||||
echo " libc_configure=$_libc_configure"
|
||||
echo " cross_configure=$_cross_configure"
|
||||
echo " bootstrap_configure=$_bootstrap_configure"
|
||||
echo " hash_style_configure=$_hash_style_configure"
|
||||
echo ""
|
||||
|
||||
export CFLAGS="$CFLAGS -O2"
|
||||
|
||||
mkdir -p "$_builddir"
|
||||
cd "$_builddir"
|
||||
"$_gccdir"/configure --prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--build=${CBUILD} \
|
||||
--host=${CHOST} \
|
||||
--target=${CTARGET} \
|
||||
--with-pkgversion="Alpine $pkgver" \
|
||||
--enable-checking=release \
|
||||
--disable-fixed-point \
|
||||
--disable-libstdcxx-pch \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
$_symvers \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-default-pie \
|
||||
--enable-default-ssp \
|
||||
--enable-cloog-backend \
|
||||
--enable-languages=$_languages \
|
||||
$_arch_configure \
|
||||
$_libc_configure \
|
||||
$_cross_configure \
|
||||
$_bootstrap_configure \
|
||||
--with-system-zlib \
|
||||
$_hash_style_configure
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make -j1 DESTDIR="$pkgdir" install
|
||||
|
||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||
|
||||
# we dont support gcj -static
|
||||
# and saving 35MB is not bad.
|
||||
find "$pkgdir" \( -name libgtkpeer.a \
|
||||
-o -name libgjsmalsa.a \
|
||||
-o -name libgij.a \) \
|
||||
-delete
|
||||
|
||||
# strip debug info from some static libs
|
||||
find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||
-o -name libgphobos.a -o -name libgdruntime.a \
|
||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||
-a -type f \
|
||||
-exec ${STRIP_FOR_TARGET} -g {} +
|
||||
|
||||
if $_libgomp; then
|
||||
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
if $_libitm; then
|
||||
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
|
||||
# remove ffi
|
||||
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
||||
find "$pkgdir" -name 'ffi*.h' -delete
|
||||
|
||||
local gdblib=${_target:+$CTARGET/}lib
|
||||
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
|
||||
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
|
||||
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
||||
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
||||
done
|
||||
fi
|
||||
|
||||
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
|
||||
|
||||
# move ada runtime libs
|
||||
if $LANG_ADA; then
|
||||
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
|
||||
mv "$i" "$pkgdir"/usr/lib/
|
||||
ln -s ../../../../${i##*/} $i
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# cross-gcc: remove any files that would conflict with the
|
||||
# native gcc package
|
||||
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
|
||||
# libcc1 does not depend on target, don't ship it
|
||||
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
||||
|
||||
# fixup gcc library symlinks to be linker scripts so
|
||||
# linker finds the libs from relocated sysroot
|
||||
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
|
||||
if [ -h "$so" ]; then
|
||||
local _real=$(basename "$(readlink "$so")")
|
||||
rm -f "$so"
|
||||
echo "GROUP ($_real)" > "$so"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# add c89/c99 wrapper scripts
|
||||
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
||||
#!/bin/sh
|
||||
_flavor="-std=c89"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
|
||||
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
||||
#!/bin/sh
|
||||
_flavor="-std=c99"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-std=c99|-std=iso9899:1999) _flavor="";;
|
||||
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||
|
||||
# install lto plugin so regular binutils may use it
|
||||
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
|
||||
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
|
||||
fi
|
||||
}
|
||||
|
||||
libatomic() {
|
||||
pkgdesc="GCC Atomic library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libcxx() {
|
||||
pkgdesc="GNU C++ standard runtime library"
|
||||
depends=
|
||||
|
||||
if [ "$CHOST" = "$CTARGET" ]; then
|
||||
# verify that we are using clock_gettime rather than doing direct syscalls
|
||||
# so we dont break 32 bit arches due to time64.
|
||||
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
|
||||
fi
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gpp() {
|
||||
pkgdesc="GNU C++ standard library and compiler"
|
||||
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||
"$subpkgdir"/usr/bin \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
||||
|
||||
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
||||
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
|
||||
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
||||
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
libobjc() {
|
||||
pkgdesc="GNU Objective-C runtime"
|
||||
replaces="objc"
|
||||
depends=
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
objc() {
|
||||
pkgdesc="GNU Objective-C"
|
||||
replaces="gcc"
|
||||
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||
"$subpkgdir"/$_gcclibdir/include \
|
||||
"$subpkgdir"/usr/lib
|
||||
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
|
||||
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
||||
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgcc() {
|
||||
pkgdesc="GNU C compiler runtime libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgomp() {
|
||||
pkgdesc="GCC shared-memory parallel programming API library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgphobos() {
|
||||
pkgdesc="D programming language standard library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gdc() {
|
||||
pkgdesc="GCC-based D language compiler"
|
||||
depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev"
|
||||
depends="$depends libucontext-dev"
|
||||
|
||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||
"$subpkgdir"/$_gcclibdir/include/d/ \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
# Copy: The installed '.d' files, the static lib, the binary itself
|
||||
# The shared libs are part of 'libgphobos' so one can run program
|
||||
# without installing the compiler
|
||||
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
|
||||
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
|
||||
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
|
||||
libgo() {
|
||||
pkgdesc="Go runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
go() {
|
||||
pkgdesc="Go support for GCC"
|
||||
depends="gcc=$_gccrel libgo=$_gccrel !go"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/usr/lib/libgo.a \
|
||||
"$pkgdir"/usr/lib/libgo.so \
|
||||
"$pkgdir"/usr/lib/libgobegin.a \
|
||||
"$pkgdir"/usr/lib/libgolibbegin.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgfortran() {
|
||||
pkgdesc="Fortran runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libquadmath() {
|
||||
replaces="gcc"
|
||||
pkgdesc="128-bit math library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gfortran() {
|
||||
pkgdesc="GNU Fortran Compiler"
|
||||
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
||||
$_libquadmath && depends="$depends libquadmath=$_gccrel"
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/usr/lib/libgfortran.a \
|
||||
"$pkgdir"/usr/lib/libgfortran.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
if $_libquadmath; then
|
||||
mv "$pkgdir"/usr/lib/libquadmath.a \
|
||||
"$pkgdir"/usr/lib/libquadmath.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
fi
|
||||
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
|
||||
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
||||
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
||||
}
|
||||
|
||||
libgnat() {
|
||||
pkgdesc="GNU Ada runtime shared libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gnat() {
|
||||
pkgdesc="Ada support for GCC"
|
||||
depends="gcc=$_gccrel"
|
||||
provides="$pkgname-gnat-bootstrap"
|
||||
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
|
||||
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
sha512sums="172fd45e7274c36ebd22a7e12e44a7096ae3bf0e7f0b647da92cfd31ec406a69017df7ee6c1a6ee0822fbef4ff47855f83fab0a0cdb8f031713a14604af3900b gcc-10.2.1_pre1.tar.xz
|
||||
429a92934e1c507c0320741ed5cdd98ba96c73412447c8df0704077e3f0fa6ee4cc4056fadeaa6bb55d237416b555408e97a1c1d21f47b6f6812f153bc36f181 0001-posix_memalign.patch
|
||||
a0a9445358f58a34ba0a605d142243d62873d4669ca811013a593e3d6e6640006b5ec23b7a5734ee72f71762d098d607749d6ecc98c85aa4f2074400aedd63ff 0002-gcc-poison-system-directories.patch
|
||||
9fb636d1f2ef5b8225082f44da3086b9f196d1c045d7319cea148ee630b92c164e80a3e9a70a221e616a65fc00da761e733f87e23e8575634e498728bce2c48b 0003-Turn-on-Wl-z-relro-z-now-by-default.patch
|
||||
e34086d5a46f963e43e9f2f9240e3fb4d935e49feb8edba5121a59192b5991103a8253a342fbc20cef8ac2aa4ae2bf9a7ceb62abf6676be16441fd2dbf3b05f2 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
ffd89376a743d29a16b4f38463076691cd3716bee2bca0dbb67c2c1da00773661fb362bcc4b2ffd94f57c6b4470ae7cf8f6abad95de5880e74adaa5c4da21426 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
e101b356589fb794f1c4224bba8d8c714a962bed7858a734badfe38a5d10f4e800155f1ed5edbae9da7134192dfd6a4d8a33a9dbe871becb9526810af535819c 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
e6fbe275e8f4b1257271118bfea5d6c05b041439dde560775a7ee1a9457f442c3e0c8b1113c68bd54502b7d44e6e4b76315613bf2972898a981119f384106fde 0007-Enable-Wtrampolines-by-default.patch
|
||||
e2a6a0e3cb2c7a40f59432e0f633a3579bb320fc116290d4655766931c56fb78ce73b0f5e75a78c6aacf85155f3c508e84bfee259dba13cd36e77a601fd5d8f5 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
0f802f8d9d794a6515a7df7b8588eadc0fa49fdb0b7a5148036fa6fc6e74f35c97d79ed1e4ad225f8f46cca6801f49cbc041258494e4fdbad77a6a7020024d7d 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
ff99bc1d02ab07ca7d4c45ff5bfec555096b9a9eb6ef5c02d7e18de72ff3a02505d5e3dca6681caa23b8993049a4acf6a07f5a2e8b4481c4778a7a982851970e 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
cf4dc1bfe33250e4065d926d0a126eb87a43695e24a5efda1c383c4d78add0fa7884c378cd3fbb48d713503492d842758fed69c8b5e29774b3bc87c4abe65125 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
93f244dda3fa55a6016d511f526abf902f7902e876a2d813980d0ad0bf527e4c0fd6258293c90085c1e59056d827bf92aab2b9b92c6f17f776e0068e507d731a 0012-libitm-disable-FORTIFY.patch
|
||||
d6f409d8d9de3ff44e97046fed1b70ebbecebd5722e7c9bbb92d244ed37d43e77b5d398e39038c554945d022df6d2103b9d4c51fbe11e1d8a011bdfd9067b647 0013-libgcc_s.patch
|
||||
d380dc2f57bb2065e0c6d80c0837113c3feee2b2290b5747e922aa7dbcbc4463f55f1c22b39a1dcf88653ef5bbae9d29adbfc0f1002d5eaa523a7a31f980b7ab 0014-nopie.patch
|
||||
5db204edfcace211fd89eb16c358579d1534546a0245d2e11541078081d627e712a9ce372d838f152b4e361742696324929c4649d9b9ff6fb0678791bd898fca 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
||||
bb76853e79fbeb5c57f52739dff132abf0b80fc551fe83d82238f598ab5ec153b7ebb45aa33b05b24750ff1895cd77a52375bcfb9295c1a44683996ac34bd381 0016-dlang-update-zlib-binding.patch
|
||||
50916865c79d9a1305f2524f7051d04df46be925fc7385a3b3cb2c17f1becb8827de76c3e897d470ce1f3fc269f9051c9b478c4d022d7611bcf081782e8b4cba 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
|
||||
0de08138565d81d4b7bbd367f08e5a2bc637106c39736fbedc92401cf3c2cf18ff50c183c263354852bc03724f9353a9a357ed637b3f012ede2514d3c2ed3969 0018-ada-fix-shared-linking.patch
|
||||
82aa21e25fddb6ba6a4e1424c88cf5989f62bf3fe088b43bfaf2e624df0381c830b1f0d1e7f10afb2ec6bff07a2558c0464229a997420fe0435321d1d2117372 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
97cb91e95afccfa7fd020d10f48421745cf7afcbe903f17256fc1df05f5f07eaa675576b7eb340da1b5aa97854df4f1f003cb648d8c2e64d9e9c067a0acd2243 0020-add-fortify-headers-paths.patch
|
||||
3ffc3bbfbfd7ae3ddfef131d0731577aac0567c965d545a2ad7c9588430397748758990d2c449e4a4c66f11db6a3ea66fb3187d173c3581cda2093d25f3d90e6 0021-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
fe3e098d71709bde04cc0a17dcf3bb6ce5bc14b51af1395db97afcb464ba5910dbf85be5d968beddf645e916241f9c6be243c24097c326d9bfebc58219f76118 0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
7dc0c14cbdcab4aaa355568556e5263912ecc69301653602f99e7c70352d84431c6f931a27f4977de7bbd0d5a328c865f7717c8136e3ed6a12ef4448a107a1a6 0023-Pure-64-bit-MIPS.patch
|
||||
e4bbd675aea5f09d4aaa32990a88597bd070273754656575e9be74a172afd244aa15e58c2d6878606b652d56457b053c94213f3c0bbf63ebe1ede5fcfdedca25 0024-use-pure-64-bit-configuration-where-appropriate.patch
|
||||
f2bd09b05fb67544d0ef70ce14fd8ca2e2d21846d5396e4e53cdb95317ae122b3f121b8933e5784fc92e51e50d23812e4aa41f2fd07ae68ba1a21ca094a841ac 0025-always-build-libgcc_eh.a.patch
|
||||
0d49f5104e89a1269a286f7021dd32d0ac4f7aa427b36f40133bc8616ca87e92144d6cc36f958b3ab4ec683e12f946c3658bceada8fcd5114bdb7c197992eb4a 0026-ada-libgnarl-compatibility-for-musl.patch
|
||||
a09211cb007a9722ec95d046fbf317f63b362fb25f6d3ba285f278a33fe08ad5f5d51ba1e4ccf9ebe02c1ea3ca15f10b0721e7f65af5ced27ffc9380af7558b1 0027-ada-musl-support-fixes.patch
|
||||
35c1ee71725042fffded7e3189d96ace6cb730d95d83cd49fd4d8527eba72eb344c11d563d1c751a3934627e5aaa44525c58afd4d01c0bb99bab3b6222fa3040 0028-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch
|
||||
26deab6006d46e2c8de4679cc7f598cfdd572b1b77c0595f0160fa693251669d324f47712c6faef481dc33a2c83878ec3fe385d54ab9bfd6fa2c576d84429d05 0029-gcc-go-Don-t-include-sys-user.h.patch
|
||||
dd9cc5c3c5368a210276ce4396be9cf120c5acfc65cae88508aebd7d4430a28d21b26b362f7f7456ae64c87dd06dfe7a615cd0c7ca13740b683e3a59c1c7bc8d 0030-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
||||
c17f5088172babddbdb32830387487286f6106304cf07d49d0b2e59feacad62aa10a46bf1bf927f1f138fd1112da5bef7ae1227a26e7946082a6edc7f340b522 0031-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
||||
db67b346f3def6c004639df27cef32a6c4e9b4661634f43b62f4f3be852f5ae6d5dadef85116f816d5fd88cbdd80001d8f81cc8d554b9094744402ca3ae14725 0032-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||
438c165b8e217142b64a002e99b112fbdac9b2c4ced7b0a8c8fe9cff42e6a5ea6d5939cb40905d5a8570fc890de447fd0f5b49c9ee43c3a6e33446efdf2229bf 0033-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch
|
||||
85592117e6370ff8612a7a028194c6875c8df1f07299afa0188770bf9bdd82d9aeb322909ec980cf3bd10a54d90829fffb145c566d843027c11d49e78d3f0a9e 0034-gcc-go-signal-34-is-special-on-musl-libc.patch
|
||||
abc2ae2ea2ff270226c45321508c3641011b23172d043c55239a52fee9ed8451e8e23a2a65612c5f3a0d2e4d1a601a7e9a2c1d6c07f926e6cdf42164d23cff34 0035-gcc-go-Prefer-_off_t-over-_off64_t.patch
|
||||
21ff83b1f5f8c71c41e7c22ba59f194bc789c8e67a6be9e5185f215adf4ddb175551a261556e5c9bd57dd9c302e1f966de01ff90e097d7ace2c2e43208b6e0f9 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
||||
5f0230f9e542bcbfa39f1a3da1f171229bd926971a924ec3e9f3ad8178645d3853659a58a89a48906ffdd77e9c5ff2af43dc54cfc4ac335a219267dddc4afad1 0037-gcc-go-link-to-libucontext.patch
|
||||
08ffdce5d1ef722364faf5e824b62d0e58655acbba99b58f24c609abb1d90577432863e769fbe269e4151c997b8bbb0cbed29032752b6e6c3356f8fb3086d607 0038-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
||||
81bcffde9635c9c4b3214afd8bb16048f15dc8c4ce82c5576b15ee552d6ca8eeee2c5444e2949fec3b938e69fc7a2a2259a07d437e004788ac232c43ae9a83d2 0040-CRuntime_Musl-Support-v1.2.0-for-32-bits.patch"
|
||||
@@ -1,156 +0,0 @@
|
||||
2013-12-30 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/configure.ac Add --enable-esp and define ENABLE_ESP.
|
||||
Check if we support crtbeginP and define ENABLE_CRTBEGINP.
|
||||
* gcc/configure Regenerated
|
||||
|
||||
|
||||
--- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100
|
||||
+++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200
|
||||
@@ -5130,6 +5237,55 @@ if test x"${LINKER_HASH_STYLE}" != x; th
|
||||
[The linker hash style])
|
||||
fi
|
||||
|
||||
+# --------------
|
||||
+# Esp checks
|
||||
+# --------------
|
||||
+
|
||||
+# Check whether --enable-esp was given and target have the support.
|
||||
+AC_ARG_ENABLE([esp],
|
||||
+[AS_HELP_STRING([--enable-esp],
|
||||
+ [Enable Stack protector and Position independent executable as
|
||||
+ default if we have suppot for it when compiling
|
||||
+ and link with -z now as default.
|
||||
+ Linux targets supported i*86, x86_64, x32,
|
||||
+ powerpc, powerpc64, ia64, arm and mips.])],
|
||||
+ enable_esp=$enableval,
|
||||
+ enable_esp=no)
|
||||
+if test $enable_esp = yes ; then
|
||||
+ AC_MSG_CHECKING(if $target support esp)
|
||||
+ case "$target" in
|
||||
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips-*-linux* | arm*-*-linux* | ia64-*-linux*)
|
||||
+ enable_esp=yes
|
||||
+ AC_DEFINE(ENABLE_ESP, 1,
|
||||
+ [Define if your target support esp and you have enable it.])
|
||||
+ ;;
|
||||
+ *)
|
||||
+ enable_esp=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+AC_MSG_RESULT($enable_esp)
|
||||
+fi
|
||||
+AC_SUBST([enable_esp])
|
||||
+if test $enable_esp = yes ; then
|
||||
+ AC_MSG_CHECKING(checking for crtbeginP.o support)
|
||||
+ if test x$enable_esp = xyes ; then
|
||||
+ case "$target" in
|
||||
+ ia64*-*-linux*)
|
||||
+ enable_crtbeginP=no ;;
|
||||
+ *-*-linux*)
|
||||
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
|
||||
+ enable_crtbeginP=yes
|
||||
+ AC_DEFINE(ENABLE_CRTBEGINP, 1,
|
||||
+ [Define if your compiler will support crtbeginP.])
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *) enable_crtbeginP=no ;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ AC_MSG_RESULT($enable_crtbeginP)
|
||||
+fi
|
||||
+AC_SUBST([enable_crtbeginP])
|
||||
+
|
||||
# Configure the subdirectories
|
||||
# AC_CONFIG_SUBDIRS($subdirs)
|
||||
|
||||
--- a/gcc/configure 2013-02-01 21:26:24.000000000 +0100
|
||||
+++ b/gcc/configure 2013-02-12 01:59:20.000000000 +0100
|
||||
@@ -600,6 +600,8 @@
|
||||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
PICFLAG
|
||||
+enable_crtbeginP
|
||||
+enable_esp
|
||||
enable_host_shared
|
||||
enable_plugin
|
||||
pluginlibs
|
||||
@@ -920,6 +922,7 @@
|
||||
enable_plugin
|
||||
enable_libquadmath_support
|
||||
with_linker_hash_style
|
||||
+enable_esp
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1633,6 +1636,11 @@
|
||||
--enable-plugin enable plugin support
|
||||
--disable-libquadmath-support
|
||||
disable libquadmath support for Fortran
|
||||
+ --enable-esp Enable Stack protector and Position independent
|
||||
+ executable as default if we have suppot for it when
|
||||
+ compiling and link with -z now as default.
|
||||
+ Linux targets supported i*86, x86_64, x32,
|
||||
+ powerpc, powerpc64, ia64, arm and mips.
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@@ -27419,6 +27427,59 @@
|
||||
|
||||
fi
|
||||
|
||||
+# --------------
|
||||
+# Esp checks
|
||||
+# --------------
|
||||
+
|
||||
+# Check whether --enable-esp was given and target have the support.
|
||||
+# Check whether --enable-esp was given.
|
||||
+if test "${enable_esp+set}" = set; then :
|
||||
+ enableval=$enable_esp; enable_esp=$enableval
|
||||
+else
|
||||
+ enable_esp=no
|
||||
+fi
|
||||
+
|
||||
+if test $enable_esp = yes ; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $target support esp" >&5
|
||||
+$as_echo_n "checking if $target support esp... " >&6; }
|
||||
+ case "$target" in
|
||||
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips*-*-linux* | arm*-*-linux* | ia64-*-linux*)
|
||||
+ enable_esp=yes
|
||||
+
|
||||
+$as_echo "#define ENABLE_ESP 1" >>confdefs.h
|
||||
+
|
||||
+ ;;
|
||||
+ *)
|
||||
+ enable_esp=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_esp" >&5
|
||||
+$as_echo "$enable_esp" >&6; }
|
||||
+fi
|
||||
+
|
||||
+if test $enable_esp = yes ; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for crtbeginP.o support" >&5
|
||||
+$as_echo_n "checking checking for crtbeginP.o support... " >&6; }
|
||||
+ if test x$enable_esp = xyes ; then
|
||||
+ case "$target" in
|
||||
+ ia64*-*-linux*)
|
||||
+ enable_crtbeginP=no ;;
|
||||
+ *-*-linux*)
|
||||
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
|
||||
+ enable_crtbeginP=yes
|
||||
+
|
||||
+$as_echo "#define ENABLE_CRTBEGINP 1" >>confdefs.h
|
||||
+
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *) enable_crtbeginP=no ;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crtbeginP" >&5
|
||||
+$as_echo "$enable_crtbeginP" >&6; }
|
||||
+fi
|
||||
+
|
||||
+
|
||||
# Configure the subdirectories
|
||||
# AC_CONFIG_SUBDIRS($subdirs)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
2013-02-13 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config.in Add ENABLE_CRTBEGINP, ENABLE_ESP
|
||||
|
||||
--- ./gcc/config.in 2009-04-21 11:08:08.000000000 +0200
|
||||
+++ ./gcc/config.in 2009-05-12 00:10:08.000000000 +0200
|
||||
@@ -46,6 +46,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to 1 to enable crtbeginP.o. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_CRTBEGINP
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define to 1 to specify that we are using the BID decimal floating point
|
||||
format instead of DPD */
|
||||
#ifndef USED_FOR_TARGET
|
||||
@@ -65,6 +65,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to 1 to enable esp. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_ESP
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define to 1 to enable fixed-point arithmetic extension to C. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef ENABLE_FIXED_POINT
|
||||
@@ -1,96 +0,0 @@
|
||||
2012-01-17 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
|
||||
ALL_CXXFLAGS if enable_esp yes.
|
||||
Echo enable_esp and enable_crtbeginP to tmp-libgcc.mvars.
|
||||
* libgcc/Makefile.in Add crtbeginP.o to EXTRA_PARTS if enable_crtbeginP yes
|
||||
We add new file crtbeginP.o if enable_crtbeginP yes
|
||||
Add -fno-PIE. to CRTSTUFF_CFLAGS.
|
||||
|
||||
--- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
|
||||
+++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
|
||||
@@ -247,6 +247,14 @@ LINKER_FLAGS = $(CFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
+# We don't want to compile the compiler with -fPIE, it make PCH fail.
|
||||
+enable_esp = @enable_esp@
|
||||
+ifeq ($(enable_esp),yes)
|
||||
+ESP_NOPIE_CFLAGS = -fno-PIE
|
||||
+else
|
||||
+ESP_NOPIE_CFLAGS=
|
||||
+endif
|
||||
+
|
||||
# -------------------------------------------
|
||||
# Programs which operate on the build machine
|
||||
# -------------------------------------------
|
||||
@@ -974,12 +982,13 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
|
||||
|
||||
# This is the variable actually used when we compile. If you change this,
|
||||
# you probably want to update BUILD_CFLAGS in configure.ac
|
||||
-ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
|
||||
+ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
|
||||
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
|
||||
|
||||
# The C++ version.
|
||||
-ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
|
||||
- $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
|
||||
+ALL_CXXFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \
|
||||
+ $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \
|
||||
+ $(WARN_CXXFLAGS) @DEFS@
|
||||
|
||||
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
|
||||
# puts -I options in CPPFLAGS, our include files in the srcdir will always
|
||||
@@ -1814,6 +1823,8 @@ libgcc.mvars: config.status Makefile spe
|
||||
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
|
||||
+ echo enable_esp = '$(enable_esp)' >> tmp-libgcc.mvars
|
||||
+ echo enable_crtbeginP = '@enable_crtbeginP@' >> tmp-libgcc.mvars
|
||||
|
||||
mv tmp-libgcc.mvars libgcc.mvars
|
||||
|
||||
--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
|
||||
+++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
|
||||
@@ -219,6 +219,17 @@ else
|
||||
DECNUMINC =
|
||||
endif
|
||||
|
||||
+ifeq ($(enable_esp),yes)
|
||||
+ESP_NOPIE_CFLAGS = -fno-PIE
|
||||
+else
|
||||
+ESP_NOPIE_CFLAGS=
|
||||
+endif
|
||||
+
|
||||
+# We add crtbeginP.o to the EXTRA_PARTS list if enable_crtbeginP = yes
|
||||
+ifeq ($(enable_crtbeginP),yes)
|
||||
+EXTRA_PARTS += crtbeginP.o
|
||||
+endif
|
||||
+
|
||||
# Options to use when compiling libgcc2.a.
|
||||
#
|
||||
LIBGCC2_DEBUG_CFLAGS = -g
|
||||
@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
|
||||
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
|
||||
-finhibit-size-directive -fno-inline -fno-exceptions \
|
||||
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
|
||||
- -fno-stack-protector \
|
||||
+ -fno-stack-protector $(ESP_NOPIE_CFLAGS) \
|
||||
$(INHIBIT_LIBC_CFLAGS)
|
||||
|
||||
# Extra flags to use when compiling crt{begin,end}.o.
|
||||
@@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
|
||||
# This is a version of crtbegin for -static links.
|
||||
crtbeginT$(objext): $(srcdir)/crtstuff.c
|
||||
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
|
||||
+
|
||||
+# This is a version of crtbegin for -static -fPIE links.
|
||||
+ifeq ($(enable_crtbeginP),yes)
|
||||
+crtbeginP$(objext): $(srcdir)/crtstuff.c
|
||||
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
|
||||
+ -c $< -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
|
||||
+endif
|
||||
|
||||
ifeq ($(enable_vtable_verify),yes)
|
||||
# These are used in vtable verification; see comments in source files for
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
2013-03-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/gcc.c include esp.h
|
||||
static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
|
||||
|
||||
--- ./gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
|
||||
+++ ./gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "opts.h"
|
||||
#include "params.h"
|
||||
#include "vec.h"
|
||||
+#include "config/esp.h" /* for --enable-esp support */
|
||||
#include "filenames.h"
|
||||
|
||||
/* By default there is no special suffix for target executables. */
|
||||
@@ -822,7 +823,9 @@
|
||||
|
||||
static const char *asm_debug;
|
||||
static const char *cpp_spec = CPP_SPEC;
|
||||
+#ifndef ENABLE_ESP
|
||||
static const char *cc1_spec = CC1_SPEC;
|
||||
+#endif
|
||||
static const char *cc1plus_spec = CC1PLUS_SPEC;
|
||||
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
|
||||
static const char *link_ssp_spec = LINK_SSP_SPEC;
|
||||
@@ -1,31 +0,0 @@
|
||||
Enable -D_FORTIFY_SOURCE=2 by default.
|
||||
|
||||
Original patch from:
|
||||
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
|
||||
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
+ /* Fortify Source enabled by default w/optimization. */
|
||||
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
|
||||
+
|
||||
/* Misc. */
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
--- a/gcc/doc/gcc.info
|
||||
+++ b/gcc/doc/gcc.info
|
||||
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
|
||||
Please note the warning under '-fgcse' about invoking '-O2' on
|
||||
programs that use computed gotos.
|
||||
|
||||
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
|
||||
+ activated when `-Os' or `-O1' or higher is used. This enables additional
|
||||
+ compile-time and run-time checks for several libc functions. To disable,
|
||||
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
|
||||
+
|
||||
'-O3'
|
||||
Optimize yet more. '-O3' turns on all optimizations specified by
|
||||
'-O2' and also turns on the '-finline-functions',
|
||||
@@ -1,24 +0,0 @@
|
||||
Enable -Wtrampolines by default.
|
||||
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -640,7 +640,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers
|
||||
|
||||
Wtrampolines
|
||||
-Common Var(warn_trampolines) Warning
|
||||
+Common Var(warn_trampolines) Init(1) Warning
|
||||
Warn whenever a trampoline is generated
|
||||
|
||||
Wtype-limits
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -4007,6 +4007,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
|
||||
for most targets, it is made up of code and thus requires the stack
|
||||
to be made executable in order for the program to work properly.
|
||||
|
||||
+ This warning is enabled by default in Gentoo.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
@@ -1,17 +0,0 @@
|
||||
libgfortran does not respect --disable-werror
|
||||
|
||||
https://bugs.gentoo.org/433435
|
||||
http://gcc.gnu.org/PR54724
|
||||
|
||||
|
||||
--- a/libgfortran/configure
|
||||
+++ b/libgfortran/configure
|
||||
@@ -5764,7 +5764,7 @@ fi
|
||||
|
||||
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
|
||||
if test "x$GCC" = "xyes"; then
|
||||
- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
|
||||
+ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
|
||||
## We like to use C99 routines when available. This makes sure that
|
||||
## __STDC_VERSION__ is set such that libc includes make them available.
|
||||
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
|
||||
@@ -1,16 +0,0 @@
|
||||
2012-01-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/common.opt Add -nopie
|
||||
|
||||
--- a/gcc/common.opt 2011-11-23 19:51:17.000000000 +0100
|
||||
+++ b//gcc/common.opt 2012-01-24 16:56:24.302224357 +0100
|
||||
@@ -2280,6 +2280,9 @@ Driver
|
||||
nodefaultlibs
|
||||
Driver
|
||||
|
||||
+nopie
|
||||
+Driver
|
||||
+
|
||||
nostartfiles
|
||||
Driver
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
libgomp does not respect --disable-werror
|
||||
|
||||
https://bugs.gentoo.org/229059
|
||||
http://gcc.gnu.org/PR38436
|
||||
|
||||
|
||||
--- a/libgomp/configure
|
||||
+++ b/libgomp/configure
|
||||
@@ -4282,7 +4282,7 @@ save_CFLAGS="$CFLAGS"
|
||||
|
||||
# Add -Wall -Werror if we are using GCC.
|
||||
if test "x$GCC" = "xyes"; then
|
||||
- XCFLAGS="$XCFLAGS -Wall -Werror"
|
||||
+ XCFLAGS="$XCFLAGS -Wall"
|
||||
fi
|
||||
|
||||
# Find other programs we need.
|
||||
@@ -1,40 +0,0 @@
|
||||
2014-04-23 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/gnu-user.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
|
||||
* gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
|
||||
|
||||
--- a/gcc/config/gnu-user.h 2014-01-02 23:23:26.000000000 +0100
|
||||
+++ b/gcc/config/gnu-user.h 2014-04-23 00:55:06.390265454 +0200
|
||||
@@ -40,7 +40,15 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
provides part of the support for getting C++ file-scope static
|
||||
object constructed before entering `main'. */
|
||||
|
||||
-#if defined HAVE_LD_PIE
|
||||
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
|
||||
+#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
+ crti.o%s %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}; \
|
||||
+ shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
+ %{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_start.o%s}"
|
||||
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
--- a/gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
|
||||
+++ b/gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
|
||||
@@ -883,7 +883,12 @@
|
||||
%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
|
||||
%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
|
||||
|
||||
-#ifdef HAVE_LD_PIE
|
||||
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
|
||||
+#define STARTFILE_LINUX_SPEC "\
|
||||
+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
+%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
+%{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
|
||||
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
|
||||
#define STARTFILE_LINUX_SPEC "\
|
||||
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
@@ -1,44 +0,0 @@
|
||||
2014-04-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
|
||||
-fPIE/-fpie when --enable-esp is enable, this options is on by default.
|
||||
|
||||
--- a/gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
|
||||
+++ b/gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
|
||||
@@ -9233,6 +9245,11 @@ If a guard check fails, an error message
|
||||
@opindex fstack-protector-all
|
||||
Like @option{-fstack-protector} except that all functions are protected.
|
||||
|
||||
+NOTE: NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector},
|
||||
+@option{-nostdlib}, @option{-ffreestanding}, @option{-fstack-protector},
|
||||
+@option{-fstack-protector-strong}or @option{-fstack-protector-all}are found.
|
||||
+
|
||||
@item -fstack-protector-strong
|
||||
@opindex fstack-protector-strong
|
||||
Like @option{-fstack-protector} but includes additional functions to
|
||||
@@ -7960,6 +7965,12 @@
|
||||
that were used to generate code (@option{-fpie}, @option{-fPIE},
|
||||
or model suboptions) when you specify this option.
|
||||
|
||||
+NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
|
||||
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
|
||||
+@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
|
||||
+are found.
|
||||
+
|
||||
@item -rdynamic
|
||||
@opindex rdynamic
|
||||
Pass the flag @option{-export-dynamic} to the ELF linker, on targets
|
||||
@@ -15889,6 +15910,11 @@
|
||||
@code{__pie__} and @code{__PIE__}. The macros have the value 1
|
||||
for @option{-fpie} and 2 for @option{-fPIE}.
|
||||
|
||||
+NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
|
||||
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
|
||||
+@option{-nostartfiles} or @option{-shared} are found.
|
||||
+
|
||||
@item -fno-jump-tables
|
||||
@opindex fno-jump-tables
|
||||
Do not use jump tables for switch statements even where it would be
|
||||
@@ -1,56 +0,0 @@
|
||||
2013-03-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
|
||||
* gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
* gcc/config/i386/i386.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
|
||||
--- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100
|
||||
+++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100
|
||||
@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
/* Static stack checking is supported by means of probes. */
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
+
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
|
||||
+#endif
|
||||
--- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
|
||||
+++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
|
||||
@@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
|
||||
"--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
|
||||
+ ESP_EXTRA_SPECS
|
||||
+#else
|
||||
+#define SUBTARGET_EXTRA_SPECS \
|
||||
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
+#endif
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
|
||||
--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
|
||||
+++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
|
||||
@@ -617,13 +617,16 @@ enum target_cpu_default
|
||||
Do not define this macro if it does not need to do anything. */
|
||||
|
||||
#ifndef SUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
|
||||
+#else
|
||||
#define SUBTARGET_EXTRA_SPECS
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define EXTRA_SPECS \
|
||||
{ "cc1_cpu", CC1_CPU_SPEC }, \
|
||||
SUBTARGET_EXTRA_SPECS
|
||||
-
|
||||
|
||||
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
|
||||
FPU, assume that the fpcw is set to extended precision; when using
|
||||
@@ -1,35 +0,0 @@
|
||||
2013-06-03 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
|
||||
* gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
|
||||
--- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100
|
||||
+++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100
|
||||
@@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu
|
||||
# define MCPU_MTUNE_NATIVE_SPECS ""
|
||||
#endif
|
||||
|
||||
-#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
|
||||
-
|
||||
+#ifdef ENABLE_ESP
|
||||
+# define DRIVER_SELF_SPECS \
|
||||
+ MCPU_MTUNE_NATIVE_SPECS, \
|
||||
+ ESP_DRIVER_SELF_SPEC
|
||||
+#else
|
||||
+# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
|
||||
+#endif
|
||||
#endif /* ! GCC_ARM_H */
|
||||
--- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100
|
||||
+++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200
|
||||
@@ -49,7 +49,11 @@
|
||||
#endif
|
||||
|
||||
#undef SUBSUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
|
||||
+#else
|
||||
#define SUBSUBTARGET_EXTRA_SPECS
|
||||
+#endif
|
||||
|
||||
#ifndef ASM_SPEC
|
||||
#define ASM_SPEC "\
|
||||
@@ -1,135 +0,0 @@
|
||||
2014-05-12 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/esp.h New file to support --enable-esp
|
||||
Version 20140512.1
|
||||
|
||||
--- a/gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200
|
||||
+++ b/gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200
|
||||
@@ -0,0 +1,127 @@
|
||||
+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
|
||||
+ * Version 20140512.1
|
||||
+ * Magnus Granberg (Zorry) <zorry@gentoo.org> */
|
||||
+#ifndef GCC_ESP_H
|
||||
+#define GCC_ESP_H
|
||||
+
|
||||
+/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
|
||||
+ as default if the defines and the spec allow it.
|
||||
+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
|
||||
+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
|
||||
+ This will add some unsupported upstream commands options as -nopie and -nonow.
|
||||
+ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check when building kernels.
|
||||
+ ESP_CC1_SPEC is added to CC1_SPEC.
|
||||
+ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
|
||||
+ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
|
||||
+ ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
|
||||
+*/
|
||||
+#ifdef ENABLE_ESP
|
||||
+
|
||||
+ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
|
||||
+ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
|
||||
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
|
||||
+ #else
|
||||
+ #define ESP_CC1_SSP_SPEC ""
|
||||
+ #endif
|
||||
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_CC1_PIE_SPEC "%{!nopie: }"
|
||||
+ #else
|
||||
+ #define ESP_CC1_PIE_SPEC ""
|
||||
+ #endif
|
||||
+ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
|
||||
+
|
||||
+ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
|
||||
+ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
|
||||
+ Don't remove the specs in the end */
|
||||
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
|
||||
+ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
|
||||
+
|
||||
+ /* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
|
||||
+ #define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
|
||||
+ %(esp_link_pie)} %(esp_options_ssp) }"
|
||||
+
|
||||
+ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
+ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
|
||||
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_OPTIONS_SSP_SPEC \
|
||||
+ "%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
|
||||
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
|
||||
+ %{fstack-check|fstack-check=*:;: -fstack-check}"
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_SSP_SPEC ""
|
||||
+ #endif
|
||||
+
|
||||
+ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
|
||||
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
|
||||
+
|
||||
+ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
|
||||
+ -nostdlib -nostartfiles. */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_OPTIONS_PIE_SPEC \
|
||||
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
|
||||
+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_PIE_SPEC \
|
||||
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
|
||||
+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
|
||||
+ -nostartfiles */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static
|
||||
+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_LINK_PIE_SPEC \
|
||||
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
|
||||
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
|
||||
+ #else
|
||||
+ #define ESP_LINK_PIE_SPEC \
|
||||
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
|
||||
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
|
||||
+ "-pie and (static)|pg|p|profile are incompatible when linking" */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC \
|
||||
+ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
|
||||
+ #else
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC \
|
||||
+ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* We don't pass -pie to the linker when -static. */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
|
||||
+ #else
|
||||
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
|
||||
+ #endif
|
||||
+
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_PIE_SPEC ""
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC ""
|
||||
+ #define ESP_LINK_PIE_SPEC ""
|
||||
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
|
||||
+ #endif
|
||||
+
|
||||
+ /* We add extra spec name's to the EXTRA_SPECS list */
|
||||
+ #define ESP_EXTRA_SPECS \
|
||||
+ { "esp_cc1", ESP_CC1_SPEC }, \
|
||||
+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
|
||||
+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
|
||||
+ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
|
||||
+ { "esp_link", ESP_LINK_SPEC }, \
|
||||
+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \
|
||||
+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
|
||||
+ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
|
||||
+ { "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
|
||||
+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
|
||||
+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
|
||||
+
|
||||
+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
|
||||
+
|
||||
+#endif
|
||||
+#endif /* End GCC_ESP_H */
|
||||
@@ -1,67 +0,0 @@
|
||||
Apply Alpine Linux specific differences to Gentoo ESP configuration:
|
||||
- default PIE and SSP by default without additional CFLAGS (to clean up APKBUILD)
|
||||
- do not enable -fstack-check by default (caused failures in programs that setup
|
||||
small stack in musl)
|
||||
- enable -z relro by default
|
||||
- enable -fstack-protector-strong instead of -fstack-protector-all by default
|
||||
|
||||
--- gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:54:19.925060848 +0000
|
||||
+++ gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:59:16.793850060 +0000
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef GCC_ESP_H
|
||||
#define GCC_ESP_H
|
||||
|
||||
-/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
|
||||
+/* This file will add -fstack-protector-strong, -fPIE, -pie, -z relro and -z now
|
||||
as default if the defines and the spec allow it.
|
||||
Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
|
||||
to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
|
||||
@@ -16,11 +16,14 @@
|
||||
ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
|
||||
*/
|
||||
#ifdef ENABLE_ESP
|
||||
+
|
||||
+ /* Enable by default on Alpine */
|
||||
+ #define EFAULT_PIE_SSP
|
||||
|
||||
/* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
|
||||
#define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
|
||||
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
- #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
|
||||
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
|
||||
#else
|
||||
#define ESP_CC1_SSP_SPEC ""
|
||||
#endif
|
||||
@@ -34,20 +37,20 @@
|
||||
/* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
|
||||
-z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
|
||||
Don't remove the specs in the end */
|
||||
- #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
|
||||
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_relro) %(esp_link_pie_check) "
|
||||
#define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
|
||||
+ #define ESP_LINK_RELRO_SPEC "%{!norelro:-z relro}"
|
||||
|
||||
/* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
|
||||
#define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
|
||||
%(esp_link_pie)} %(esp_options_ssp) }"
|
||||
|
||||
- /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
+ /* This will add -fstack-protector-strong if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
-fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
|
||||
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
#define ESP_OPTIONS_SSP_SPEC \
|
||||
"%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
|
||||
- fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
|
||||
- %{fstack-check|fstack-check=*:;: -fstack-check}"
|
||||
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-strong}"
|
||||
#else
|
||||
#define ESP_OPTIONS_SSP_SPEC ""
|
||||
#endif
|
||||
@@ -115,6 +118,7 @@
|
||||
{ "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
|
||||
{ "esp_link", ESP_LINK_SPEC }, \
|
||||
{ "esp_link_now", ESP_LINK_NOW_SPEC }, \
|
||||
+ { "esp_link_relro", ESP_LINK_RELRO_SPEC }, \
|
||||
{ "esp_link_pie", ESP_LINK_PIE_SPEC }, \
|
||||
{ "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
|
||||
{ "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
|
||||
@@ -1,28 +0,0 @@
|
||||
libitm checks for AVX support in the assembler and adds -mavx to x86_avx.cc
|
||||
which defines the needed typedefs. User CFLAGS can override -mavx however,
|
||||
so also use the fallback typedef if __AVX__ isn't defined.
|
||||
|
||||
https://bugs.gentoo.org/417271
|
||||
http://gcc.gnu.org/PR53113
|
||||
|
||||
|
||||
--- a/libitm/config/x86/x86_avx.cc
|
||||
+++ b/libitm/config/x86/x86_avx.cc
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
-#ifndef HAVE_AS_AVX
|
||||
+#if !defined (HAVE_AS_AVX) || !defined(__AVX__)
|
||||
// If we don't have an AVX capable assembler, we didn't set -mavx on the
|
||||
// command-line either, which means that libitm.h defined neither this type
|
||||
// nor the functions in this file. Define the type and unconditionally
|
||||
@@ -40,7 +40,7 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias));
|
||||
// Re-define the memcpy implementations so that we can frob the
|
||||
// interface to deal with possibly missing AVX instruction set support.
|
||||
|
||||
-#ifdef HAVE_AS_AVX
|
||||
+#if defined(HAVE_AS_AVX) && defined(__AVX__)
|
||||
#define RETURN(X) return X
|
||||
#define STORE(X,Y) X = Y
|
||||
#define OUTPUT(T) _ITM_TYPE_##T
|
||||
@@ -1,18 +0,0 @@
|
||||
2008-07-25 Magnus Granberg <zorry@ume.nu>
|
||||
|
||||
* include/libiberty.h (asprintf): Don't declare if defined as a macro
|
||||
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if !HAVE_DECL_VASPRINTF
|
||||
/* Like vsprintf but provides a pointer to malloc'd storage, which
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 29 Mar 2013 08:59:00 +0400
|
||||
Subject: [PATCH 16/35] gcc: poison-system-directories
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Inappropriate [distribution: codesourcery]
|
||||
---
|
||||
gcc/Makefile.in | 2 +-
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/configure | 20 ++++++++++++++++++--
|
||||
gcc/configure.ac | 10 ++++++++++
|
||||
gcc/doc/invoke.texi | 9 +++++++++
|
||||
gcc/gcc.c | 2 ++
|
||||
gcc/incpath.c | 19 +++++++++++++++++++
|
||||
8 files changed, 69 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: gcc-4.9-20140316/gcc/common.opt
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/common.opt
|
||||
+++ gcc-4.9-20140316/gcc/common.opt
|
||||
@@ -603,6 +603,10 @@ Wpedantic
|
||||
Common Var(pedantic) Warning
|
||||
Issue warnings needed for strict compliance to the standard
|
||||
|
||||
+Wpoison-system-directories
|
||||
+Common Var(flag_poison_system_directories) Init(1) Warning
|
||||
+Warn for -I and -L options using system directories if cross compiling
|
||||
+
|
||||
Wshadow
|
||||
Common Var(warn_shadow) Warning
|
||||
Warn when one local variable shadows another
|
||||
Index: gcc-4.9-20140316/gcc/config.in
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/config.in
|
||||
+++ gcc-4.9-20140316/gcc/config.in
|
||||
@@ -138,6 +138,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to warn for use of native system header directories */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if you want all operations on RTL (the basic data structure of the
|
||||
optimizer and back end) to be checked for dynamic type safety at runtime.
|
||||
This is quite expensive. */
|
||||
Index: gcc-4.9-20140316/gcc/configure
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/configure
|
||||
+++ gcc-4.9-20140316/gcc/configure
|
||||
@@ -928,6 +928,7 @@ with_system_zlib
|
||||
enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1648,6 +1649,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
+ --enable-poison-system-directories
|
||||
+ warn for use of native system header directories
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-poison-system-directories was given.
|
||||
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||
+ enableval=$enable_poison_system_directories;
|
||||
+else
|
||||
+ enable_poison_system_directories=no
|
||||
+fi
|
||||
+
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
|
||||
|
||||
Index: gcc-4.9-20140316/gcc/configure.ac
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/configure.ac
|
||||
+++ gcc-4.9-20140316/gcc/configure.ac
|
||||
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
+AC_ARG_ENABLE([poison-system-directories],
|
||||
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||
+ [warn for use of native system header directories]),,
|
||||
+ [enable_poison_system_directories=no])
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||
+ [1],
|
||||
+ [Define to warn for use of native system header directories])
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
Index: gcc-4.9-20140316/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
|
||||
+++ gcc-4.9-20140316/gcc/doc/invoke.texi
|
||||
@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
|
||||
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
|
||||
-Wpointer-arith -Wno-pointer-to-int-cast @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wredundant-decls -Wno-return-local-addr @gol
|
||||
-Wreturn-type -Wsequence-point -Wshadow @gol
|
||||
-Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
|
||||
@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
|
||||
for most targets, it is made up of code and thus requires the stack
|
||||
to be made executable in order for the program to work properly.
|
||||
|
||||
+@item -Wno-poison-system-directories
|
||||
+@opindex Wno-poison-system-directories
|
||||
+Do not warn for @option{-I} or @option{-L} options using system
|
||||
+directories such as @file{/usr/include} when cross compiling. This
|
||||
+option is intended for use in chroot environments when such
|
||||
+directories contain the correct headers and libraries for the target
|
||||
+system rather than the host.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
Index: gcc-4.9-20140316/gcc/gcc.c
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/gcc.c
|
||||
+++ gcc-4.9-20140316/gcc/gcc.c
|
||||
@@ -764,6 +764,8 @@ proper position among the other output f
|
||||
"%{fuse-ld=*:-fuse-ld=%*}\
|
||||
%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories}\
|
||||
+ %{Werror=poison-system-directories:--error-poison-system-directories}\
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
|
||||
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
|
||||
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
|
||||
Index: gcc-4.9-20140316/gcc/incpath.c
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/incpath.c
|
||||
+++ gcc-4.9-20140316/gcc/incpath.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
@@ -1,483 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen gcc4-aarch64
|
||||
# Based on: main/gcc4 (from postmarketOS)
|
||||
|
||||
CTARGET_ARCH=aarch64
|
||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||
# when this variable matches "no*"
|
||||
BOOTSTRAP="nobuildbase"
|
||||
|
||||
# abuild will only cross compile when this variable is set, but it
|
||||
# needs to find a valid package database in there for dependency
|
||||
# resolving, so we set it to /.
|
||||
CBUILDROOT="/"
|
||||
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname="gcc4-aarch64"
|
||||
pkgver=9999
|
||||
_pkgver=4.9.2
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="http://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
license="GPL LGPL"
|
||||
_gccrel=$_pkgver-r$pkgrel
|
||||
depends="isl binutils-aarch64 mpc1"
|
||||
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
||||
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
|
||||
subpackages=""
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# We only care about C, so we can compile old Linux kernels
|
||||
LANG_CXX=false
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
|
||||
LIBGOMP="false"
|
||||
LIBGCC="false"
|
||||
LIBATOMIC="false"
|
||||
LIBITM="false"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||
LANG_CXX=false
|
||||
LANG_ADA=false
|
||||
LIBGCC=false
|
||||
_builddir="$srcdir/build-cross-pass2"
|
||||
else
|
||||
_builddir="$srcdir/build-cross-final"
|
||||
fi
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LIBGOMP=false
|
||||
LIBATOMIC=false
|
||||
LIBITM=false
|
||||
|
||||
# reset target flags (should be set in crosscreate abuild)
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
STRIP_FOR_TARGET="$CTARGET-strip"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
|
||||
# reset flags and cc for build
|
||||
export CC_FOR_BUILD="gcc"
|
||||
export CXX_FOR_BUILD="g++"
|
||||
export CFLAGS_FOR_BUILD=" "
|
||||
export CXXFLAGS_FOR_BUILD=" "
|
||||
export LDFLAGS_FOR_BUILD=" "
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
# Languages that do not need bootstrapping
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build-cross-native"
|
||||
else
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build"
|
||||
fi
|
||||
|
||||
# Go needs {set,make,swap}context, unimplemented in musl
|
||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
||||
|
||||
# libitm has TEXTRELs in ARM build, so disable for now
|
||||
case "$CTARGET_ARCH" in
|
||||
arm*) LIBITM=false ;;
|
||||
mips*) LIBITM=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
# currently on x86, x86_64 and ia64
|
||||
LIBQUADMATH=$LANG_FORTRAN
|
||||
case "$CTARGET_ARCH" in
|
||||
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
|
||||
*) LIBQUADMATH=false ;;
|
||||
esac
|
||||
|
||||
# libatomic is a dependency for openvswitch
|
||||
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||
if $LIBGOMP; then
|
||||
depends="$depends libgomp=$_gccrel"
|
||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||
fi
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
fi
|
||||
if $LANG_OBJC; then
|
||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||
_languages="$_languages,objc"
|
||||
fi
|
||||
if $LANG_JAVA; then
|
||||
subpackages="$subpackages libgcj::$CTARGET_ARCH gcc-java$_target:java"
|
||||
_languages="$_languages,java"
|
||||
fi
|
||||
if $LANG_GO; then
|
||||
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
||||
_languages="$_languages,go"
|
||||
fi
|
||||
if $LANG_FORTRAN; then
|
||||
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
||||
_languages="$_languages,fortran"
|
||||
fi
|
||||
if $LANG_ADA; then
|
||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
||||
_languages="$_languages,ada"
|
||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||
fi
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
|
||||
source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkgbase:-$_pkgver}.tar.gz
|
||||
http://sourceware.org/pub/java/ecj-4.9.jar
|
||||
|
||||
01_all_gcc49_configure.patch
|
||||
02_all_gcc48_config.in.patch
|
||||
03_all_gcc49_Makefile.in.patch
|
||||
05_all_gcc48_gcc.c.patch
|
||||
16_all_gcc47_nopie_option.patch
|
||||
20_all_gcc49_config_crtbeginp.patch
|
||||
24_all_gcc49_invoke.texi.patch
|
||||
34_all_gcc48_config_i386.patch
|
||||
35_all_gcc48_config_arm.patch
|
||||
40_all_gcc49_config_esp.patch
|
||||
41_all_gcc49_config_esp_alpine.patch
|
||||
|
||||
10_all_default-fortify-source.patch
|
||||
12_all_default-warn-trampolines.patch
|
||||
15_all_libgfortran-Werror.patch
|
||||
16_all_libgomp-Werror.patch
|
||||
48_all_x86_pr53113_libitm-avx.patch
|
||||
50_all_libiberty-asprintf.patch
|
||||
51_all_libiberty-pic.patch
|
||||
67_all_gcc-poison-system-directories.patch
|
||||
|
||||
gcc49-cloog-dl.patch
|
||||
gcc-ice-hack.patch
|
||||
gcc-spec-env.patch
|
||||
libgcc-always-build-gcceh.a.patch
|
||||
gcc-4.6-pr32219.patch
|
||||
gcc-4.9-musl.patch
|
||||
gcc-4.8-musl-fix-iteratephdr.patch
|
||||
gcc-4.8-musl-libssp.patch
|
||||
gcc-4.9-musl-fortify.patch
|
||||
boehm-gc-uclibc.patch
|
||||
boehm-gc-musl.patch
|
||||
gcc-pure64.patch
|
||||
fix-gcj-musl.patch
|
||||
fix-gcj-iconv-musl.patch
|
||||
musl-posix_memalign-c++.patch
|
||||
pr63740.patch
|
||||
pr64037.patch
|
||||
|
||||
gcc-4.8-build-args.patch
|
||||
fix-cxxflags-passing.patch
|
||||
fix-cxxflags-for-target.patch
|
||||
ada-no-pie.patch
|
||||
ada-fixes.patch
|
||||
ada-shared.patch
|
||||
ada-musl.patch
|
||||
|
||||
vanilla.specs
|
||||
hardenednossp.specs
|
||||
hardenednopie.specs
|
||||
hardenednopiessp.specs
|
||||
"
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$_pkgver}
|
||||
_gcclibdir=/usr/lib/gcc/${CTARGET}/$_pkgver
|
||||
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$_pkgver
|
||||
|
||||
prepare() {
|
||||
cd "$_gccdir"
|
||||
|
||||
_err=
|
||||
for i in $source; do
|
||||
case "$i" in
|
||||
*.patch)
|
||||
msg "Applying $i"
|
||||
patch -p1 -F3 -i "$srcdir"/$i || _err="$_err $i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$_err" ]; then
|
||||
error "The following patches failed:"
|
||||
for i in $_err; do
|
||||
echo " $i"
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
# see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
|
||||
mv "$srcdir"/ecj-*.jar ecj.jar
|
||||
|
||||
echo ${_pkgver} > gcc/BASE-VER
|
||||
}
|
||||
|
||||
build() {
|
||||
local _arch_configure=
|
||||
local _libc_configure=
|
||||
local _bootstrap_configure=
|
||||
local _symvers=
|
||||
|
||||
cd "$_gccdir"
|
||||
|
||||
case "$CTARGET" in
|
||||
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
||||
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
||||
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
||||
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
||||
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
||||
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_LIBC" in
|
||||
musl)
|
||||
# musl does not support mudflap, or libsanitizer
|
||||
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
||||
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
||||
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
||||
_symvers="--disable-symvers"
|
||||
export libat_cv_have_ifunc=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "$BOOTSTRAP" in
|
||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||
esac
|
||||
|
||||
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||
|
||||
msg "Building the following:"
|
||||
echo ""
|
||||
echo " CBUILD=$CBUILD"
|
||||
echo " CHOST=$CHOST"
|
||||
echo " CTARGET=$CTARGET"
|
||||
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
||||
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
||||
echo " languages=$_languages"
|
||||
echo " arch_configure=$_arch_configure"
|
||||
echo " libc_configure=$_libc_configure"
|
||||
echo " cross_configure=$_cross_configure"
|
||||
echo " bootstrap_configure=$_bootstrap_configure"
|
||||
echo " hash_style_configure=$_hash_style_configure"
|
||||
echo ""
|
||||
|
||||
mkdir -p "$_builddir"
|
||||
cd "$_builddir"
|
||||
"$_gccdir"/configure --prefix=/usr/gcc4 \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--build=${CBUILD} \
|
||||
--host=${CHOST} \
|
||||
--target=${CTARGET} \
|
||||
--with-pkgversion="postmarketOS ${_pkgver}" \
|
||||
--enable-checking=release \
|
||||
--disable-fixed-point \
|
||||
--disable-libstdcxx-pch \
|
||||
\
|
||||
--disable-bootstrap \
|
||||
--disable-libstdcxx \
|
||||
\
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
$_symvers \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-default-pie \
|
||||
--enable-cloog-backend \
|
||||
--enable-languages=$_languages \
|
||||
$_arch_configure \
|
||||
$_libc_configure \
|
||||
$_cross_configure \
|
||||
$_bootstrap_configure \
|
||||
--with-system-zlib \
|
||||
$_hash_style_configure
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make -j1 DESTDIR="${pkgdir}" install
|
||||
|
||||
local prefix=/usr/gcc4
|
||||
if [ "$CHOST" = "$CTARGET" ]; then
|
||||
# gcc symlinks
|
||||
ln -s gcc "$pkgdir$prefix"/bin/cc
|
||||
ln -s gcc "$pkgdir$prefix"/bin/gcc4
|
||||
fi
|
||||
|
||||
# remove docs
|
||||
rm -r "$pkgdir/usr/share/"
|
||||
|
||||
# we don't support gcj -static
|
||||
# and saving 35MB is not bad.
|
||||
find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
|
||||
-o -name libgjsmalsa.a -o -name libgcj-tools.a \
|
||||
-o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
|
||||
-o -name libjavamath.a \
|
||||
| xargs rm -f
|
||||
|
||||
# strip debug info from some static libs
|
||||
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||
-a -type f`
|
||||
|
||||
if $LANG_JAVA; then
|
||||
sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
|
||||
"$pkgdir"/usr/lib/libgcj.spec
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# cross-gcc: remove any files that would conflict with the
|
||||
# native gcc package
|
||||
rm -rf "$pkgdir$prefix"/bin/cc \
|
||||
"$pkgdir$prefix"/include \
|
||||
"$pkgdir$prefix"/share
|
||||
# libcc1 does not depend on target, don't ship it
|
||||
rm -rf "$pkgdir$prefix"/lib/libcc1.so*
|
||||
|
||||
# fixup gcc library symlinks to be linker scripts so
|
||||
# linker finds the libs from relocated sysroot
|
||||
for so in "$pkgdir$prefix"/$CTARGET/lib/*.so; do
|
||||
if [ -h "$so" ]; then
|
||||
local _real=$(basename $(readlink "$so"))
|
||||
rm -f "$so"
|
||||
echo "GROUP ($_real)" > "$so"
|
||||
fi
|
||||
done
|
||||
|
||||
# Link binutils binaries to /usr/gcc4
|
||||
# This is the path GCC4 will look for them, if we don't create these
|
||||
# symlinks, it will use the native binutils instead (which is of course
|
||||
# failing and causes many headaches). See also: '-B' in 'man gcc'.
|
||||
echo "Link binutils binaries to /usr/gcc4"
|
||||
mkdir -p "$pkgdir$prefix/$CTARGET/bin"
|
||||
for i in "as" "ld"; do
|
||||
ln -sv "/usr/$CTARGET/bin/$i" \
|
||||
"$pkgdir$prefix/$CTARGET/bin/$i"
|
||||
done
|
||||
|
||||
# Link binutils to gcc4-* (so 'CROSS_COMPILE=gcc4-...' works)
|
||||
echo "Link binutils to gcc4-*"
|
||||
mkdir -p "$pkgdir/usr/bin"
|
||||
for i in "elfedit" "gprof" "addr2line" "strings" "as" "ld" "size" "ld.bfd" \
|
||||
"readelf" "nm" "ar" "strip" "dwp" "objdump" "objcopy" "c++filt" "ranlib"; do
|
||||
ln -sv "/usr/bin/$CTARGET-$i" \
|
||||
"$pkgdir/usr/bin/gcc4-$CTARGET-$i"
|
||||
done
|
||||
fi
|
||||
|
||||
# Link all binaries from /usr/gcc4/bin/* to /usr/bin/gcc4-*
|
||||
echo "Link all gcc binaries to /usr/bin/gcc4-*"
|
||||
mkdir -p "$pkgdir"/usr/bin
|
||||
cd "$pkgdir$prefix/bin/"
|
||||
for i in *; do
|
||||
ln -sv "$prefix/bin/$i" "$pkgdir/usr/bin/gcc4-$i"
|
||||
done
|
||||
}
|
||||
|
||||
sha512sums="35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
|
||||
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
|
||||
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
|
||||
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
|
||||
3afe2cc407b5440333d9517daca3257e08a7318695d20645a9186cafac53afa6d0c075af67398ff7abd06250567cc6c751e6dabb65a310eef9a5d981e910aa25 03_all_gcc49_Makefile.in.patch
|
||||
e98cc321d71e5bb62c6116b30ed6f11044bda440e238026a83dec63f04a0587440bdae50ec211b07976fcd9deb329f9dd1dac1317dae5003088a8a8bddbb97c1 05_all_gcc48_gcc.c.patch
|
||||
98a4da3137177c5cad7dd7d35ad39cd416aa36f07867714e09ab8c0d8b759d2659063aa87b16ac1b708a283afd2ac54e20b327a32d1147720996d7bc11dcbd63 16_all_gcc47_nopie_option.patch
|
||||
8fc6f2fd921c560fb1d7ba17b5cef4ea8071ee6909d372e41201667c011f948560fa543b1246cf55c0009622abf0dbc0bd79f718a853f2f0b59290e3df2c2968 20_all_gcc49_config_crtbeginp.patch
|
||||
32bfe9c1f6f566de72c93388622001ff4b95086ea6f476bdfc08403ea474f98212f7396bc75d88a79a053159f78dca922ec6f641f83d9959ad419b0d8901b504 24_all_gcc49_invoke.texi.patch
|
||||
dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec88aae5463763f5f64454b8a627ebd1d0a5c92984017025ad 34_all_gcc48_config_i386.patch
|
||||
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
|
||||
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
|
||||
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
|
||||
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
|
||||
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
|
||||
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
|
||||
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
|
||||
ff16f259fff8d78230593eee8641eab5a72c5c517c6ac5f09597edbc624d964b33f185a0dd5772d6029f757a5edb66431b3eab77dac71e76a0ef155bb7443d2c 48_all_x86_pr53113_libitm-avx.patch
|
||||
c6c314a2d24531b4286436dec7189f83e443c4cfa9b88339a4c324c2d40812d766ed44dcfd4a0c3b67695bb76969a4d8a9784ff95876ceba23def305ef8a48f8 50_all_libiberty-asprintf.patch
|
||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 51_all_libiberty-pic.patch
|
||||
9b623a0b00254326596a56fff23dacc97e560823ebdf35698799fc7ab5e98984c71b7ddfceeb1589bbbdd1ba89a742cd7becf8f70f0081dfc26bcef4198b1b5d 67_all_gcc-poison-system-directories.patch
|
||||
9c6aa6d7f096c3aaebbe21d52967872195aea130b51d60a1934255b00bf1b23d24ec598c7763152f987f7999da9e56f512d169958666a3133641de3780a75d3f gcc49-cloog-dl.patch
|
||||
7242876e4bba34235f6f3ea960d72439638bd31547284ca96cb94c97a2d46dd7b38a3709fd159cf86efa1e8a44e3e9125fe82bc3a1cc71153591755827d6c9fd gcc-ice-hack.patch
|
||||
ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 gcc-spec-env.patch
|
||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
||||
9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch
|
||||
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
|
||||
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
|
||||
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
|
||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
||||
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
|
||||
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
|
||||
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
|
||||
f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch
|
||||
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
|
||||
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
|
||||
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
|
||||
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
|
||||
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
|
||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
||||
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
|
||||
e80a08de4b43fb71f7699bcce360cd99bc525dab20b9109e7152bd211def5d8e728f88771ed59f15ed520cbf069364debc4f822c10a1abf7e2c7badd67e1c83c ada-no-pie.patch
|
||||
b37195a126476775e2ef16e0adc9173664c514339fb319f628debd8a4133fa53e022278387c68fc260cf813e58602617e9e629ea8177133bfdf5972398fe1c55 ada-fixes.patch
|
||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
||||
76d7d35066534c332956a88da84a95c8c54c6e0742c3c46e6b256395bf67f7c167b5ecd47fbed697fb1c9d7a41016c99e7dcd06465516a0e963707a0eab8f8b6 ada-musl.patch
|
||||
83a0996a48096032bcc674a6d28524f1cd2d81837621ebe4c15b5aedbd551c77ce5576b6307adb673ef0e4ac0431d935ad6a427edca2af5c21b6be9176bfaddb vanilla.specs
|
||||
e4d38905527c500c61c421d782a8ac6ef2b034b15fd81d868486ac330a70922937d3c47e0684e9f3250744569b56a8df199499a4a5c107a6d544dca84458dc12 hardenednossp.specs
|
||||
b56f7c308c5aefd0cfc647abd75939508a6640c53fce7c19da7c7d8ef4405d29b0d88800117fc7ff8d0022b035d511fb6d478e745bb2ed12a1b63f9f8cf3e168 hardenednopie.specs
|
||||
f5ac7282201006548ed2bd835234af64d6f79f13f0b9a3410f5c794537e0ea91601361ae72180f49870b6b0f9af5f16002c86660feb94df346b9b1d9602e9d3a hardenednopiessp.specs"
|
||||
@@ -1,44 +0,0 @@
|
||||
--- gcc-4.8.1/gcc/ada/terminals.c.orig
|
||||
+++ gcc-4.8.1/gcc/ada/terminals.c
|
||||
@@ -984,13 +984,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
-/* On some system termio is either absent or including it will disable termios
|
||||
- (HP-UX) */
|
||||
-#if ! defined (__hpux__) && ! defined (FREEBSD) && \
|
||||
- ! defined (__APPLE__) && ! defined(__rtems__)
|
||||
-# include <termio.h>
|
||||
-#endif
|
||||
-
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
@@ -1078,7 +1078,7 @@
|
||||
char *slave_name = NULL;
|
||||
|
||||
#ifdef USE_GETPT
|
||||
- master_fd = getpt ();
|
||||
+ master_fd = posix_openpt (O_RDWR);
|
||||
#elif defined (USE_OPENPTY)
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
@@ -1179,7 +1170,7 @@
|
||||
int status;
|
||||
|
||||
/* ensure that s is filled with 0 */
|
||||
- bzero (&s, sizeof (&s));
|
||||
+ bzero (&s, sizeof (s));
|
||||
|
||||
/* Get the current terminal settings */
|
||||
status = tcgetattr (fd, &s);
|
||||
--- gcc-4.8.1/gcc/ada/cal.c.orig
|
||||
+++ gcc-4.8.1/gcc/ada/cal.c
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
+#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
@@ -1,136 +0,0 @@
|
||||
diff -ru gcc-4.9.2/gcc/ada/adaint.c gcc-4.9.2/gcc/ada/adaint.c
|
||||
--- gcc-4.9.2/gcc/ada/adaint.c 2014-02-24 18:51:58.000000000 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/adaint.c 2014-12-10 12:05:44.621173474 -0200
|
||||
@@ -67,6 +67,11 @@
|
||||
#include <sys/pstat.h>
|
||||
#endif
|
||||
|
||||
+#if defined (linux)
|
||||
+#define _GNU_SOURCE 1
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
+
|
||||
#ifdef VMS
|
||||
#define _POSIX_EXIT 1
|
||||
#define HOST_EXECUTABLE_SUFFIX ".exe"
|
||||
@@ -3891,8 +3896,6 @@
|
||||
return (void *) syscall (__NR_gettid);
|
||||
}
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
/* glibc versions earlier than 2.7 do not define the routines to handle
|
||||
dynamically allocated CPU sets. For these targets, we use the static
|
||||
versions. */
|
||||
@@ -3901,7 +3904,7 @@
|
||||
|
||||
/* Dynamic cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count)
|
||||
{
|
||||
return CPU_ALLOC (count);
|
||||
@@ -3914,33 +3917,33 @@
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
- CPU_FREE (set);
|
||||
+ CPU_FREE ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count, void *set)
|
||||
{
|
||||
- CPU_ZERO_S (count, set);
|
||||
+ CPU_ZERO_S (count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET_S (cpu - 1, count, set);
|
||||
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
#else /* !CPU_ALLOC */
|
||||
|
||||
/* Static cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
|
||||
+ return xmalloc (sizeof (cpu_set_t));
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -3950,23 +3953,23 @@
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
free (set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
- CPU_ZERO (set);
|
||||
+ CPU_ZERO ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET (cpu - 1, set);
|
||||
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
|
||||
}
|
||||
#endif /* !CPU_ALLOC */
|
||||
#endif /* linux */
|
||||
diff -ru gcc-4.9.2/gcc/ada/adaint.h gcc-4.9.2/gcc/ada/adaint.h
|
||||
--- gcc-4.9.2/gcc/ada/adaint.h 2014-02-24 18:51:58.000000000 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/adaint.h 2014-12-10 12:03:48.377834174 -0200
|
||||
@@ -266,13 +266,11 @@
|
||||
|
||||
/* Routines for interface to required CPU set primitives */
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
|
||||
+extern void * __gnat_cpu_alloc (size_t);
|
||||
extern size_t __gnat_cpu_alloc_size (size_t);
|
||||
-extern void __gnat_cpu_free (cpu_set_t *);
|
||||
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
|
||||
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
|
||||
+extern void __gnat_cpu_free (void *);
|
||||
+extern void __gnat_cpu_zero (size_t, void *);
|
||||
+extern void __gnat_cpu_set (int, size_t, void *);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-12-11 08:16:33.364902456 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-11 08:16:51.998236755 -0200
|
||||
@@ -1948,7 +1948,7 @@
|
||||
endif
|
||||
|
||||
# ARM linux, GNU eabi
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
|
||||
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
@@ -1,66 +0,0 @@
|
||||
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-05-17 13:13:12.000000000 -0300
|
||||
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-10 12:01:32.304493855 -0200
|
||||
@@ -2570,23 +2570,23 @@
|
||||
gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
|
||||
gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
|
||||
$(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
|
||||
../../gnatsym$(exeext): ../stamp-tools
|
||||
$(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
@@ -2608,7 +2608,7 @@
|
||||
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
|
||||
$(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
|
||||
# Note the use of the "mv" command in order to allow gnatlink to be linked with
|
||||
# with the former version of gnatlink itself which cannot override itself.
|
||||
@@ -2618,7 +2618,7 @@
|
||||
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
|
||||
$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
|
||||
|
||||
# Needs to be built with CC=gcc
|
||||
@@ -2627,10 +2627,10 @@
|
||||
|
||||
# Likewise for the tools
|
||||
../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
|
||||
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
|
||||
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
|
||||
|
||||
../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
|
||||
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
|
||||
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
|
||||
|
||||
../stamp-gnatlib-$(RTSDIR):
|
||||
@if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
|
||||
@@ -1,30 +0,0 @@
|
||||
Index: b/gcc/ada/link.c
|
||||
===================================================================
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -105,9 +105,9 @@
|
||||
|
||||
#elif defined (__FreeBSD__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -127,9 +127,9 @@
|
||||
|
||||
#elif defined (linux) || defined(__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -1,62 +0,0 @@
|
||||
--- gcc-4.8.1/boehm-gc/os_dep.c.orig 2013-09-17 07:46:00.969884340 +0000
|
||||
+++ gcc-4.8.1/boehm-gc/os_dep.c 2013-09-17 06:53:53.629884946 +0000
|
||||
@@ -26,7 +26,7 @@
|
||||
# define __KERNEL__
|
||||
# include <asm/signal.h>
|
||||
# undef __KERNEL__
|
||||
-# else
|
||||
+# elif defined(__GLIBC__)
|
||||
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
|
||||
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
|
||||
/* prototypes, so we have to include the top-level sigcontext.h to */
|
||||
--- gcc-4.8.2/boehm-gc/dyn_load.c.orig 2014-02-17 14:13:09.519850231 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/dyn_load.c 2014-02-17 14:14:27.906093514 +0200
|
||||
@@ -459,9 +459,7 @@
|
||||
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
|
||||
/* versions. Thanks to Jakub Jelinek for most of the code. */
|
||||
|
||||
-# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
+# if (defined(LINUX) || defined (__GLIBC__))
|
||||
|
||||
/* We have the header files for a glibc that includes dl_iterate_phdr. */
|
||||
/* It may still not be available in the library on the target system. */
|
||||
--- gcc-4.8.2/boehm-gc/include/private/gcconfig.h.orig 2014-02-17 14:14:36.026049422 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/include/private/gcconfig.h 2014-02-17 14:17:11.345207887 +0200
|
||||
@@ -684,7 +684,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__)&& __GLIBC__>=2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else /* !GLIBC2 */
|
||||
extern char **__environ;
|
||||
@@ -1147,7 +1147,7 @@
|
||||
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
|
||||
# endif
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -1367,7 +1367,7 @@
|
||||
# define HBLKSIZE 4096
|
||||
# endif
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
|
||||
+# if 1
|
||||
# define LINUX_STACKBOTTOM
|
||||
# else
|
||||
# define STACKBOTTOM 0x80000000
|
||||
@@ -1858,7 +1858,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ./boehm-gc/include/gc.h.orig
|
||||
+++ ./boehm-gc/include/gc.h
|
||||
@@ -503,7 +503,7 @@
|
||||
#if defined(__linux__) || defined(__GLIBC__)
|
||||
# include <features.h>
|
||||
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
|
||||
- && !defined(__ia64__)
|
||||
+ && !defined(__ia64__) && !defined(__UCLIBC__)
|
||||
# ifndef GC_HAVE_BUILTIN_BACKTRACE
|
||||
# define GC_HAVE_BUILTIN_BACKTRACE
|
||||
# endif
|
||||
@@ -1,5 +0,0 @@
|
||||
--- gcc-4.8.1/config/mt-gnu.orig
|
||||
+++ gcc-4.8.1/config/mt-gnu
|
||||
@@ -1 +1 @@
|
||||
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
|
||||
+CXXFLAGS_FOR_TARGET := $(CXXFLAGS_FOR_TARGET) -D_GNU_SOURCE
|
||||
@@ -1,10 +0,0 @@
|
||||
--- gcc-4.8.1/Makefile.in.orig
|
||||
+++ gcc-4.8.1/Makefile.in
|
||||
@@ -169,6 +169,7 @@
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
@@ -1,120 +0,0 @@
|
||||
--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig 2014-02-18 18:46:14.897880526 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc 2014-02-18 18:50:08.766613550 +0200
|
||||
@@ -24,6 +24,13 @@
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
+#include <endian.h>
|
||||
+
|
||||
+#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
+#define UCS2_CHARSET "UCS-2BE"
|
||||
+#else
|
||||
+#define UCS2_CHARSET "UCS-2LE"
|
||||
+#endif
|
||||
|
||||
template<typename T>
|
||||
static inline size_t
|
||||
@@ -45,7 +52,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open ("UCS-2", buffer);
|
||||
+ iconv_t h = iconv_open (UCS2_CHARSET, buffer);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -99,18 +106,6 @@
|
||||
throw new ::java::io::CharConversionException ();
|
||||
}
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- size_t max = (old_out - outavail) / sizeof (jchar);
|
||||
- for (size_t i = 0; i < max; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((out[outpos + i] & 0xff) << 8)
|
||||
- | ((out[outpos + i] >> 8) & 0xff));
|
||||
- outbuf[i] = c;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
inpos += old_in - inavail;
|
||||
return (old_out - outavail) / sizeof (jchar);
|
||||
#else /* HAVE_ICONV */
|
||||
@@ -145,7 +140,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open (buffer, "UCS-2");
|
||||
+ iconv_t h = iconv_open (buffer, UCS2_CHARSET);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -187,20 +182,6 @@
|
||||
char *inbuf = (char *) &chars[inpos];
|
||||
char *outbuf = (char *) &out[count];
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- // Ugly performance penalty -- don't use losing systems!
|
||||
- temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
|
||||
- for (int i = 0; i < inlength; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((chars[inpos + i] & 0xff) << 8)
|
||||
- | ((chars[inpos + i] >> 8) & 0xff));
|
||||
- temp_buffer[i] = c;
|
||||
- }
|
||||
- inbuf = (char *) temp_buffer;
|
||||
- }
|
||||
-
|
||||
size_t loop_old_in = old_in;
|
||||
while (1)
|
||||
{
|
||||
@@ -252,44 +233,7 @@
|
||||
jboolean
|
||||
gnu::gcj::convert::IOConverter::iconv_init (void)
|
||||
{
|
||||
- // Some versions of iconv() always return their UCS-2 results in
|
||||
- // big-endian order, and they also require UCS-2 inputs to be in
|
||||
- // big-endian order. For instance, glibc 2.1.3 does this. If the
|
||||
- // UTF-8=>UCS-2 iconv converter has this feature, then we assume
|
||||
- // that all UCS-2 converters do. (This might not be the best
|
||||
- // heuristic, but is is all we've got.)
|
||||
- jboolean result = false;
|
||||
-#ifdef HAVE_ICONV
|
||||
- iconv_t handle = iconv_open ("UCS-2", "UTF-8");
|
||||
- if (handle != (iconv_t) -1)
|
||||
- {
|
||||
- jchar c;
|
||||
- unsigned char in[4];
|
||||
- char *inp, *outp;
|
||||
- size_t inc, outc, r;
|
||||
-
|
||||
- // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
|
||||
- // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
|
||||
- in[0] = 0xef;
|
||||
- in[1] = 0xbb;
|
||||
- in[2] = 0xbf;
|
||||
- in[3] = 0x00;
|
||||
-
|
||||
- inp = (char *) in;
|
||||
- inc = 4;
|
||||
- outp = (char *) &c;
|
||||
- outc = 2;
|
||||
-
|
||||
- r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
|
||||
- // Conversion must be complete for us to use the result.
|
||||
- if (r != (size_t) -1 && inc == 0 && outc == 0)
|
||||
- result = (c != 0xfeff);
|
||||
-
|
||||
- // Release iconv handle.
|
||||
- iconv_close (handle);
|
||||
- }
|
||||
-#endif /* HAVE_ICONV */
|
||||
- return result;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1,49 +0,0 @@
|
||||
--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig 2014-02-18 10:55:08.617678779 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc 2014-02-18 10:56:31.927227453 +0200
|
||||
@@ -289,7 +289,7 @@
|
||||
// just default to `en_US'.
|
||||
setlocale (LC_ALL, "");
|
||||
char *locale = setlocale (LC_MESSAGES, "");
|
||||
- if (locale && strlen (locale) >= 2)
|
||||
+ if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
|
||||
{
|
||||
char buf[3];
|
||||
buf[2] = '\0';
|
||||
--- gcc-4.8.2/libjava/posix-threads.cc.orig 2014-02-18 13:22:01.789933726 +0200
|
||||
+++ gcc-4.8.2/libjava/posix-threads.cc 2014-02-18 13:29:50.924058875 +0200
|
||||
@@ -657,6 +657,7 @@
|
||||
struct sched_param param;
|
||||
pthread_attr_t attr;
|
||||
struct starter *info;
|
||||
+ size_t ss;
|
||||
|
||||
if (data->flags & FLAG_START)
|
||||
return;
|
||||
@@ -675,8 +676,25 @@
|
||||
// Set stack size if -Xss option was given.
|
||||
if (gcj::stack_size > 0)
|
||||
{
|
||||
- int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
|
||||
+ ss = gcj::stack_size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ int e = pthread_attr_getstacksize (&attr, &ss);
|
||||
+ if (e != 0)
|
||||
+ JvFail (strerror (e));
|
||||
+
|
||||
+ // Request at least 1meg of stack
|
||||
+ if (ss >= 1024 * 1024)
|
||||
+ ss = 0;
|
||||
+ else
|
||||
+ ss = 1024 * 1024;
|
||||
+ }
|
||||
+
|
||||
+ if (ss)
|
||||
+ {
|
||||
+ int e = pthread_attr_setstacksize (&attr, ss);
|
||||
if (e != 0)
|
||||
JvFail (strerror (e));
|
||||
}
|
||||
|
||||
info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));
|
||||
@@ -1,25 +0,0 @@
|
||||
--- ./gcc/varasm.c.orig
|
||||
+++ ./gcc/varasm.c
|
||||
@@ -6758,6 +6758,10 @@
|
||||
/* Static variables are always local. */
|
||||
else if (! TREE_PUBLIC (exp))
|
||||
local_p = true;
|
||||
+ /* Weak data can be overridden by a strong symbol
|
||||
+ in another module and so are not local. */
|
||||
+ else if (DECL_WEAK (exp))
|
||||
+ local_p = false;
|
||||
/* A variable is local if the user has said explicitly that it will
|
||||
be. */
|
||||
else if ((DECL_VISIBILITY_SPECIFIED (exp)
|
||||
@@ -6771,11 +6775,6 @@
|
||||
local. */
|
||||
else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
|
||||
local_p = true;
|
||||
- /* Default visibility weak data can be overridden by a strong symbol
|
||||
- in another module and so are not local. */
|
||||
- else if (DECL_WEAK (exp)
|
||||
- && !resolved_locally)
|
||||
- local_p = false;
|
||||
/* If PIC, then assume that any global name can be overridden by
|
||||
symbols resolved from other modules. */
|
||||
else if (shlib)
|
||||
@@ -1,41 +0,0 @@
|
||||
When cross compiling a target gcc, target flags may be used on the host
|
||||
|
||||
Configure identifies a number of warning flags (WARN_CFLAGS and
|
||||
WARN_CXXFLAGS) from the $CC value. The cross compiler may be different
|
||||
from the host compiler and may not support the same set of flags. This
|
||||
leads to problems such as:
|
||||
|
||||
cc1plus: error: unrecognized command line option "-Wno-narrowing"
|
||||
cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
|
||||
|
||||
Work around this problem by removing the warning flags from the
|
||||
BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
|
||||
Index: gcc-4.8.0/gcc/configure
|
||||
===================================================================
|
||||
--- gcc-4.8.0.orig/gcc/configure
|
||||
+++ gcc-4.8.0/gcc/configure
|
||||
@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc
|
||||
if test x$build != x$host || test "x$coverage_flags" != x
|
||||
then
|
||||
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
|
||||
fi
|
||||
|
||||
Index: gcc-4.8.0/gcc/configure.ac
|
||||
===================================================================
|
||||
--- gcc-4.8.0.orig/gcc/configure.ac
|
||||
+++ gcc-4.8.0/gcc/configure.ac
|
||||
@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F
|
||||
if test x$build != x$host || test "x$coverage_flags" != x
|
||||
then
|
||||
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
|
||||
fi
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--- gcc-4.8.1/gcc/configure.ac.orig 2013-09-25 04:08:25.046595893 +0000
|
||||
+++ gcc-4.8.1/gcc/configure.ac 2013-09-25 04:09:06.023263205 +0000
|
||||
@@ -4822,7 +4822,7 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
- *-linux-musl*)
|
||||
+ *-linux-musl* | *-linux-uclibc* | *-linux-gnu*)
|
||||
gcc_cv_target_dl_iterate_phdr=yes
|
||||
;;
|
||||
esac
|
||||
--- gcc-4.8.1/gcc/configure.orig 2013-09-25 04:08:17.826596392 +0000
|
||||
+++ gcc-4.8.1/gcc/configure 2013-09-25 04:09:24.393263387 +0000
|
||||
@@ -26923,7 +26923,7 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
- *-linux-musl*)
|
||||
+ *-linux-musl* | *-linux-uclibc* | *-linux-gnu*)
|
||||
gcc_cv_target_dl_iterate_phdr=yes
|
||||
;;
|
||||
esac
|
||||
@@ -1,21 +0,0 @@
|
||||
Author: Timo Teräs <timo.teras@iki.fi>
|
||||
|
||||
Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
|
||||
as otherwise we get link failures if some objects are -fstack-protector built
|
||||
and final link happens with -fno-stack-protector. This seems to be the common
|
||||
case when bootstrapping gcc, the piepatches do not seem to fully fix the
|
||||
crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
|
||||
|
||||
--- gcc-4.8.1/gcc/gcc.c.orig 2013-09-24 06:27:32.133894539 +0000
|
||||
+++ gcc-4.8.1/gcc/gcc.c 2013-09-24 06:29:35.790562854 +0000
|
||||
@@ -656,7 +656,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
-#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define LINK_SSP_SPEC "-lssp_nonshared"
|
||||
+#elif defined(TARGET_LIBC_PROVIDES_SSP)
|
||||
#define LINK_SSP_SPEC "%{fstack-protector:}"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
|
||||
@@ -1,11 +0,0 @@
|
||||
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
|
||||
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
|
||||
@@ -146,6 +146,8 @@
|
||||
|
||||
#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
@@ -1,703 +0,0 @@
|
||||
# HG changeset patch
|
||||
# Parent 2f9df662aaaba956600bbdb123b6a227c8e64c59
|
||||
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
|
||||
|
||||
diff -r 2f9df662aaab libstdc++-v3/configure.host
|
||||
--- a/libstdc++-v3/configure.host Tue May 20 11:00:21 2014 -0400
|
||||
+++ b/libstdc++-v3/configure.host Tue May 20 11:05:42 2014 -0400
|
||||
@@ -264,6 +264,13 @@
|
||||
os_include_dir="os/bsd/freebsd"
|
||||
;;
|
||||
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
||||
+ # check for musl by target
|
||||
+ case "${host_os}" in
|
||||
+ *-musl*)
|
||||
+ os_include_dir="os/generic"
|
||||
+ ;;
|
||||
+ *)
|
||||
+
|
||||
if [ "$uclibc" = "yes" ]; then
|
||||
os_include_dir="os/uclibc"
|
||||
elif [ "$bionic" = "yes" ]; then
|
||||
@@ -272,6 +279,9 @@
|
||||
os_include_dir="os/gnu-linux"
|
||||
fi
|
||||
;;
|
||||
+
|
||||
+ esac
|
||||
+ ;;
|
||||
hpux*)
|
||||
os_include_dir="os/hpux"
|
||||
;;
|
||||
# HG changeset patch
|
||||
# Parent b6f4ce05a3155dbcbc06d72aebdb67e2f8abc094
|
||||
Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
|
||||
|
||||
diff -r b6f4ce05a315 gcc/config.gcc
|
||||
--- a/gcc/config.gcc Tue May 20 11:05:42 2014 -0400
|
||||
+++ b/gcc/config.gcc Tue May 20 11:05:45 2014 -0400
|
||||
@@ -594,7 +594,7 @@
|
||||
esac
|
||||
|
||||
# Common C libraries.
|
||||
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
|
||||
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
|
||||
|
||||
# 32-bit x86 processors supported by --with-arch=. Each processor
|
||||
# MUST be separated by exactly one space.
|
||||
@@ -719,6 +719,9 @@
|
||||
*-*-*uclibc*)
|
||||
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
|
||||
;;
|
||||
+ *-*-*musl*)
|
||||
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
|
||||
+ ;;
|
||||
*)
|
||||
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
|
||||
;;
|
||||
diff -r b6f4ce05a315 gcc/config/linux.h
|
||||
--- a/gcc/config/linux.h Tue May 20 11:05:42 2014 -0400
|
||||
+++ b/gcc/config/linux.h Tue May 20 11:05:45 2014 -0400
|
||||
@@ -32,10 +32,12 @@
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
|
||||
@@ -53,18 +55,21 @@
|
||||
uClibc or Bionic is the default C library and whether
|
||||
-muclibc or -mglibc or -mbionic has been passed to change the default. */
|
||||
|
||||
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
|
||||
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
|
||||
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
|
||||
|
||||
#if DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
|
||||
#elif DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
|
||||
#elif DEFAULT_LIBC == LIBC_BIONIC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
|
||||
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
|
||||
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif /* DEFAULT_LIBC */
|
||||
@@ -84,21 +89,92 @@
|
||||
|
||||
#define GNU_USER_DYNAMIC_LINKER \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
|
||||
- BIONIC_DYNAMIC_LINKER)
|
||||
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
||||
#define GNU_USER_DYNAMIC_LINKER32 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
|
||||
- BIONIC_DYNAMIC_LINKER32)
|
||||
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
||||
#define GNU_USER_DYNAMIC_LINKER64 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
|
||||
- BIONIC_DYNAMIC_LINKER64)
|
||||
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
||||
#define GNU_USER_DYNAMIC_LINKERX32 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
|
||||
- BIONIC_DYNAMIC_LINKERX32)
|
||||
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
|
||||
|
||||
/* Whether we have Bionic libc runtime */
|
||||
#undef TARGET_HAS_BIONIC
|
||||
#define TARGET_HAS_BIONIC (OPTION_BIONIC)
|
||||
|
||||
+/* musl avoids problematic includes by rearranging the include directories.
|
||||
+ * Unfortunately, this is mostly duplicated from cppdefault.c */
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define INCLUDE_DEFAULTS_MUSL_GPP \
|
||||
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
|
||||
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
|
||||
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
|
||||
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
|
||||
+
|
||||
+#ifdef LOCAL_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
|
||||
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
|
||||
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+#endif
|
||||
+
|
||||
+#ifdef PREFIX_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
|
||||
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_PREFIX
|
||||
+#endif
|
||||
+
|
||||
+#ifdef CROSS_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_CROSS \
|
||||
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+#endif
|
||||
+
|
||||
+#ifdef TOOL_INCLUDE_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_TOOL \
|
||||
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_TOOL
|
||||
+#endif
|
||||
+
|
||||
+#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
+#else
|
||||
+#define INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+#endif
|
||||
+
|
||||
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+# define INCLUDE_DEFAULTS_MUSL_LOCAL
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+# define INCLUDE_DEFAULTS_MUSL_NATIVE
|
||||
+#else
|
||||
+# undef INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+# define INCLUDE_DEFAULTS_MUSL_CROSS
|
||||
+#endif
|
||||
+
|
||||
+#undef INCLUDE_DEFAULTS
|
||||
+#define INCLUDE_DEFAULTS \
|
||||
+ { \
|
||||
+ INCLUDE_DEFAULTS_MUSL_GPP \
|
||||
+ INCLUDE_DEFAULTS_MUSL_PREFIX \
|
||||
+ INCLUDE_DEFAULTS_MUSL_CROSS \
|
||||
+ INCLUDE_DEFAULTS_MUSL_TOOL \
|
||||
+ INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
|
||||
+ { 0, 0, 0, 0, 0, 0 } \
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
|
||||
/* This is a *uclinux* target. We don't define below macros to normal linux
|
||||
versions, because doing so would require *uclinux* targets to include
|
||||
diff -r b6f4ce05a315 gcc/config/linux.opt
|
||||
--- a/gcc/config/linux.opt Tue May 20 11:05:42 2014 -0400
|
||||
+++ b/gcc/config/linux.opt Tue May 20 11:05:45 2014 -0400
|
||||
@@ -30,3 +30,7 @@
|
||||
muclibc
|
||||
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
|
||||
Use uClibc C library
|
||||
+
|
||||
+mmusl
|
||||
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
|
||||
+Use musl C library
|
||||
diff -r b6f4ce05a315 gcc/ginclude/stddef.h
|
||||
--- a/gcc/ginclude/stddef.h Tue May 20 11:05:42 2014 -0400
|
||||
+++ b/gcc/ginclude/stddef.h Tue May 20 11:05:45 2014 -0400
|
||||
@@ -181,6 +181,7 @@
|
||||
#ifndef _GCC_SIZE_T
|
||||
#ifndef _SIZET_
|
||||
#ifndef __size_t
|
||||
+#ifndef __DEFINED_size_t /* musl */
|
||||
#define __size_t__ /* BeOS */
|
||||
#define __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#define _SIZE_T
|
||||
@@ -197,6 +198,7 @@
|
||||
#define ___int_size_t_h
|
||||
#define _GCC_SIZE_T
|
||||
#define _SIZET_
|
||||
+#define __DEFINED_size_t /* musl */
|
||||
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|
||||
|| defined(__FreeBSD_kernel__)
|
||||
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
|
||||
@@ -214,6 +216,7 @@
|
||||
typedef long ssize_t;
|
||||
#endif /* __BEOS__ */
|
||||
#endif /* !(defined (__GNUG__) && defined (size_t)) */
|
||||
+#endif /* __DEFINED_size_t */
|
||||
#endif /* __size_t */
|
||||
#endif /* _SIZET_ */
|
||||
#endif /* _GCC_SIZE_T */
|
||||
# HG changeset patch
|
||||
# Parent 65d595ef9fc3cdbbde4894d927593f1b0f5bbcb7
|
||||
A fix for libgomp to correctly request a POSIX version for time support.
|
||||
|
||||
diff -r 65d595ef9fc3 libgomp/config/posix/time.c
|
||||
--- a/libgomp/config/posix/time.c Tue May 20 11:05:45 2014 -0400
|
||||
+++ b/libgomp/config/posix/time.c Tue May 20 11:05:48 2014 -0400
|
||||
@@ -28,6 +28,8 @@
|
||||
The following implementation uses the most simple POSIX routines.
|
||||
If present, POSIX 4 clocks should be used instead. */
|
||||
|
||||
+#define _POSIX_C_SOURCE 199309L /* for clocks */
|
||||
+
|
||||
#include "libgomp.h"
|
||||
#include <unistd.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
diff -r 95f4f1d7668b libgcc/unwind-dw2-fde-dip.c
|
||||
--- a/libgcc/unwind-dw2-fde-dip.c Tue May 20 11:05:48 2014 -0400
|
||||
+++ b/libgcc/unwind-dw2-fde-dip.c Tue May 20 11:05:52 2014 -0400
|
||||
@@ -46,33 +46,13 @@
|
||||
#include "unwind-compat.h"
|
||||
#include "gthr.h"
|
||||
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
|
||||
# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__BIONIC__)
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
-# define ElfW __ElfN
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(__OpenBSD__)
|
||||
-# define ElfW(type) Elf_##type
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
-#endif
|
||||
-
|
||||
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
- && defined(TARGET_DL_ITERATE_PHDR) \
|
||||
- && defined(__sun__) && defined(__svr4__)
|
||||
-# define USE_PT_GNU_EH_FRAME
|
||||
+# ifdef __OpenBSD__
|
||||
+# define ElfW(type) Elf_##type
|
||||
+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
|
||||
+# define ElfW __ElfN
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_PT_GNU_EH_FRAME)
|
||||
diff -r ff03fa61c6b3 gcc/configure
|
||||
--- a/gcc/configure Tue May 20 11:05:51 2014 -0400
|
||||
+++ b/gcc/configure Tue May 20 11:05:55 2014 -0400
|
||||
@@ -27300,6 +27300,9 @@
|
||||
else
|
||||
gcc_cv_libc_provides_ssp=no
|
||||
case "$target" in
|
||||
+ *-*-musl*)
|
||||
+ # All versions of musl provide stack protector
|
||||
+ gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
||||
# glibc 2.4 and later provides __stack_chk_fail and
|
||||
# either __stack_chk_guard, or TLS access to stack guard canary.
|
||||
@@ -27332,6 +27335,7 @@
|
||||
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
||||
# simply assert that glibc does provide this, which is true for all
|
||||
# realistically usable GNU/Hurd configurations.
|
||||
+ # All supported versions of musl provide it as well
|
||||
gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-darwin* | *-*-freebsd*)
|
||||
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
|
||||
@@ -27421,6 +27425,9 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
+ *-linux-musl*)
|
||||
+ gcc_cv_target_dl_iterate_phdr=yes
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
||||
diff -r ff03fa61c6b3 gcc/configure.ac
|
||||
--- a/gcc/configure.ac Tue May 20 11:05:51 2014 -0400
|
||||
+++ b/gcc/configure.ac Tue May 20 11:05:55 2014 -0400
|
||||
@@ -5001,6 +5001,9 @@
|
||||
gcc_cv_libc_provides_ssp,
|
||||
[gcc_cv_libc_provides_ssp=no
|
||||
case "$target" in
|
||||
+ *-*-musl*)
|
||||
+ # All versions of musl provide stack protector
|
||||
+ gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
||||
# glibc 2.4 and later provides __stack_chk_fail and
|
||||
# either __stack_chk_guard, or TLS access to stack guard canary.
|
||||
@@ -5027,6 +5030,7 @@
|
||||
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
||||
# simply assert that glibc does provide this, which is true for all
|
||||
# realistically usable GNU/Hurd configurations.
|
||||
+ # All supported versions of musl provide it as well
|
||||
gcc_cv_libc_provides_ssp=yes;;
|
||||
*-*-darwin* | *-*-freebsd*)
|
||||
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
|
||||
@@ -5093,6 +5097,9 @@
|
||||
gcc_cv_target_dl_iterate_phdr=no
|
||||
fi
|
||||
;;
|
||||
+ *-linux-musl*)
|
||||
+ gcc_cv_target_dl_iterate_phdr=yes
|
||||
+ ;;
|
||||
esac
|
||||
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
|
||||
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
||||
# HG changeset patch
|
||||
# Parent 26f591b9e77e3df3d0f772b840bd9c13ec24bd4c
|
||||
Get rid of ever-broken fixincludes on musl.
|
||||
|
||||
diff -r 26f591b9e77e fixincludes/mkfixinc.sh
|
||||
--- a/fixincludes/mkfixinc.sh Tue May 20 11:05:55 2014 -0400
|
||||
+++ b/fixincludes/mkfixinc.sh Tue May 20 11:05:58 2014 -0400
|
||||
@@ -19,7 +19,8 @@
|
||||
powerpc-*-eabi* | \
|
||||
powerpc-*-rtems* | \
|
||||
powerpcle-*-eabisim* | \
|
||||
- powerpcle-*-eabi* )
|
||||
+ powerpcle-*-eabi* | \
|
||||
+ *-musl* )
|
||||
# IF there is no include fixing,
|
||||
# THEN create a no-op fixer and exit
|
||||
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
|
||||
# HG changeset patch
|
||||
# Parent bc117c35705fcc39396c19af046101411f251161
|
||||
Support for i386-linux-musl and x86_64-linux-musl.
|
||||
|
||||
diff -r bc117c35705f gcc/config/i386/linux.h
|
||||
--- a/gcc/config/i386/linux.h Tue May 20 11:05:58 2014 -0400
|
||||
+++ b/gcc/config/i386/linux.h Tue May 20 11:06:01 2014 -0400
|
||||
@@ -21,3 +21,4 @@
|
||||
|
||||
#define GNU_USER_LINK_EMULATION "elf_i386"
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
||||
diff -r bc117c35705f gcc/config/i386/linux64.h
|
||||
--- a/gcc/config/i386/linux64.h Tue May 20 11:05:58 2014 -0400
|
||||
+++ b/gcc/config/i386/linux64.h Tue May 20 11:06:01 2014 -0400
|
||||
@@ -30,3 +30,7 @@
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
|
||||
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
|
||||
+
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
|
||||
diff -r bc117c35705f libitm/config/linux/x86/tls.h
|
||||
--- a/libitm/config/linux/x86/tls.h Tue May 20 11:05:58 2014 -0400
|
||||
+++ b/libitm/config/linux/x86/tls.h Tue May 20 11:06:01 2014 -0400
|
||||
@@ -25,16 +25,19 @@
|
||||
#ifndef LIBITM_X86_TLS_H
|
||||
#define LIBITM_X86_TLS_H 1
|
||||
|
||||
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
||||
+#if defined(__GLIBC_PREREQ)
|
||||
+#if __GLIBC_PREREQ(2, 10)
|
||||
/* Use slots in the TCB head rather than __thread lookups.
|
||||
GLIBC has reserved words 10 through 13 for TM. */
|
||||
#define HAVE_ARCH_GTM_THREAD 1
|
||||
#define HAVE_ARCH_GTM_THREAD_DISP 1
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#include "config/generic/tls.h"
|
||||
|
||||
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
||||
+#if defined(__GLIBC_PREREQ)
|
||||
+#if __GLIBC_PREREQ(2, 10)
|
||||
namespace GTM HIDDEN {
|
||||
|
||||
#ifdef __x86_64__
|
||||
@@ -101,5 +104,6 @@
|
||||
|
||||
} // namespace GTM
|
||||
#endif /* >= GLIBC 2.10 */
|
||||
+#endif
|
||||
|
||||
#endif // LIBITM_X86_TLS_H
|
||||
# HG changeset patch
|
||||
# Parent 933c4f064622eb96a0b2ab213abd0cddbd977d1a
|
||||
Support for arm-linux-musl.
|
||||
|
||||
diff -r 933c4f064622 gcc/config/arm/linux-eabi.h
|
||||
--- a/gcc/config/arm/linux-eabi.h Tue May 20 11:06:01 2014 -0400
|
||||
+++ b/gcc/config/arm/linux-eabi.h Tue May 20 11:06:04 2014 -0400
|
||||
@@ -77,6 +77,23 @@
|
||||
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
|
||||
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
|
||||
|
||||
+/* For ARM musl currently supports four dynamic linkers:
|
||||
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
|
||||
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
|
||||
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
|
||||
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
|
||||
+ musl does not support the legacy OABI mode.
|
||||
+ All the dynamic linkers live in /lib.
|
||||
+ We default to soft-float, EL. */
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
|
||||
+#endif
|
||||
+#define MUSL_DYNAMIC_LINKER \
|
||||
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
|
||||
+
|
||||
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
|
||||
use the GNU/Linux version, not the generic BPABI version. */
|
||||
#undef LINK_SPEC
|
||||
diff -r 933c4f064622 libitm/config/arm/hwcap.cc
|
||||
--- a/libitm/config/arm/hwcap.cc Tue May 20 11:06:01 2014 -0400
|
||||
+++ b/libitm/config/arm/hwcap.cc Tue May 20 11:06:04 2014 -0400
|
||||
@@ -40,7 +40,11 @@
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
+#ifdef __GLIBC__
|
||||
#include <sys/fcntl.h>
|
||||
+#else
|
||||
+#include <fcntl.h>
|
||||
+#endif
|
||||
#include <elf.h>
|
||||
|
||||
static void __attribute__((constructor))
|
||||
# HG changeset patch
|
||||
# Parent 03fe896f3acaa911e935a8e999d15c7542ee73d1
|
||||
Support for mips-linux-musl.
|
||||
|
||||
diff -r 03fe896f3aca gcc/config/mips/linux.h
|
||||
--- a/gcc/config/mips/linux.h Tue May 20 11:06:04 2014 -0400
|
||||
+++ b/gcc/config/mips/linux.h Tue May 20 11:06:08 2014 -0400
|
||||
@@ -23,3 +23,10 @@
|
||||
#undef UCLIBC_DYNAMIC_LINKER
|
||||
#define UCLIBC_DYNAMIC_LINKER \
|
||||
"%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
|
||||
+
|
||||
+#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
|
||||
+#endif
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
# HG changeset patch
|
||||
# Parent 6097333f2ab47a4ce37ccfb18b0f07a0cdcfec49
|
||||
Support for powerpc-linux-musl.
|
||||
|
||||
diff -r 6097333f2ab4 gcc/config.gcc
|
||||
--- a/gcc/config.gcc Tue May 20 11:06:08 2014 -0400
|
||||
+++ b/gcc/config.gcc Tue May 20 11:06:11 2014 -0400
|
||||
@@ -2326,6 +2326,10 @@
|
||||
powerpc*-*-linux*paired*)
|
||||
tm_file="${tm_file} rs6000/750cl.h" ;;
|
||||
esac
|
||||
+ case ${target} in
|
||||
+ *-linux*-musl*)
|
||||
+ enable_secureplt=yes ;;
|
||||
+ esac
|
||||
if test x${enable_secureplt} = xyes; then
|
||||
tm_file="rs6000/secureplt.h ${tm_file}"
|
||||
fi
|
||||
diff -r 6097333f2ab4 gcc/config/rs6000/linux64.h
|
||||
--- a/gcc/config/rs6000/linux64.h Tue May 20 11:06:08 2014 -0400
|
||||
+++ b/gcc/config/rs6000/linux64.h Tue May 20 11:06:11 2014 -0400
|
||||
@@ -375,17 +375,21 @@
|
||||
#endif
|
||||
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
|
||||
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
|
||||
#if DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
||||
#elif DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif
|
||||
#define GNU_USER_DYNAMIC_LINKER32 \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
||||
#define GNU_USER_DYNAMIC_LINKER64 \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
||||
|
||||
#undef DEFAULT_ASM_ENDIAN
|
||||
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
|
||||
diff -r 6097333f2ab4 gcc/config/rs6000/secureplt.h
|
||||
--- a/gcc/config/rs6000/secureplt.h Tue May 20 11:06:08 2014 -0400
|
||||
+++ b/gcc/config/rs6000/secureplt.h Tue May 20 11:06:11 2014 -0400
|
||||
@@ -18,3 +18,4 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
|
||||
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
|
||||
diff -r 6097333f2ab4 gcc/config/rs6000/sysv4.h
|
||||
--- a/gcc/config/rs6000/sysv4.h Tue May 20 11:06:08 2014 -0400
|
||||
+++ b/gcc/config/rs6000/sysv4.h Tue May 20 11:06:11 2014 -0400
|
||||
@@ -537,6 +537,9 @@
|
||||
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
|
||||
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
|
||||
#endif
|
||||
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
|
||||
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
|
||||
+#endif
|
||||
|
||||
/* Pass -G xxx to the compiler. */
|
||||
#define CC1_SPEC "%{G*} %(cc1_cpu)" \
|
||||
@@ -585,7 +588,8 @@
|
||||
|
||||
/* Override the default target of the linker. */
|
||||
#define LINK_TARGET_SPEC \
|
||||
- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
|
||||
+ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
|
||||
+ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
|
||||
|
||||
/* Any specific OS flags. */
|
||||
#define LINK_OS_SPEC "\
|
||||
@@ -763,15 +767,18 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
|
||||
#if DEFAULT_LIBC == LIBC_UCLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
||||
+#elif DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
||||
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
|
||||
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
||||
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
||||
#else
|
||||
#error "Unsupported DEFAULT_LIBC"
|
||||
#endif
|
||||
#define GNU_USER_DYNAMIC_LINKER \
|
||||
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
|
||||
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
||||
|
||||
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
@@ -894,6 +901,7 @@
|
||||
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
|
||||
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
|
||||
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
|
||||
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
|
||||
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
|
||||
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
|
||||
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
|
||||
diff -r 813971b9f083 gcc/config/aarch64/aarch64-linux.h
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h Tue May 20 11:06:11 2014 -0400
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h Tue May 20 11:06:14 2014 -0400
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1"
|
||||
+
|
||||
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
||||
# HG changeset patch
|
||||
# Parent 4a62a6813db995fe195d47ff73234d455975ac30
|
||||
Microblaze support (again).
|
||||
|
||||
diff -r 4a62a6813db9 gcc/config/microblaze/linux.h
|
||||
--- a/gcc/config/microblaze/linux.h Tue May 20 11:06:14 2014 -0400
|
||||
+++ b/gcc/config/microblaze/linux.h Tue May 20 11:06:17 2014 -0400
|
||||
@@ -25,7 +25,22 @@
|
||||
#undef TLS_NEEDS_GOT
|
||||
#define TLS_NEEDS_GOT 1
|
||||
|
||||
-#define DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
|
||||
+#endif
|
||||
+
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+
|
||||
+#if DEFAULT_LIBC == LIBC_MUSL
|
||||
+#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
|
||||
+#else
|
||||
+#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "dynamic_linker", DYNAMIC_LINKER }
|
||||
From 478ee0c03a08e2ef9371fd88d516738936943e78 Mon Sep 17 00:00:00 2001
|
||||
From: David Holsgrove <david.holsgrove@xilinx.com>
|
||||
Date: Fri, 28 Sep 2012 16:32:03 +1000
|
||||
Subject: [PATCH 06/11] [Patch, microblaze]: Add SIZE_TYPE and PTRDIFF_TYPE to
|
||||
microblaze.h
|
||||
|
||||
Fixes warnings like;
|
||||
|
||||
warning: format '%zX' expects argument of type 'size_t',
|
||||
but argument 3 has type 'unsigned int' [-Wformat]
|
||||
|
||||
Changelog
|
||||
|
||||
2013-03-18 David Holsgrove <david.holsgrove@xilinx.com>
|
||||
|
||||
* gcc/config/microblaze/microblaze.h: Define SIZE_TYPE
|
||||
and PTRDIFF_TYPE.
|
||||
|
||||
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
|
||||
---
|
||||
gcc/config/microblaze/microblaze.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff -r 20d1c995f5de gcc/config/microblaze/microblaze.h
|
||||
--- a/gcc/config/microblaze/microblaze.h Tue May 20 11:06:17 2014 -0400
|
||||
+++ b/gcc/config/microblaze/microblaze.h Tue May 20 11:06:20 2014 -0400
|
||||
@@ -218,6 +218,12 @@
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "int"
|
||||
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
|
||||
((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \
|
||||
&& (ALIGN) < BITS_PER_WORD \
|
||||
diff -r 2f999fc929da gcc/config/sh/linux.h
|
||||
--- a/gcc/config/sh/linux.h Fri Sep 28 16:32:03 2012 +1000
|
||||
+++ b/gcc/config/sh/linux.h Tue May 20 11:06:23 2014 -0400
|
||||
@@ -43,7 +43,14 @@
|
||||
|
||||
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
||||
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT /* BE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "eb"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E
|
||||
+#endif
|
||||
+
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
|
||||
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
||||
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
|
||||
@@ -1,304 +0,0 @@
|
||||
# DP: Retry the build on an ice, save the calling options and preprocessed
|
||||
# DP: source when the ice is reproducible.
|
||||
|
||||
2004-01-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.c (execute): Don't free first string early, but at the end
|
||||
of the function. Call retry_ice if compiler exited with
|
||||
ICE_EXIT_CODE.
|
||||
(retry_ice): New function.
|
||||
* diagnostic.c (diagnostic_count_diagnostic,
|
||||
diagnostic_action_after_output, error_recursion): Exit with
|
||||
ICE_EXIT_CODE instead of FATAL_EXIT_CODE.
|
||||
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -249,6 +249,9 @@
|
||||
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
|
||||
static const char *convert_filename (const char *, int, int);
|
||||
#endif
|
||||
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
|
||||
+static void retry_ice (const char *prog, const char **argv);
|
||||
+#endif
|
||||
|
||||
static const char *getenv_spec_function (int, const char **);
|
||||
static const char *if_exists_spec_function (int, const char **);
|
||||
@@ -2771,7 +2774,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (string != commands[i].prog)
|
||||
+ if (i && string != commands[i].prog)
|
||||
free (CONST_CAST (char *, string));
|
||||
}
|
||||
|
||||
@@ -2824,6 +2827,16 @@
|
||||
else if (WIFEXITED (status)
|
||||
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS)
|
||||
{
|
||||
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
|
||||
+ /* For ICEs in cc1, cc1obj, cc1plus see if it is
|
||||
+ reproducible or not. */
|
||||
+ const char *p;
|
||||
+ if (WEXITSTATUS (status) == ICE_EXIT_CODE
|
||||
+ && i == 0
|
||||
+ && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR))
|
||||
+ && ! strncmp (p + 1, "cc1", 3))
|
||||
+ retry_ice (commands[0].prog, commands[0].argv);
|
||||
+#endif
|
||||
if (WEXITSTATUS (status) > greatest_status)
|
||||
greatest_status = WEXITSTATUS (status);
|
||||
ret_code = -1;
|
||||
@@ -2881,6 +2894,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (commands[0].argv[0] != commands[0].prog)
|
||||
+ free (CONST_CAST (char *, commands[0].argv[0]));
|
||||
+
|
||||
return ret_code;
|
||||
}
|
||||
}
|
||||
@@ -6034,6 +6050,227 @@
|
||||
switches[switchnum].validated = true;
|
||||
}
|
||||
|
||||
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
|
||||
+#define RETRY_ICE_ATTEMPTS 2
|
||||
+
|
||||
+static void
|
||||
+retry_ice (const char *prog, const char **argv)
|
||||
+{
|
||||
+ int nargs, out_arg = -1, quiet = 0, attempt;
|
||||
+ int pid, retries, sleep_interval;
|
||||
+ const char **new_argv;
|
||||
+ char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2];
|
||||
+
|
||||
+ if (gcc_input_filename == NULL || ! strcmp (gcc_input_filename, "-"))
|
||||
+ return;
|
||||
+
|
||||
+ for (nargs = 0; argv[nargs] != NULL; ++nargs)
|
||||
+ /* Only retry compiler ICEs, not preprocessor ones. */
|
||||
+ if (! strcmp (argv[nargs], "-E"))
|
||||
+ return;
|
||||
+ else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o')
|
||||
+ {
|
||||
+ if (out_arg == -1)
|
||||
+ out_arg = nargs;
|
||||
+ else
|
||||
+ return;
|
||||
+ }
|
||||
+ /* If the compiler is going to output any time information,
|
||||
+ it might varry between invocations. */
|
||||
+ else if (! strcmp (argv[nargs], "-quiet"))
|
||||
+ quiet = 1;
|
||||
+ else if (! strcmp (argv[nargs], "-ftime-report"))
|
||||
+ return;
|
||||
+
|
||||
+ if (out_arg == -1 || !quiet)
|
||||
+ return;
|
||||
+
|
||||
+ memset (temp_filenames, '\0', sizeof (temp_filenames));
|
||||
+ new_argv = XALLOCAVEC (const char *, nargs + 3);
|
||||
+ memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *));
|
||||
+ new_argv[nargs++] = "-frandom-seed=0";
|
||||
+ new_argv[nargs] = NULL;
|
||||
+ if (new_argv[out_arg][2] == '\0')
|
||||
+ new_argv[out_arg + 1] = "-";
|
||||
+ else
|
||||
+ new_argv[out_arg] = "-o-";
|
||||
+
|
||||
+ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt)
|
||||
+ {
|
||||
+ int fd = -1;
|
||||
+ int status;
|
||||
+
|
||||
+ temp_filenames[attempt * 2] = make_temp_file (".out");
|
||||
+ temp_filenames[attempt * 2 + 1] = make_temp_file (".err");
|
||||
+
|
||||
+ if (attempt == RETRY_ICE_ATTEMPTS)
|
||||
+ {
|
||||
+ int i;
|
||||
+ int fd1, fd2;
|
||||
+ struct stat st1, st2;
|
||||
+ size_t n, len;
|
||||
+ char *buf;
|
||||
+
|
||||
+ buf = XNEWVEC (char, 8192);
|
||||
+
|
||||
+ for (i = 0; i < 2; ++i)
|
||||
+ {
|
||||
+ fd1 = open (temp_filenames[i], O_RDONLY);
|
||||
+ fd2 = open (temp_filenames[2 + i], O_RDONLY);
|
||||
+
|
||||
+ if (fd1 < 0 || fd2 < 0)
|
||||
+ {
|
||||
+ i = -1;
|
||||
+ close (fd1);
|
||||
+ close (fd2);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0)
|
||||
+ {
|
||||
+ i = -1;
|
||||
+ close (fd1);
|
||||
+ close (fd2);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (st1.st_size != st2.st_size)
|
||||
+ {
|
||||
+ close (fd1);
|
||||
+ close (fd2);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ for (n = st1.st_size; n; n -= len)
|
||||
+ {
|
||||
+ len = n;
|
||||
+ if (len > 4096)
|
||||
+ len = 4096;
|
||||
+
|
||||
+ if (read (fd1, buf, len) != (int) len
|
||||
+ || read (fd2, buf + 4096, len) != (int) len)
|
||||
+ {
|
||||
+ i = -1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (memcmp (buf, buf + 4096, len) != 0)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ close (fd1);
|
||||
+ close (fd2);
|
||||
+
|
||||
+ if (n)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ free (buf);
|
||||
+ if (i == -1)
|
||||
+ break;
|
||||
+
|
||||
+ if (i != 2)
|
||||
+ {
|
||||
+ fnotice (stderr, "The bug is not reproducible, so it is"
|
||||
+ " likely a hardware or OS problem.\n");
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ fd = open (temp_filenames[attempt * 2], O_RDWR);
|
||||
+ if (fd < 0)
|
||||
+ break;
|
||||
+ write (fd, "//", 2);
|
||||
+ for (i = 0; i < nargs; i++)
|
||||
+ {
|
||||
+ write (fd, " ", 1);
|
||||
+ write (fd, new_argv[i], strlen (new_argv[i]));
|
||||
+ }
|
||||
+ write (fd, "\n", 1);
|
||||
+ new_argv[nargs] = "-E";
|
||||
+ new_argv[nargs + 1] = NULL;
|
||||
+ }
|
||||
+
|
||||
+ /* Fork a subprocess; wait and retry if it fails. */
|
||||
+ sleep_interval = 1;
|
||||
+ pid = -1;
|
||||
+ for (retries = 0; retries < 4; retries++)
|
||||
+ {
|
||||
+ pid = fork ();
|
||||
+ if (pid >= 0)
|
||||
+ break;
|
||||
+ sleep (sleep_interval);
|
||||
+ sleep_interval *= 2;
|
||||
+ }
|
||||
+
|
||||
+ if (pid < 0)
|
||||
+ break;
|
||||
+ else if (pid == 0)
|
||||
+ {
|
||||
+ if (attempt != RETRY_ICE_ATTEMPTS)
|
||||
+ fd = open (temp_filenames[attempt * 2], O_RDWR);
|
||||
+ if (fd < 0)
|
||||
+ exit (-1);
|
||||
+ if (fd != 1)
|
||||
+ {
|
||||
+ close (1);
|
||||
+ dup (fd);
|
||||
+ close (fd);
|
||||
+ }
|
||||
+
|
||||
+ fd = open (temp_filenames[attempt * 2 + 1], O_RDWR);
|
||||
+ if (fd < 0)
|
||||
+ exit (-1);
|
||||
+ if (fd != 2)
|
||||
+ {
|
||||
+ close (2);
|
||||
+ dup (fd);
|
||||
+ close (fd);
|
||||
+ }
|
||||
+
|
||||
+ if (prog == new_argv[0])
|
||||
+ execvp (prog, CONST_CAST2 (char *const *, const char **, new_argv));
|
||||
+ else
|
||||
+ execv (new_argv[0], CONST_CAST2 (char *const *, const char **, new_argv));
|
||||
+ exit (-1);
|
||||
+ }
|
||||
+
|
||||
+ if (waitpid (pid, &status, 0) < 0)
|
||||
+ break;
|
||||
+
|
||||
+ if (attempt < RETRY_ICE_ATTEMPTS
|
||||
+ && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE))
|
||||
+ {
|
||||
+ fnotice (stderr, "The bug is not reproducible, so it is"
|
||||
+ " likely a hardware or OS problem.\n");
|
||||
+ break;
|
||||
+ }
|
||||
+ else if (attempt == RETRY_ICE_ATTEMPTS)
|
||||
+ {
|
||||
+ close (fd);
|
||||
+ if (WIFEXITED (status)
|
||||
+ && WEXITSTATUS (status) == SUCCESS_EXIT_CODE)
|
||||
+ {
|
||||
+ fnotice (stderr, "Preprocessed source stored into %s file,"
|
||||
+ " please attach this to your bugreport.\n",
|
||||
+ temp_filenames[attempt * 2]);
|
||||
+ /* Make sure it is not deleted. */
|
||||
+ free (temp_filenames[attempt * 2]);
|
||||
+ temp_filenames[attempt * 2] = NULL;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++)
|
||||
+ if (temp_filenames[attempt])
|
||||
+ {
|
||||
+ unlink (temp_filenames[attempt]);
|
||||
+ free (temp_filenames[attempt]);
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* Search for a file named NAME trying various prefixes including the
|
||||
user's -B prefix and some standard ones.
|
||||
Return the absolute file name found. If nothing is found, return NAME. */
|
||||
Index: b/gcc/diagnostic.c
|
||||
===================================================================
|
||||
--- a/gcc/diagnostic.c
|
||||
+++ b/gcc/diagnostic.c
|
||||
@@ -455,7 +455,7 @@
|
||||
real_abort ();
|
||||
diagnostic_finish (context);
|
||||
fnotice (stderr, "compilation terminated.\n");
|
||||
- exit (FATAL_EXIT_CODE);
|
||||
+ exit (ICE_EXIT_CODE);
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
|
||||
+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
|
||||
@@ -34,6 +34,6 @@
|
||||
comma=,
|
||||
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
|
||||
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
|
||||
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
@@ -1,42 +0,0 @@
|
||||
Add support for external spec file via the GCC_SPECS env var. This
|
||||
allows us to easily control pie/ssp defaults with gcc-config profiles.
|
||||
|
||||
Original patch by Rob Holland
|
||||
Extended to support multiple entries separated by ':' by Kevin F. Quinn
|
||||
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
|
||||
|
||||
--- gcc-4/gcc/gcc.c
|
||||
+++ gcc-4/gcc/gcc.c
|
||||
@@ -6482,6 +6482,32 @@
|
||||
|
||||
/* Process any user specified specs in the order given on the command
|
||||
line. */
|
||||
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
|
||||
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
|
||||
+ * each spec listed, the string is overwritten at token boundaries
|
||||
+ * (':') with '\0', an effect of strtok_r().
|
||||
+ */
|
||||
+ specs_file = getenv ("GCC_SPECS");
|
||||
+ if (specs_file && (strlen(specs_file) > 0))
|
||||
+ {
|
||||
+ char *spec, *saveptr;
|
||||
+ for (spec=strtok_r(specs_file,":",&saveptr);
|
||||
+ spec!=NULL;
|
||||
+ spec=strtok_r(NULL,":",&saveptr))
|
||||
+ {
|
||||
+ struct user_specs *user = (struct user_specs *)
|
||||
+ xmalloc (sizeof (struct user_specs));
|
||||
+
|
||||
+ user->next = (struct user_specs *) 0;
|
||||
+ user->filename = spec;
|
||||
+ if (user_specs_tail)
|
||||
+ user_specs_tail->next = user;
|
||||
+ else
|
||||
+ user_specs_head = user;
|
||||
+ user_specs_tail = user;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
for (uptr = user_specs_head; uptr; uptr = uptr->next)
|
||||
{
|
||||
char *filename = find_a_file (&startfile_prefixes, uptr->filename,
|
||||
@@ -1,478 +0,0 @@
|
||||
http://pkgs.fedoraproject.org/cgit/gcc.git/plain/gcc49-cloog-dl.patch
|
||||
|
||||
--- a/gcc/Makefile.in.jj 2012-12-13 17:09:20.000000000 +0100
|
||||
+++ b/gcc/Makefile.in 2012-12-14 11:45:22.585670055 +0100
|
||||
@@ -1006,7 +1006,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
|
||||
# and the system's installed libraries.
|
||||
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
|
||||
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
|
||||
-BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
|
||||
+BACKENDLIBS = $(if $(CLOOGLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
|
||||
$(ZLIB)
|
||||
# Any system libraries needed just for GNAT.
|
||||
SYSLIBS = @GNAT_LIBEXC@
|
||||
@@ -2011,6 +2011,15 @@ $(out_object_file): $(out_file)
|
||||
$(common_out_object_file): $(common_out_file)
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
+
|
||||
+graphite%.o : \
|
||||
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
|
||||
+graphite.o : \
|
||||
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
|
||||
+graphite%.o : \
|
||||
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
|
||||
+graphite.o : \
|
||||
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
|
||||
#
|
||||
# Generate header and source files from the machine description,
|
||||
# and compile them.
|
||||
--- a/gcc/graphite-poly.h.jj 2012-12-13 11:31:27.000000000 +0100
|
||||
+++ b/gcc/graphite-poly.h 2012-12-14 13:41:41.970800726 +0100
|
||||
@@ -22,6 +22,371 @@ along with GCC; see the file COPYING3.
|
||||
#ifndef GCC_GRAPHITE_POLY_H
|
||||
#define GCC_GRAPHITE_POLY_H
|
||||
|
||||
+#include <isl/aff.h>
|
||||
+#include <isl/schedule.h>
|
||||
+#include <isl/ilp.h>
|
||||
+#include <isl/flow.h>
|
||||
+#include <isl/options.h>
|
||||
+#include <cloog/isl/cloog.h>
|
||||
+#include <dlfcn.h>
|
||||
+#define DYNSYMS \
|
||||
+ DYNSYM (clast_pprint); \
|
||||
+ DYNSYM (cloog_clast_create_from_input); \
|
||||
+ DYNSYM (cloog_clast_free); \
|
||||
+ DYNSYM (cloog_domain_from_isl_set); \
|
||||
+ DYNSYM (cloog_input_alloc); \
|
||||
+ DYNSYM (cloog_isl_state_malloc); \
|
||||
+ DYNSYM (cloog_options_free); \
|
||||
+ DYNSYM (cloog_options_malloc); \
|
||||
+ DYNSYM (cloog_scattering_from_isl_map); \
|
||||
+ DYNSYM (cloog_state_free); \
|
||||
+ DYNSYM (cloog_union_domain_add_domain); \
|
||||
+ DYNSYM (cloog_union_domain_alloc); \
|
||||
+ DYNSYM (cloog_union_domain_set_name); \
|
||||
+ DYNSYM (isl_aff_add_coefficient_si); \
|
||||
+ DYNSYM (isl_aff_add_constant); \
|
||||
+ DYNSYM (isl_aff_free); \
|
||||
+ DYNSYM (isl_aff_get_coefficient); \
|
||||
+ DYNSYM (isl_aff_get_space); \
|
||||
+ DYNSYM (isl_aff_mod); \
|
||||
+ DYNSYM (isl_aff_set_coefficient_si); \
|
||||
+ DYNSYM (isl_aff_set_constant_si); \
|
||||
+ DYNSYM (isl_aff_zero_on_domain); \
|
||||
+ DYNSYM (isl_band_free); \
|
||||
+ DYNSYM (isl_band_get_children); \
|
||||
+ DYNSYM (isl_band_get_partial_schedule); \
|
||||
+ DYNSYM (isl_band_has_children); \
|
||||
+ DYNSYM (isl_band_list_free); \
|
||||
+ DYNSYM (isl_band_list_get_band); \
|
||||
+ DYNSYM (isl_band_list_get_ctx); \
|
||||
+ DYNSYM (isl_band_list_n_band); \
|
||||
+ DYNSYM (isl_band_member_is_zero_distance); \
|
||||
+ DYNSYM (isl_band_n_member); \
|
||||
+ DYNSYM (isl_basic_map_add_constraint); \
|
||||
+ DYNSYM (isl_basic_map_project_out); \
|
||||
+ DYNSYM (isl_basic_map_universe); \
|
||||
+ DYNSYM (isl_constraint_set_coefficient); \
|
||||
+ DYNSYM (isl_constraint_set_coefficient_si); \
|
||||
+ DYNSYM (isl_constraint_set_constant); \
|
||||
+ DYNSYM (isl_constraint_set_constant_si); \
|
||||
+ DYNSYM (isl_ctx_alloc); \
|
||||
+ DYNSYM (isl_ctx_free); \
|
||||
+ DYNSYM (isl_equality_alloc); \
|
||||
+ DYNSYM (isl_id_alloc); \
|
||||
+ DYNSYM (isl_id_copy); \
|
||||
+ DYNSYM (isl_id_free); \
|
||||
+ DYNSYM (isl_inequality_alloc); \
|
||||
+ DYNSYM (isl_local_space_copy); \
|
||||
+ DYNSYM (isl_local_space_free); \
|
||||
+ DYNSYM (isl_local_space_from_space); \
|
||||
+ DYNSYM (isl_local_space_range); \
|
||||
+ DYNSYM (isl_map_add_constraint); \
|
||||
+ DYNSYM (isl_map_add_dims); \
|
||||
+ DYNSYM (isl_map_align_params); \
|
||||
+ DYNSYM (isl_map_apply_range); \
|
||||
+ DYNSYM (isl_map_copy); \
|
||||
+ DYNSYM (isl_map_dim); \
|
||||
+ DYNSYM (isl_map_dump); \
|
||||
+ DYNSYM (isl_map_equate); \
|
||||
+ DYNSYM (isl_map_fix_si); \
|
||||
+ DYNSYM (isl_map_flat_product); \
|
||||
+ DYNSYM (isl_map_flat_range_product); \
|
||||
+ DYNSYM (isl_map_free); \
|
||||
+ DYNSYM (isl_map_from_basic_map); \
|
||||
+ DYNSYM (isl_map_from_pw_aff); \
|
||||
+ DYNSYM (isl_map_from_union_map); \
|
||||
+ DYNSYM (isl_map_get_ctx); \
|
||||
+ DYNSYM (isl_map_get_space); \
|
||||
+ DYNSYM (isl_map_get_tuple_id); \
|
||||
+ DYNSYM (isl_map_insert_dims); \
|
||||
+ DYNSYM (isl_map_intersect); \
|
||||
+ DYNSYM (isl_map_intersect_domain); \
|
||||
+ DYNSYM (isl_map_intersect_range); \
|
||||
+ DYNSYM (isl_map_is_empty); \
|
||||
+ DYNSYM (isl_map_lex_ge); \
|
||||
+ DYNSYM (isl_map_lex_le); \
|
||||
+ DYNSYM (isl_map_n_out); \
|
||||
+ DYNSYM (isl_map_range); \
|
||||
+ DYNSYM (isl_map_set_tuple_id); \
|
||||
+ DYNSYM (isl_map_universe); \
|
||||
+ DYNSYM (isl_options_set_on_error); \
|
||||
+ DYNSYM (isl_options_set_schedule_fuse); \
|
||||
+ DYNSYM (isl_options_set_schedule_max_constant_term); \
|
||||
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \
|
||||
+ DYNSYM (isl_printer_free); \
|
||||
+ DYNSYM (isl_printer_print_aff); \
|
||||
+ DYNSYM (isl_printer_print_constraint); \
|
||||
+ DYNSYM (isl_printer_print_map); \
|
||||
+ DYNSYM (isl_printer_print_set); \
|
||||
+ DYNSYM (isl_printer_to_file); \
|
||||
+ DYNSYM (isl_pw_aff_add); \
|
||||
+ DYNSYM (isl_pw_aff_alloc); \
|
||||
+ DYNSYM (isl_pw_aff_copy); \
|
||||
+ DYNSYM (isl_pw_aff_eq_set); \
|
||||
+ DYNSYM (isl_pw_aff_free); \
|
||||
+ DYNSYM (isl_pw_aff_from_aff); \
|
||||
+ DYNSYM (isl_pw_aff_ge_set); \
|
||||
+ DYNSYM (isl_pw_aff_gt_set); \
|
||||
+ DYNSYM (isl_pw_aff_is_cst); \
|
||||
+ DYNSYM (isl_pw_aff_le_set); \
|
||||
+ DYNSYM (isl_pw_aff_lt_set); \
|
||||
+ DYNSYM (isl_pw_aff_mod); \
|
||||
+ DYNSYM (isl_pw_aff_mul); \
|
||||
+ DYNSYM (isl_pw_aff_ne_set); \
|
||||
+ DYNSYM (isl_pw_aff_nonneg_set); \
|
||||
+ DYNSYM (isl_pw_aff_set_tuple_id); \
|
||||
+ DYNSYM (isl_pw_aff_sub); \
|
||||
+ DYNSYM (isl_pw_aff_zero_set); \
|
||||
+ DYNSYM (isl_schedule_free); \
|
||||
+ DYNSYM (isl_schedule_get_band_forest); \
|
||||
+ DYNSYM (isl_set_add_constraint); \
|
||||
+ DYNSYM (isl_set_add_dims); \
|
||||
+ DYNSYM (isl_set_apply); \
|
||||
+ DYNSYM (isl_set_coalesce); \
|
||||
+ DYNSYM (isl_set_copy); \
|
||||
+ DYNSYM (isl_set_dim); \
|
||||
+ DYNSYM (isl_set_fix_si); \
|
||||
+ DYNSYM (isl_set_free); \
|
||||
+ DYNSYM (isl_set_from_cloog_domain); \
|
||||
+ DYNSYM (isl_set_get_space); \
|
||||
+ DYNSYM (isl_set_get_tuple_id); \
|
||||
+ DYNSYM (isl_set_intersect); \
|
||||
+ DYNSYM (isl_set_is_empty); \
|
||||
+ DYNSYM (isl_set_max); \
|
||||
+ DYNSYM (isl_set_min); \
|
||||
+ DYNSYM (isl_set_n_dim); \
|
||||
+ DYNSYM (isl_set_nat_universe); \
|
||||
+ DYNSYM (isl_set_project_out); \
|
||||
+ DYNSYM (isl_set_set_tuple_id); \
|
||||
+ DYNSYM (isl_set_universe); \
|
||||
+ DYNSYM (isl_space_add_dims); \
|
||||
+ DYNSYM (isl_space_alloc); \
|
||||
+ DYNSYM (isl_space_copy); \
|
||||
+ DYNSYM (isl_space_dim); \
|
||||
+ DYNSYM (isl_space_domain); \
|
||||
+ DYNSYM (isl_space_find_dim_by_id); \
|
||||
+ DYNSYM (isl_space_free); \
|
||||
+ DYNSYM (isl_space_from_domain); \
|
||||
+ DYNSYM (isl_space_get_tuple_id); \
|
||||
+ DYNSYM (isl_space_params_alloc); \
|
||||
+ DYNSYM (isl_space_range); \
|
||||
+ DYNSYM (isl_space_set_alloc); \
|
||||
+ DYNSYM (isl_space_set_dim_id); \
|
||||
+ DYNSYM (isl_space_set_tuple_id); \
|
||||
+ DYNSYM (isl_union_map_add_map); \
|
||||
+ DYNSYM (isl_union_map_align_params); \
|
||||
+ DYNSYM (isl_union_map_apply_domain); \
|
||||
+ DYNSYM (isl_union_map_apply_range); \
|
||||
+ DYNSYM (isl_union_map_compute_flow); \
|
||||
+ DYNSYM (isl_union_map_copy); \
|
||||
+ DYNSYM (isl_union_map_empty); \
|
||||
+ DYNSYM (isl_union_map_flat_range_product); \
|
||||
+ DYNSYM (isl_union_map_foreach_map); \
|
||||
+ DYNSYM (isl_union_map_free); \
|
||||
+ DYNSYM (isl_union_map_from_map); \
|
||||
+ DYNSYM (isl_union_map_get_ctx); \
|
||||
+ DYNSYM (isl_union_map_get_space); \
|
||||
+ DYNSYM (isl_union_map_gist_domain); \
|
||||
+ DYNSYM (isl_union_map_gist_range); \
|
||||
+ DYNSYM (isl_union_map_intersect_domain); \
|
||||
+ DYNSYM (isl_union_map_is_empty); \
|
||||
+ DYNSYM (isl_union_map_subtract); \
|
||||
+ DYNSYM (isl_union_map_union); \
|
||||
+ DYNSYM (isl_union_set_add_set); \
|
||||
+ DYNSYM (isl_union_set_compute_schedule); \
|
||||
+ DYNSYM (isl_union_set_copy); \
|
||||
+ DYNSYM (isl_union_set_empty); \
|
||||
+ DYNSYM (isl_union_set_from_set); \
|
||||
+ DYNSYM (stmt_ass); \
|
||||
+ DYNSYM (stmt_block); \
|
||||
+ DYNSYM (stmt_for); \
|
||||
+ DYNSYM (stmt_guard); \
|
||||
+ DYNSYM (stmt_root); \
|
||||
+ DYNSYM (stmt_user);
|
||||
+extern struct cloog_pointers_s__
|
||||
+{
|
||||
+ bool inited;
|
||||
+ void *h;
|
||||
+#define DYNSYM(x) __typeof (x) *p_##x
|
||||
+ DYNSYMS
|
||||
+#undef DYNSYM
|
||||
+} cloog_pointers__;
|
||||
+
|
||||
+#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc)
|
||||
+#define clast_pprint (*cloog_pointers__.p_clast_pprint)
|
||||
+#define cloog_clast_create_from_input (*cloog_pointers__.p_cloog_clast_create_from_input)
|
||||
+#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free)
|
||||
+#define cloog_domain_from_isl_set (*cloog_pointers__.p_cloog_domain_from_isl_set)
|
||||
+#define cloog_input_alloc (*cloog_pointers__.p_cloog_input_alloc)
|
||||
+#define cloog_isl_state_malloc (*cloog_pointers__.p_cloog_isl_state_malloc)
|
||||
+#define cloog_options_free (*cloog_pointers__.p_cloog_options_free)
|
||||
+#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc)
|
||||
+#define cloog_scattering_from_isl_map (*cloog_pointers__.p_cloog_scattering_from_isl_map)
|
||||
+#define cloog_state_free (*cloog_pointers__.p_cloog_state_free)
|
||||
+#define cloog_union_domain_add_domain (*cloog_pointers__.p_cloog_union_domain_add_domain)
|
||||
+#define cloog_union_domain_alloc (*cloog_pointers__.p_cloog_union_domain_alloc)
|
||||
+#define cloog_union_domain_set_name (*cloog_pointers__.p_cloog_union_domain_set_name)
|
||||
+#define isl_aff_add_coefficient_si (*cloog_pointers__.p_isl_aff_add_coefficient_si)
|
||||
+#define isl_aff_add_constant (*cloog_pointers__.p_isl_aff_add_constant)
|
||||
+#define isl_aff_free (*cloog_pointers__.p_isl_aff_free)
|
||||
+#define isl_aff_get_coefficient (*cloog_pointers__.p_isl_aff_get_coefficient)
|
||||
+#define isl_aff_get_space (*cloog_pointers__.p_isl_aff_get_space)
|
||||
+#define isl_aff_mod (*cloog_pointers__.p_isl_aff_mod)
|
||||
+#define isl_aff_set_coefficient_si (*cloog_pointers__.p_isl_aff_set_coefficient_si)
|
||||
+#define isl_aff_set_constant_si (*cloog_pointers__.p_isl_aff_set_constant_si)
|
||||
+#define isl_aff_zero_on_domain (*cloog_pointers__.p_isl_aff_zero_on_domain)
|
||||
+#define isl_band_free (*cloog_pointers__.p_isl_band_free)
|
||||
+#define isl_band_get_children (*cloog_pointers__.p_isl_band_get_children)
|
||||
+#define isl_band_get_partial_schedule (*cloog_pointers__.p_isl_band_get_partial_schedule)
|
||||
+#define isl_band_has_children (*cloog_pointers__.p_isl_band_has_children)
|
||||
+#define isl_band_list_free (*cloog_pointers__.p_isl_band_list_free)
|
||||
+#define isl_band_list_get_band (*cloog_pointers__.p_isl_band_list_get_band)
|
||||
+#define isl_band_list_get_ctx (*cloog_pointers__.p_isl_band_list_get_ctx)
|
||||
+#define isl_band_list_n_band (*cloog_pointers__.p_isl_band_list_n_band)
|
||||
+#define isl_band_member_is_zero_distance (*cloog_pointers__.p_isl_band_member_is_zero_distance)
|
||||
+#define isl_band_n_member (*cloog_pointers__.p_isl_band_n_member)
|
||||
+#define isl_basic_map_add_constraint (*cloog_pointers__.p_isl_basic_map_add_constraint)
|
||||
+#define isl_basic_map_project_out (*cloog_pointers__.p_isl_basic_map_project_out)
|
||||
+#define isl_basic_map_universe (*cloog_pointers__.p_isl_basic_map_universe)
|
||||
+#define isl_constraint_set_coefficient (*cloog_pointers__.p_isl_constraint_set_coefficient)
|
||||
+#define isl_constraint_set_coefficient_si (*cloog_pointers__.p_isl_constraint_set_coefficient_si)
|
||||
+#define isl_constraint_set_constant (*cloog_pointers__.p_isl_constraint_set_constant)
|
||||
+#define isl_constraint_set_constant_si (*cloog_pointers__.p_isl_constraint_set_constant_si)
|
||||
+#define isl_ctx_alloc (*cloog_pointers__.p_isl_ctx_alloc)
|
||||
+#define isl_ctx_free (*cloog_pointers__.p_isl_ctx_free)
|
||||
+#define isl_equality_alloc (*cloog_pointers__.p_isl_equality_alloc)
|
||||
+#define isl_id_alloc (*cloog_pointers__.p_isl_id_alloc)
|
||||
+#define isl_id_copy (*cloog_pointers__.p_isl_id_copy)
|
||||
+#define isl_id_free (*cloog_pointers__.p_isl_id_free)
|
||||
+#define isl_inequality_alloc (*cloog_pointers__.p_isl_inequality_alloc)
|
||||
+#define isl_local_space_copy (*cloog_pointers__.p_isl_local_space_copy)
|
||||
+#define isl_local_space_free (*cloog_pointers__.p_isl_local_space_free)
|
||||
+#define isl_local_space_from_space (*cloog_pointers__.p_isl_local_space_from_space)
|
||||
+#define isl_local_space_range (*cloog_pointers__.p_isl_local_space_range)
|
||||
+#define isl_map_add_constraint (*cloog_pointers__.p_isl_map_add_constraint)
|
||||
+#define isl_map_add_dims (*cloog_pointers__.p_isl_map_add_dims)
|
||||
+#define isl_map_align_params (*cloog_pointers__.p_isl_map_align_params)
|
||||
+#define isl_map_apply_range (*cloog_pointers__.p_isl_map_apply_range)
|
||||
+#define isl_map_copy (*cloog_pointers__.p_isl_map_copy)
|
||||
+#define isl_map_dim (*cloog_pointers__.p_isl_map_dim)
|
||||
+#define isl_map_dump (*cloog_pointers__.p_isl_map_dump)
|
||||
+#define isl_map_equate (*cloog_pointers__.p_isl_map_equate)
|
||||
+#define isl_map_fix_si (*cloog_pointers__.p_isl_map_fix_si)
|
||||
+#define isl_map_flat_product (*cloog_pointers__.p_isl_map_flat_product)
|
||||
+#define isl_map_flat_range_product (*cloog_pointers__.p_isl_map_flat_range_product)
|
||||
+#define isl_map_free (*cloog_pointers__.p_isl_map_free)
|
||||
+#define isl_map_from_basic_map (*cloog_pointers__.p_isl_map_from_basic_map)
|
||||
+#define isl_map_from_pw_aff (*cloog_pointers__.p_isl_map_from_pw_aff)
|
||||
+#define isl_map_from_union_map (*cloog_pointers__.p_isl_map_from_union_map)
|
||||
+#define isl_map_get_ctx (*cloog_pointers__.p_isl_map_get_ctx)
|
||||
+#define isl_map_get_space (*cloog_pointers__.p_isl_map_get_space)
|
||||
+#define isl_map_get_tuple_id (*cloog_pointers__.p_isl_map_get_tuple_id)
|
||||
+#define isl_map_insert_dims (*cloog_pointers__.p_isl_map_insert_dims)
|
||||
+#define isl_map_intersect (*cloog_pointers__.p_isl_map_intersect)
|
||||
+#define isl_map_intersect_domain (*cloog_pointers__.p_isl_map_intersect_domain)
|
||||
+#define isl_map_intersect_range (*cloog_pointers__.p_isl_map_intersect_range)
|
||||
+#define isl_map_is_empty (*cloog_pointers__.p_isl_map_is_empty)
|
||||
+#define isl_map_lex_ge (*cloog_pointers__.p_isl_map_lex_ge)
|
||||
+#define isl_map_lex_le (*cloog_pointers__.p_isl_map_lex_le)
|
||||
+#define isl_map_n_out (*cloog_pointers__.p_isl_map_n_out)
|
||||
+#define isl_map_range (*cloog_pointers__.p_isl_map_range)
|
||||
+#define isl_map_set_tuple_id (*cloog_pointers__.p_isl_map_set_tuple_id)
|
||||
+#define isl_map_universe (*cloog_pointers__.p_isl_map_universe)
|
||||
+#define isl_options_set_on_error (*cloog_pointers__.p_isl_options_set_on_error)
|
||||
+#define isl_options_set_schedule_fuse (*cloog_pointers__.p_isl_options_set_schedule_fuse)
|
||||
+#define isl_options_set_schedule_max_constant_term (*cloog_pointers__.p_isl_options_set_schedule_max_constant_term)
|
||||
+#define isl_options_set_schedule_maximize_band_depth (*cloog_pointers__.p_isl_options_set_schedule_maximize_band_depth)
|
||||
+#define isl_printer_free (*cloog_pointers__.p_isl_printer_free)
|
||||
+#define isl_printer_print_aff (*cloog_pointers__.p_isl_printer_print_aff)
|
||||
+#define isl_printer_print_constraint (*cloog_pointers__.p_isl_printer_print_constraint)
|
||||
+#define isl_printer_print_map (*cloog_pointers__.p_isl_printer_print_map)
|
||||
+#define isl_printer_print_set (*cloog_pointers__.p_isl_printer_print_set)
|
||||
+#define isl_printer_to_file (*cloog_pointers__.p_isl_printer_to_file)
|
||||
+#define isl_pw_aff_add (*cloog_pointers__.p_isl_pw_aff_add)
|
||||
+#define isl_pw_aff_alloc (*cloog_pointers__.p_isl_pw_aff_alloc)
|
||||
+#define isl_pw_aff_copy (*cloog_pointers__.p_isl_pw_aff_copy)
|
||||
+#define isl_pw_aff_eq_set (*cloog_pointers__.p_isl_pw_aff_eq_set)
|
||||
+#define isl_pw_aff_free (*cloog_pointers__.p_isl_pw_aff_free)
|
||||
+#define isl_pw_aff_from_aff (*cloog_pointers__.p_isl_pw_aff_from_aff)
|
||||
+#define isl_pw_aff_ge_set (*cloog_pointers__.p_isl_pw_aff_ge_set)
|
||||
+#define isl_pw_aff_gt_set (*cloog_pointers__.p_isl_pw_aff_gt_set)
|
||||
+#define isl_pw_aff_is_cst (*cloog_pointers__.p_isl_pw_aff_is_cst)
|
||||
+#define isl_pw_aff_le_set (*cloog_pointers__.p_isl_pw_aff_le_set)
|
||||
+#define isl_pw_aff_lt_set (*cloog_pointers__.p_isl_pw_aff_lt_set)
|
||||
+#define isl_pw_aff_mod (*cloog_pointers__.p_isl_pw_aff_mod)
|
||||
+#define isl_pw_aff_mul (*cloog_pointers__.p_isl_pw_aff_mul)
|
||||
+#define isl_pw_aff_ne_set (*cloog_pointers__.p_isl_pw_aff_ne_set)
|
||||
+#define isl_pw_aff_nonneg_set (*cloog_pointers__.p_isl_pw_aff_nonneg_set)
|
||||
+#define isl_pw_aff_set_tuple_id (*cloog_pointers__.p_isl_pw_aff_set_tuple_id)
|
||||
+#define isl_pw_aff_sub (*cloog_pointers__.p_isl_pw_aff_sub)
|
||||
+#define isl_pw_aff_zero_set (*cloog_pointers__.p_isl_pw_aff_zero_set)
|
||||
+#define isl_schedule_free (*cloog_pointers__.p_isl_schedule_free)
|
||||
+#define isl_schedule_get_band_forest (*cloog_pointers__.p_isl_schedule_get_band_forest)
|
||||
+#define isl_set_add_constraint (*cloog_pointers__.p_isl_set_add_constraint)
|
||||
+#define isl_set_add_dims (*cloog_pointers__.p_isl_set_add_dims)
|
||||
+#define isl_set_apply (*cloog_pointers__.p_isl_set_apply)
|
||||
+#define isl_set_coalesce (*cloog_pointers__.p_isl_set_coalesce)
|
||||
+#define isl_set_copy (*cloog_pointers__.p_isl_set_copy)
|
||||
+#define isl_set_dim (*cloog_pointers__.p_isl_set_dim)
|
||||
+#define isl_set_fix_si (*cloog_pointers__.p_isl_set_fix_si)
|
||||
+#define isl_set_free (*cloog_pointers__.p_isl_set_free)
|
||||
+#define isl_set_from_cloog_domain (*cloog_pointers__.p_isl_set_from_cloog_domain)
|
||||
+#define isl_set_get_space (*cloog_pointers__.p_isl_set_get_space)
|
||||
+#define isl_set_get_tuple_id (*cloog_pointers__.p_isl_set_get_tuple_id)
|
||||
+#define isl_set_intersect (*cloog_pointers__.p_isl_set_intersect)
|
||||
+#define isl_set_is_empty (*cloog_pointers__.p_isl_set_is_empty)
|
||||
+#define isl_set_max (*cloog_pointers__.p_isl_set_max)
|
||||
+#define isl_set_min (*cloog_pointers__.p_isl_set_min)
|
||||
+#define isl_set_n_dim (*cloog_pointers__.p_isl_set_n_dim)
|
||||
+#define isl_set_nat_universe (*cloog_pointers__.p_isl_set_nat_universe)
|
||||
+#define isl_set_project_out (*cloog_pointers__.p_isl_set_project_out)
|
||||
+#define isl_set_set_tuple_id (*cloog_pointers__.p_isl_set_set_tuple_id)
|
||||
+#define isl_set_universe (*cloog_pointers__.p_isl_set_universe)
|
||||
+#define isl_space_add_dims (*cloog_pointers__.p_isl_space_add_dims)
|
||||
+#define isl_space_alloc (*cloog_pointers__.p_isl_space_alloc)
|
||||
+#define isl_space_copy (*cloog_pointers__.p_isl_space_copy)
|
||||
+#define isl_space_dim (*cloog_pointers__.p_isl_space_dim)
|
||||
+#define isl_space_domain (*cloog_pointers__.p_isl_space_domain)
|
||||
+#define isl_space_find_dim_by_id (*cloog_pointers__.p_isl_space_find_dim_by_id)
|
||||
+#define isl_space_free (*cloog_pointers__.p_isl_space_free)
|
||||
+#define isl_space_from_domain (*cloog_pointers__.p_isl_space_from_domain)
|
||||
+#define isl_space_get_tuple_id (*cloog_pointers__.p_isl_space_get_tuple_id)
|
||||
+#define isl_space_params_alloc (*cloog_pointers__.p_isl_space_params_alloc)
|
||||
+#define isl_space_range (*cloog_pointers__.p_isl_space_range)
|
||||
+#define isl_space_set_alloc (*cloog_pointers__.p_isl_space_set_alloc)
|
||||
+#define isl_space_set_dim_id (*cloog_pointers__.p_isl_space_set_dim_id)
|
||||
+#define isl_space_set_tuple_id (*cloog_pointers__.p_isl_space_set_tuple_id)
|
||||
+#define isl_union_map_add_map (*cloog_pointers__.p_isl_union_map_add_map)
|
||||
+#define isl_union_map_align_params (*cloog_pointers__.p_isl_union_map_align_params)
|
||||
+#define isl_union_map_apply_domain (*cloog_pointers__.p_isl_union_map_apply_domain)
|
||||
+#define isl_union_map_apply_range (*cloog_pointers__.p_isl_union_map_apply_range)
|
||||
+#define isl_union_map_compute_flow (*cloog_pointers__.p_isl_union_map_compute_flow)
|
||||
+#define isl_union_map_copy (*cloog_pointers__.p_isl_union_map_copy)
|
||||
+#define isl_union_map_empty (*cloog_pointers__.p_isl_union_map_empty)
|
||||
+#define isl_union_map_flat_range_product (*cloog_pointers__.p_isl_union_map_flat_range_product)
|
||||
+#define isl_union_map_foreach_map (*cloog_pointers__.p_isl_union_map_foreach_map)
|
||||
+#define isl_union_map_free (*cloog_pointers__.p_isl_union_map_free)
|
||||
+#define isl_union_map_from_map (*cloog_pointers__.p_isl_union_map_from_map)
|
||||
+#define isl_union_map_get_ctx (*cloog_pointers__.p_isl_union_map_get_ctx)
|
||||
+#define isl_union_map_get_space (*cloog_pointers__.p_isl_union_map_get_space)
|
||||
+#define isl_union_map_gist_domain (*cloog_pointers__.p_isl_union_map_gist_domain)
|
||||
+#define isl_union_map_gist_range (*cloog_pointers__.p_isl_union_map_gist_range)
|
||||
+#define isl_union_map_intersect_domain (*cloog_pointers__.p_isl_union_map_intersect_domain)
|
||||
+#define isl_union_map_is_empty (*cloog_pointers__.p_isl_union_map_is_empty)
|
||||
+#define isl_union_map_subtract (*cloog_pointers__.p_isl_union_map_subtract)
|
||||
+#define isl_union_map_union (*cloog_pointers__.p_isl_union_map_union)
|
||||
+#define isl_union_set_add_set (*cloog_pointers__.p_isl_union_set_add_set)
|
||||
+#define isl_union_set_compute_schedule (*cloog_pointers__.p_isl_union_set_compute_schedule)
|
||||
+#define isl_union_set_copy (*cloog_pointers__.p_isl_union_set_copy)
|
||||
+#define isl_union_set_empty (*cloog_pointers__.p_isl_union_set_empty)
|
||||
+#define isl_union_set_from_set (*cloog_pointers__.p_isl_union_set_from_set)
|
||||
+#define stmt_ass (*cloog_pointers__.p_stmt_ass)
|
||||
+#define stmt_block (*cloog_pointers__.p_stmt_block)
|
||||
+#define stmt_for (*cloog_pointers__.p_stmt_for)
|
||||
+#define stmt_guard (*cloog_pointers__.p_stmt_guard)
|
||||
+#define stmt_root (*cloog_pointers__.p_stmt_root)
|
||||
+#define stmt_user (*cloog_pointers__.p_stmt_user)
|
||||
+
|
||||
typedef struct poly_dr *poly_dr_p;
|
||||
|
||||
typedef struct poly_bb *poly_bb_p;
|
||||
--- a/gcc/graphite.c.jj 2012-12-13 11:31:00.000000000 +0100
|
||||
+++ b/gcc/graphite.c 2012-12-14 13:40:44.155136961 +0100
|
||||
@@ -78,6 +78,34 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
CloogState *cloog_state;
|
||||
|
||||
+__typeof (cloog_pointers__) cloog_pointers__;
|
||||
+
|
||||
+static bool
|
||||
+init_cloog_pointers (void)
|
||||
+{
|
||||
+ void *h;
|
||||
+
|
||||
+ if (cloog_pointers__.inited)
|
||||
+ return cloog_pointers__.h != NULL;
|
||||
+ h = dlopen ("libcloog-isl.so.4", RTLD_LAZY);
|
||||
+ cloog_pointers__.h = h;
|
||||
+ if (h == NULL)
|
||||
+ return false;
|
||||
+#define DYNSYM(x) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \
|
||||
+ u.q = dlsym (h, #x); \
|
||||
+ if (u.q == NULL) \
|
||||
+ return false; \
|
||||
+ cloog_pointers__.p_##x = u.p; \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+ DYNSYMS
|
||||
+#undef DYNSYM
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
/* Print global statistics to FILE. */
|
||||
|
||||
static void
|
||||
@@ -277,6 +305,15 @@ graphite_transform_loops (void)
|
||||
if (parallelized_function_p (cfun->decl))
|
||||
return;
|
||||
|
||||
+ if (number_of_loops (cfun) <= 1)
|
||||
+ return;
|
||||
+
|
||||
+ if (!init_cloog_pointers ())
|
||||
+ {
|
||||
+ sorry ("Graphite loop optimizations cannot be used");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
ctx = isl_ctx_alloc ();
|
||||
isl_options_set_on_error (ctx, ISL_ON_ERROR_ABORT);
|
||||
if (!graphite_initialize (ctx))
|
||||
--- a/gcc/graphite-clast-to-gimple.c.jj 2012-12-13 11:31:27.000000000 +0100
|
||||
+++ b/gcc/graphite-clast-to-gimple.c 2012-12-14 13:27:47.196519858 +0100
|
||||
@@ -910,7 +910,7 @@ compute_bounds_for_loop (struct clast_fo
|
||||
from STMT_FOR. */
|
||||
|
||||
static tree
|
||||
-type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip)
|
||||
+type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip)
|
||||
{
|
||||
mpz_t bound_one, bound_two;
|
||||
tree lb_type, ub_type;
|
||||
@@ -918,8 +918,8 @@ type_for_clast_for (struct clast_for *st
|
||||
mpz_init (bound_one);
|
||||
mpz_init (bound_two);
|
||||
|
||||
- lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two);
|
||||
- ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two);
|
||||
+ lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two);
|
||||
+ ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two);
|
||||
|
||||
mpz_clear (bound_one);
|
||||
mpz_clear (bound_two);
|
||||
@@ -1,12 +0,0 @@
|
||||
*esp_cc1_pie:
|
||||
|
||||
|
||||
*esp_options_pie:
|
||||
|
||||
|
||||
*esp_link_pie_check:
|
||||
|
||||
|
||||
*esp_link_pie:
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
%include <hardenednossp.specs>
|
||||
%include <hardenednopie.specs>
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
*esp_cc1_ssp:
|
||||
|
||||
|
||||
*esp_options_ssp:
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
Highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
|
||||
diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
|
||||
--- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
|
||||
+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
|
||||
@@ -772,8 +772,9 @@
|
||||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
|
||||
+all: libgcc_eh.a
|
||||
ifeq ($(enable_shared),yes)
|
||||
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
|
||||
+all: libgcc_s$(SHLIB_EXT)
|
||||
ifneq ($(LIBUNWIND),)
|
||||
all: libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
@@ -950,10 +951,6 @@
|
||||
install-shared:
|
||||
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
|
||||
|
||||
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
-
|
||||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
|
||||
@shlib_base_name@,libgcc_s,$(subst \
|
||||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
|
||||
@@ -968,6 +965,10 @@
|
||||
chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
|
||||
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+
|
||||
parts="$(INSTALL_PARTS)"; \
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
@@ -1,27 +0,0 @@
|
||||
Fix conflicting prototype of posix_memalign for c++
|
||||
http://www.openwall.com/lists/musl/2013/11/10/1
|
||||
|
||||
--- ./gcc/config/i386/pmm_malloc.h.orig
|
||||
+++ ./gcc/config/i386/pmm_malloc.h
|
||||
@@ -28,11 +28,7 @@
|
||||
|
||||
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
|
||||
may not be visible. */
|
||||
-#ifndef __cplusplus
|
||||
-extern int posix_memalign (void **, size_t, size_t);
|
||||
-#else
|
||||
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
||||
-#endif
|
||||
+extern int __gcc_posix_memalign (void **, size_t, size_t) __asm__("posix_memalign");
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t size, size_t alignment)
|
||||
@@ -42,7 +38,7 @@
|
||||
return malloc (size);
|
||||
if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
|
||||
alignment = sizeof (void *);
|
||||
- if (posix_memalign (&ptr, alignment, size) == 0)
|
||||
+ if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
|
||||
return ptr;
|
||||
else
|
||||
return NULL;
|
||||
@@ -1,17 +0,0 @@
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63740
|
||||
|
||||
--- trunk/gcc/lra-lives.c 2014/06/16 09:25:26 211700
|
||||
+++ trunk/gcc/lra-lives.c 2014/06/16 09:58:34 211701
|
||||
@@ -558,7 +558,11 @@
|
||||
/* It might be 'inheritance pseudo <- reload pseudo'. */
|
||||
|| (src_regno >= lra_constraint_new_regno_start
|
||||
&& ((int) REGNO (SET_DEST (set))
|
||||
- >= lra_constraint_new_regno_start))))
|
||||
+ >= lra_constraint_new_regno_start)
|
||||
+ /* Remember to skip special cases where src/dest regnos are
|
||||
+ the same, e.g. insn SET pattern has matching constraints
|
||||
+ like =r,0. */
|
||||
+ && src_regno != (int) REGNO (SET_DEST (set)))))
|
||||
{
|
||||
int hard_regno = -1, regno = -1;
|
||||
|
||||
Loaded 100 of 3091 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user