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 | ||
|
|
fa786b02a3 | ||
|
|
5943517ffe | ||
|
|
9ebdbd023c | ||
|
|
625a71bf25 | ||
|
|
f099d73fc8 | ||
|
|
af5baee543 | ||
|
|
7b05eb6fce | ||
|
|
d3bde7f838 | ||
|
|
de7a6777b4 | ||
|
|
cc4f72f35a | ||
|
|
6e7b75abb5 | ||
|
|
f7f7716efa | ||
|
|
55503f0e52 | ||
|
|
f4d9d832e2 | ||
|
|
040ce14a22 | ||
|
|
d1cba29182 | ||
|
|
e7c0fde43f | ||
|
|
16e5be302a | ||
|
|
21f535583a | ||
|
|
98afa750e7 | ||
|
|
38fea40bcc | ||
|
|
425340a353 | ||
|
|
0ff83cbedc | ||
|
|
b7d90580b3 | ||
|
|
f2acd86a08 | ||
|
|
1d562fc44b | ||
|
|
7d697fef05 | ||
|
|
c5692dfc71 | ||
|
|
962a64697d | ||
|
|
e86ac9a493 | ||
|
|
6a31acecfe | ||
|
|
6ddca124a1 | ||
|
|
7c62928fd5 | ||
|
|
e4820e1ed2 | ||
|
|
3ce53843f0 | ||
|
|
ff8d7458ef | ||
|
|
b713582d98 | ||
|
|
99b8c5b1e5 | ||
|
|
e2cbd9e4ed | ||
|
|
6a8a62c327 | ||
|
|
6fe006aa52 | ||
|
|
49a45c5567 | ||
|
|
652b3b85e4 | ||
|
|
37893a4bda | ||
|
|
8ae5611a3e | ||
|
|
c0d3428ad6 | ||
|
|
d49e0a8628 | ||
|
|
f28ffc0ec5 | ||
|
|
4a6f4594da | ||
|
|
f7a938b1a7 | ||
|
|
c57aa7b299 | ||
|
|
e968923155 | ||
|
|
d994993030 | ||
|
|
ed35f094e7 | ||
|
|
cfd23ff202 | ||
|
|
6e6bc2e1ea | ||
|
|
96a6e6817c | ||
|
|
68feafaea3 | ||
|
|
1c2b90df6f | ||
|
|
320ebcd2c8 | ||
|
|
89126941c5 | ||
|
|
4e2766552c | ||
|
|
88e1d0d0d3 | ||
|
|
00e0036ff2 | ||
|
|
361114359f | ||
|
|
8c97c2d27f | ||
|
|
ff000af8a8 | ||
|
|
bb5731fc5a | ||
|
|
0ccb5c05fd | ||
|
|
c0f7cd679d | ||
|
|
f35f577011 | ||
|
|
aa77b10c44 | ||
|
|
3b96926f6f | ||
|
|
1c5ce5f16f | ||
|
|
d228df99c1 | ||
|
|
bf4cdd65c1 | ||
|
|
3ff6fc578b | ||
|
|
9d9c735a0a | ||
|
|
9aa3a65a83 | ||
|
|
354e454c8f | ||
|
|
2748241a2f | ||
|
|
7ae5c5fb03 | ||
|
|
437d1d8ebb | ||
|
|
a7efb145a9 | ||
|
|
3a82b531f5 | ||
|
|
0a202c17c2 | ||
|
|
a6bc3c30eb | ||
|
|
5612316c92 | ||
|
|
10fc2090d2 | ||
|
|
8497cd0433 | ||
|
|
e4ef9fba72 | ||
|
|
e8c76175f6 | ||
|
|
c3b1ffe1df | ||
|
|
c48037d5ed | ||
|
|
22a5e4dda5 | ||
|
|
e4a4e80667 | ||
|
|
515081af20 | ||
|
|
67706609f9 | ||
|
|
c395f9c94b | ||
|
|
144b88ef16 | ||
|
|
2d0c5adc2d | ||
|
|
4b7706d562 | ||
|
|
407911ab1a | ||
|
|
be2f27a342 | ||
|
|
eb776065a5 | ||
|
|
deec2ee3b8 | ||
|
|
b9af242f4f | ||
|
|
332b6b5d6e | ||
|
|
ac1a2e71f2 | ||
|
|
7bef094fae | ||
|
|
2305bc9762 | ||
|
|
71c3d3cc90 | ||
|
|
8bcf432326 | ||
|
|
4b8f37e46e | ||
|
|
afe338cee4 | ||
|
|
1d67df18b2 | ||
|
|
79532aac89 | ||
|
|
5b98e52851 | ||
|
|
529c00a012 | ||
|
|
572bd339c8 | ||
|
|
ca30770d60 | ||
|
|
0d9d0e2ee6 | ||
|
|
c4e1ebb38f | ||
|
|
2c4f0621b4 | ||
|
|
83a4ab75e8 | ||
|
|
e1fd838cc9 | ||
|
|
a1129ee0a1 | ||
|
|
accd854378 | ||
|
|
1c99082f9d | ||
|
|
3cb681bc87 | ||
|
|
0bb64c2e96 | ||
|
|
8d2731467e | ||
|
|
88e9ab4c75 | ||
|
|
8d5d3c9ef2 | ||
|
|
e3e31a5617 | ||
|
|
919265006b | ||
|
|
b0ab6a04b0 | ||
|
|
5edfdf1ddb | ||
|
|
81a3cf755e | ||
|
|
097dbf783c | ||
|
|
b8444ed8a3 | ||
|
|
337b7939a2 | ||
|
|
d639bff0da | ||
|
|
c1d1e1a6f8 | ||
|
|
eed8631c02 | ||
|
|
6db0e21df7 | ||
|
|
6606d81688 | ||
|
|
0c4c50d071 | ||
|
|
e13377c1ef | ||
|
|
577564795a | ||
|
|
3a6500492e | ||
|
|
0eb590d611 | ||
|
|
cc3e4a1812 | ||
|
|
d0588c4046 | ||
|
|
c175be405a | ||
|
|
8512075ff0 | ||
|
|
620b40d37a | ||
|
|
7b9b00d2dd | ||
|
|
ce8dcc54a2 | ||
|
|
0688e7b9ab | ||
|
|
53fc41e7d0 | ||
|
|
ea96c354c0 | ||
|
|
45657e430c | ||
|
|
8c39c913d1 | ||
|
|
0a9ac24560 | ||
|
|
3ac6f21c6c | ||
|
|
1ccfe1bffe | ||
|
|
47e4a2d67e | ||
|
|
8f994d8c34 | ||
|
|
61e0dce335 | ||
|
|
4a6dd5fd67 | ||
|
|
98349c48f9 | ||
|
|
a2b1accbc0 | ||
|
|
4d327313e4 | ||
|
|
b4760587b7 | ||
|
|
7842ad231b | ||
|
|
c5c8d507ff | ||
|
|
4929c227ed | ||
|
|
aad151f3ee | ||
|
|
6e33ebe6f3 | ||
|
|
e42ff4ebd4 | ||
|
|
9b9a47ed2c | ||
|
|
d22d501091 | ||
|
|
6410ab3fe5 | ||
|
|
02c6181e57 | ||
|
|
e4a99772e8 | ||
|
|
4351a5bc1c | ||
|
|
0141b19438 | ||
|
|
676f86fd43 | ||
|
|
deefe27fc0 | ||
|
|
f85d5fa3fd | ||
|
|
3a09499708 | ||
|
|
5298584f14 | ||
|
|
5a06a6bb06 | ||
|
|
c7368d68c6 | ||
|
|
d135ba5499 | ||
|
|
d5690fcc36 | ||
|
|
f856e967d8 | ||
|
|
fde9171d6a | ||
|
|
3ee2cec714 | ||
|
|
64b8f211f4 | ||
|
|
42c0d5bed3 | ||
|
|
55d402c0b3 | ||
|
|
690d55512e | ||
|
|
12e548fe4a | ||
|
|
1e1d6a7ee3 | ||
|
|
411f3160a3 | ||
|
|
0f5fd1f8fc | ||
|
|
65c0da83a0 | ||
|
|
efd7a047bd | ||
|
|
b581147c0b | ||
|
|
8e5edb3858 | ||
|
|
a7daff97d1 | ||
|
|
13e9c9e9b5 | ||
|
|
e07b405b69 | ||
|
|
632792f85d |
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,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import sys
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import argparse
|
||||
@@ -16,6 +16,14 @@ def get_devices():
|
||||
"/..")))
|
||||
for path in glob.glob(pmaports + "/device/*/device-*/"):
|
||||
device = os.path.dirname(path).split("device-", 1)[1]
|
||||
|
||||
# -downstream suffix is used when packaging the downstream kernel for
|
||||
# devices that have a working mainline kernel. Those are usually
|
||||
# unmaintained and therefore might not appear in the wiki. However,
|
||||
# the main device should be documented (remove the -downstream suffix).
|
||||
if device.endswith('-downstream'):
|
||||
device = device[:-len('-downstream')]
|
||||
|
||||
ret.append(device)
|
||||
return sorted(ret)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Various functions used in CI scripts
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Require pmbootstrap
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
set -e
|
||||
@@ -16,7 +16,6 @@ fi
|
||||
# Shell: shellcheck
|
||||
sh_files="
|
||||
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
|
||||
./main/postmarketos-base/rootfs-usr-libexec-elogind-system-sleep-suspend-disable-conditions.hook
|
||||
./main/postmarketos-mkinitfs/init.sh.in
|
||||
./main/postmarketos-mkinitfs/init_functions.sh
|
||||
./main/postmarketos-mkinitfs/mkinitfs.sh
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import shutil
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
pmaports = os.path.realpath(f"{os.path.dirname(__file__)}/../..")
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", pmaports,
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
@@ -1,289 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
import pmb.parse.apkindex
|
||||
import pmb.helpers.repo
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
pmaports = os.path.realpath(f"{os.path.dirname(__file__)}/../..")
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", pmaports,
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
def deviceinfo_obsolete(info):
|
||||
"""
|
||||
Test for obsolete options used in the deviceinfo file. They must still be
|
||||
defined in pmbootstrap's config/__init__.py.
|
||||
"""
|
||||
obsolete_options = ["weston_pixman_type"]
|
||||
for option in obsolete_options:
|
||||
if info[option]:
|
||||
raise RuntimeError("option '" + option + "' is obsolete, please"
|
||||
" remove it (reasons for removal are at"
|
||||
" <https://postmarketos.org/deviceinfo>)")
|
||||
|
||||
|
||||
def test_deviceinfo(args):
|
||||
"""
|
||||
Parse all deviceinfo files successfully and run checks on the parsed data.
|
||||
"""
|
||||
# Iterate over all devices
|
||||
last_exception = None
|
||||
count = 0
|
||||
for folder in glob.glob(args.aports + "/device/*/device-*"):
|
||||
device = folder[len(args.aports):].split("-", 1)[1]
|
||||
|
||||
try:
|
||||
# Successful deviceinfo parsing / obsolete options
|
||||
info = pmb.parse.deviceinfo(args, device)
|
||||
deviceinfo_obsolete(info)
|
||||
|
||||
# deviceinfo_name must start with manufacturer
|
||||
name = info["name"]
|
||||
manufacturer = info["manufacturer"]
|
||||
if not name.startswith(manufacturer) and \
|
||||
not name.startswith("Google"):
|
||||
raise RuntimeError("Please add the manufacturer in front of"
|
||||
" the deviceinfo_name, e.g.: '" +
|
||||
manufacturer + " " + name + "'")
|
||||
|
||||
# Don't abort on first error
|
||||
except Exception as e:
|
||||
last_exception = e
|
||||
count += 1
|
||||
print(device + ": " + str(e))
|
||||
|
||||
# Raise the last exception
|
||||
if last_exception:
|
||||
print("deviceinfo error count: " + str(count))
|
||||
raise last_exception
|
||||
|
||||
|
||||
def device_dependency_check(apkbuild, path):
|
||||
""" Raise an error if a device package has a dependency that is not allowed
|
||||
(e.g. because it should be in a subpackage instead). """
|
||||
|
||||
# asus-me176c: without this, the device will simply run the broken ACPI
|
||||
# DSDT table, so we might as well update it. See pmaports!699.
|
||||
firmware_ok = {"device-asus-me176c": ["firmware-asus-me176c-acpi"]}
|
||||
|
||||
pkgname = apkbuild["pkgname"]
|
||||
for depend in apkbuild["depends"]:
|
||||
if (depend.startswith("firmware-") or
|
||||
depend.startswith("linux-firmware")):
|
||||
if pkgname in firmware_ok and depend in firmware_ok[pkgname]:
|
||||
continue
|
||||
raise RuntimeError("Firmware package '" + depend + "' found in"
|
||||
" depends of " + path + ". These go into"
|
||||
" subpackages now, see"
|
||||
" <https://postmarketos.org/devicepkg>.")
|
||||
|
||||
|
||||
def test_aports_kernel(args):
|
||||
"""
|
||||
Various tests performed on the /**/linux-* aports.
|
||||
"""
|
||||
for path in glob.iglob(args.aports + "**/linux-*/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
if "pmb:cross-native" not in apkbuild["options"]:
|
||||
raise RuntimeError("\"pmb:cross-native\" missing in"
|
||||
f" options= line: {path}")
|
||||
|
||||
|
||||
def test_aports_device(args):
|
||||
"""
|
||||
Various tests performed on the /device/*/device-* aports.
|
||||
"""
|
||||
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
# Depends: Require "postmarketos-base"
|
||||
if "postmarketos-base" not in apkbuild["depends"]:
|
||||
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
|
||||
path)
|
||||
|
||||
# Depends: Must not have firmware packages
|
||||
for depend in apkbuild["depends"]:
|
||||
device_dependency_check(apkbuild, path)
|
||||
|
||||
# Architecture
|
||||
device = apkbuild["pkgname"][len("device-"):]
|
||||
deviceinfo = pmb.parse.deviceinfo(args, device)
|
||||
if "".join(apkbuild["arch"]) != deviceinfo["arch"]:
|
||||
raise RuntimeError("wrong architecture, please change to arch=\"" +
|
||||
deviceinfo["arch"] + "\": " + path)
|
||||
if "!archcheck" not in apkbuild["options"]:
|
||||
raise RuntimeError("!archcheck missing in options= line: " + path)
|
||||
|
||||
|
||||
def test_aports_device_kernel(args):
|
||||
"""
|
||||
Verify the kernels specified in the device packages:
|
||||
* Kernel must not be in depends when kernels are in subpackages
|
||||
* Check if only one kernel is defined in depends
|
||||
"""
|
||||
|
||||
# Iterate over device aports
|
||||
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
# Parse apkbuild and kernels from subpackages
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
device = apkbuild["pkgname"][len("device-"):]
|
||||
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
|
||||
|
||||
# Parse kernels from depends
|
||||
kernels_depends = []
|
||||
for depend in apkbuild["depends"]:
|
||||
if not depend.startswith("linux-"):
|
||||
continue
|
||||
kernels_depends.append(depend)
|
||||
|
||||
# Kernel in subpackages *and* depends
|
||||
if kernels_subpackages:
|
||||
raise RuntimeError("Kernel package '" + depend + "' needs to"
|
||||
" be removed when using kernel" +
|
||||
" subpackages: " + path)
|
||||
|
||||
# No kernel
|
||||
if not kernels_depends and not kernels_subpackages:
|
||||
raise RuntimeError("Device doesn't have a kernel in depends or"
|
||||
" subpackages: " + path)
|
||||
|
||||
# Multiple kernels in depends
|
||||
if len(kernels_depends) > 1:
|
||||
raise RuntimeError("Please use kernel subpackages instead of"
|
||||
" multiple kernels in depends (see"
|
||||
" <https://postmarketos.org/devicepkg>): " +
|
||||
path)
|
||||
|
||||
|
||||
def parse_source_from_checksums(args, apkbuild_path):
|
||||
"""
|
||||
Read the APKBUILD file and parse source files from the checksums at the
|
||||
bottom. This has always the same format, even if $source is built with hard
|
||||
to parse shell code (like in postmarketos-base).
|
||||
|
||||
:param apkbuild_path: full path to the APKBUILD
|
||||
:returns: list of parsed "source" files, e.g.:
|
||||
["first.patch", "second.patch"]
|
||||
"""
|
||||
start = 'sha512sums="'
|
||||
in_block = False
|
||||
ret = []
|
||||
|
||||
with open(apkbuild_path, encoding="utf-8") as handle:
|
||||
for line in handle.readlines():
|
||||
# Find start
|
||||
if not in_block:
|
||||
if line.startswith(start):
|
||||
in_block = True
|
||||
else:
|
||||
continue
|
||||
|
||||
# sha512sums may have lines without checksums:
|
||||
# https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/73
|
||||
if " " not in line:
|
||||
continue
|
||||
|
||||
try:
|
||||
_, filename = line.rstrip().split(" ", 2)
|
||||
except ValueError:
|
||||
raise ValueError("Failed to parse checksums. Try to delete the"
|
||||
" checksums and generate them again with"
|
||||
f" 'pmbootstrap checksum': {apkbuild_path}")
|
||||
|
||||
# Find end
|
||||
if filename.endswith('"'):
|
||||
ret += [filename[:-1]]
|
||||
break
|
||||
|
||||
ret += [filename]
|
||||
return ret
|
||||
|
||||
|
||||
def test_aports_unreferenced_files(args):
|
||||
"""
|
||||
Raise an error if an unreferenced file is found
|
||||
"""
|
||||
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(args, apkbuild_path)
|
||||
sources_chk = parse_source_from_checksums(args, apkbuild_path)
|
||||
|
||||
# Collect install files from subpackages
|
||||
subpackage_installs = []
|
||||
if apkbuild["subpackages"]:
|
||||
for subpackage in apkbuild["subpackages"].values():
|
||||
if not subpackage:
|
||||
continue
|
||||
try:
|
||||
subpackage_installs += subpackage["install"]
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
# Collect trigger files
|
||||
trigger_sources = []
|
||||
if apkbuild["triggers"]:
|
||||
for trigger in apkbuild["triggers"]:
|
||||
trigger_sources.append(trigger.split("=")[0])
|
||||
|
||||
dirname = os.path.dirname(apkbuild_path)
|
||||
for file in glob.iglob(dirname + "/**", recursive=True):
|
||||
rel_file_path = os.path.relpath(file, dirname)
|
||||
# Skip APKBUILDs and directories
|
||||
if rel_file_path == "APKBUILD" or os.path.isdir(file):
|
||||
continue
|
||||
|
||||
if os.path.basename(rel_file_path) not in sources_chk \
|
||||
and rel_file_path not in apkbuild["install"] \
|
||||
and rel_file_path not in subpackage_installs \
|
||||
and rel_file_path not in trigger_sources:
|
||||
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
|
||||
|
||||
|
||||
def test_aports_ui(args):
|
||||
"""
|
||||
Raise an error if package in _pmb_recommends is not found
|
||||
"""
|
||||
for arch in pmb.config.build_device_architectures:
|
||||
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
# Skip if arch isn't enabled
|
||||
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
|
||||
continue
|
||||
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from"
|
||||
f" _pmb_recommends not found for arch '{arch}'")
|
||||
|
||||
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
|
||||
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
|
||||
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
|
||||
f"of -extras subpackage is not found for arch '{arch}'")
|
||||
@@ -0,0 +1,128 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
|
||||
|
||||
def device_dependency_check(apkbuild, path):
|
||||
""" Raise an error if a device package has a dependency that is not allowed
|
||||
(e.g. because it should be in a subpackage instead). """
|
||||
|
||||
# asus-me176c: without this, the device will simply run the broken ACPI
|
||||
# DSDT table, so we might as well update it. See pmaports!699.
|
||||
firmware_ok = {"device-asus-me176c": ["firmware-asus-me176c-acpi"]}
|
||||
|
||||
pkgname = apkbuild["pkgname"]
|
||||
for depend in apkbuild["depends"]:
|
||||
if (depend.startswith("firmware-") or
|
||||
depend.startswith("linux-firmware")):
|
||||
if pkgname in firmware_ok and depend in firmware_ok[pkgname]:
|
||||
continue
|
||||
raise RuntimeError("Firmware package '" + depend + "' found in"
|
||||
" depends of " + path + ". These go into"
|
||||
" subpackages now, see"
|
||||
" <https://postmarketos.org/devicepkg>.")
|
||||
|
||||
|
||||
def test_aports_device(args):
|
||||
"""
|
||||
Various tests performed on the /device/*/device-* aports.
|
||||
"""
|
||||
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
# Depends: Require "postmarketos-base"
|
||||
if "postmarketos-base" not in apkbuild["depends"]:
|
||||
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
|
||||
path)
|
||||
|
||||
# Depends: Must not have firmware packages
|
||||
for depend in apkbuild["depends"]:
|
||||
device_dependency_check(apkbuild, path)
|
||||
|
||||
# Architecture
|
||||
device = apkbuild["pkgname"][len("device-"):]
|
||||
deviceinfo = pmb.parse.deviceinfo(args, device)
|
||||
if "".join(apkbuild["arch"]) != deviceinfo["arch"]:
|
||||
raise RuntimeError("wrong architecture, please change to arch=\"" +
|
||||
deviceinfo["arch"] + "\": " + path)
|
||||
if "!archcheck" not in apkbuild["options"]:
|
||||
raise RuntimeError("!archcheck missing in options= line: " + path)
|
||||
|
||||
|
||||
def test_aports_device_kernel(args):
|
||||
"""
|
||||
Verify the kernels specified in the device packages:
|
||||
* Kernel must not be in depends when kernels are in subpackages
|
||||
* Check if only one kernel is defined in depends
|
||||
"""
|
||||
|
||||
# Iterate over device aports
|
||||
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
# Parse apkbuild and kernels from subpackages
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
device = apkbuild["pkgname"][len("device-"):]
|
||||
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
|
||||
|
||||
# Parse kernels from depends
|
||||
kernels_depends = []
|
||||
for depend in apkbuild["depends"]:
|
||||
if not depend.startswith("linux-"):
|
||||
continue
|
||||
kernels_depends.append(depend)
|
||||
|
||||
# Kernel in subpackages *and* depends
|
||||
if kernels_subpackages:
|
||||
raise RuntimeError("Kernel package '" + depend + "' needs to"
|
||||
" be removed when using kernel" +
|
||||
" subpackages: " + path)
|
||||
|
||||
# No kernel
|
||||
if not kernels_depends and not kernels_subpackages:
|
||||
raise RuntimeError("Device doesn't have a kernel in depends or"
|
||||
" subpackages: " + path)
|
||||
|
||||
# Multiple kernels in depends
|
||||
if len(kernels_depends) > 1:
|
||||
raise RuntimeError("Please use kernel subpackages instead of"
|
||||
" multiple kernels in depends (see"
|
||||
" <https://postmarketos.org/devicepkg>): " +
|
||||
path)
|
||||
|
||||
|
||||
def test_aports_maintained(args):
|
||||
"""
|
||||
Ensure that aports in /device/{main,community} have "Maintainer:" and
|
||||
"Co-Maintainer:" (only required for main) listed in their APKBUILDs.
|
||||
"""
|
||||
for path in glob.iglob(f"{args.aports}/device/main/*/APKBUILD"):
|
||||
if '/firmware-' in path:
|
||||
continue
|
||||
maintainers = pmb.parse._apkbuild.maintainers(path)
|
||||
assert maintainers and len(maintainers) >= 2, \
|
||||
f"{path} in main needs at least 1 Maintainer and 1 Co-Maintainer"
|
||||
|
||||
for path in glob.iglob(f"{args.aports}/device/community/*/APKBUILD"):
|
||||
if '/firmware-' in path:
|
||||
continue
|
||||
maintainers = pmb.parse._apkbuild.maintainers(path)
|
||||
assert maintainers, f"{path} in community needs at least 1 Maintainer"
|
||||
|
||||
|
||||
def test_aports_unmaintained(args):
|
||||
"""
|
||||
Ensure that aports in /device/unmaintained have an "Unmaintained:" comment
|
||||
that describes why the aport is unmaintained.
|
||||
"""
|
||||
for path in glob.iglob(f"{args.aports}/device/unmaintained/*/APKBUILD"):
|
||||
unmaintained = pmb.parse._apkbuild.unmaintained(path)
|
||||
assert unmaintained, f"{path} should have an Unmaintained: " +\
|
||||
"comment that describes why the package is unmaintained"
|
||||
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
|
||||
|
||||
def deviceinfo_obsolete(info):
|
||||
"""
|
||||
Test for obsolete options used in the deviceinfo file. They must still be
|
||||
defined in pmbootstrap's config/__init__.py.
|
||||
"""
|
||||
obsolete_options = ["weston_pixman_type"]
|
||||
for option in obsolete_options:
|
||||
if info[option]:
|
||||
raise RuntimeError("option '" + option + "' is obsolete, please"
|
||||
" remove it (reasons for removal are at"
|
||||
" <https://postmarketos.org/deviceinfo>)")
|
||||
|
||||
|
||||
def test_deviceinfo(args):
|
||||
"""
|
||||
Parse all deviceinfo files successfully and run checks on the parsed data.
|
||||
"""
|
||||
# Iterate over all devices
|
||||
last_exception = None
|
||||
count = 0
|
||||
for folder in glob.glob(args.aports + "/device/*/device-*"):
|
||||
device = folder[len(args.aports):].split("-", 1)[1]
|
||||
|
||||
try:
|
||||
# Successful deviceinfo parsing / obsolete options
|
||||
info = pmb.parse.deviceinfo(args, device)
|
||||
deviceinfo_obsolete(info)
|
||||
|
||||
# deviceinfo_name must start with manufacturer
|
||||
name = info["name"]
|
||||
manufacturer = info["manufacturer"]
|
||||
if not name.startswith(manufacturer) and \
|
||||
not name.startswith("Google"):
|
||||
raise RuntimeError("Please add the manufacturer in front of"
|
||||
" the deviceinfo_name, e.g.: '" +
|
||||
manufacturer + " " + name + "'")
|
||||
|
||||
# Don't abort on first error
|
||||
except Exception as e:
|
||||
last_exception = e
|
||||
count += 1
|
||||
print(device + ": " + str(e))
|
||||
|
||||
# Raise the last exception
|
||||
if last_exception:
|
||||
print("deviceinfo error count: " + str(count))
|
||||
raise last_exception
|
||||
@@ -10,6 +10,7 @@ expected_directories = [
|
||||
"device/community",
|
||||
"device/main",
|
||||
"device/testing",
|
||||
"device/unmaintained",
|
||||
"kde",
|
||||
"maemo",
|
||||
"main",
|
||||
|
||||
+1
-16
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
""" Make sure that components of frameworks (Qt, KDE, ...) have the same
|
||||
@@ -17,21 +17,6 @@ import pmb.config
|
||||
import pmb.parse
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
def get_categorized_packages(args):
|
||||
"""
|
||||
Parse all aports and categorize them.
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
|
||||
|
||||
def test_aports_kernel(args):
|
||||
"""
|
||||
Various tests performed on the /**/linux-* aports.
|
||||
"""
|
||||
for path in glob.iglob(args.aports + "**/linux-*/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
if "pmb:cross-native" not in apkbuild["options"]:
|
||||
raise RuntimeError("\"pmb:cross-native\" missing in"
|
||||
f" options= line: {path}")
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
|
||||
|
||||
def test_aports_ui(args):
|
||||
"""
|
||||
Raise an error if package in _pmb_recommends is not found
|
||||
"""
|
||||
for arch in pmb.config.build_device_architectures:
|
||||
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
# Skip if arch isn't enabled
|
||||
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
|
||||
continue
|
||||
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from"
|
||||
f" _pmb_recommends not found for arch '{arch}'")
|
||||
|
||||
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
|
||||
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
|
||||
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
|
||||
f"of -extras subpackage is not found for arch '{arch}'")
|
||||
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
import pmb.parse.apkindex
|
||||
import pmb.helpers.repo
|
||||
|
||||
|
||||
def parse_source_from_checksums(args, apkbuild_path):
|
||||
"""
|
||||
Read the APKBUILD file and parse source files from the checksums at the
|
||||
bottom. This has always the same format, even if $source is built with hard
|
||||
to parse shell code (like in postmarketos-base).
|
||||
|
||||
:param apkbuild_path: full path to the APKBUILD
|
||||
:returns: list of parsed "source" files, e.g.:
|
||||
["first.patch", "second.patch"]
|
||||
"""
|
||||
start = 'sha512sums="'
|
||||
in_block = False
|
||||
ret = []
|
||||
|
||||
with open(apkbuild_path, encoding="utf-8") as handle:
|
||||
for line in handle.readlines():
|
||||
# Find start
|
||||
if not in_block:
|
||||
if line.startswith(start):
|
||||
in_block = True
|
||||
else:
|
||||
continue
|
||||
|
||||
# sha512sums may have lines without checksums:
|
||||
# https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/73
|
||||
if " " not in line:
|
||||
continue
|
||||
|
||||
try:
|
||||
_, filename = line.rstrip().split(" ", 2)
|
||||
except ValueError:
|
||||
raise ValueError("Failed to parse checksums. Try to delete the"
|
||||
" checksums and generate them again with"
|
||||
f" 'pmbootstrap checksum': {apkbuild_path}")
|
||||
|
||||
# Find end
|
||||
if filename.endswith('"'):
|
||||
ret += [filename[:-1]]
|
||||
break
|
||||
|
||||
ret += [filename]
|
||||
return ret
|
||||
|
||||
|
||||
def test_aports_unreferenced_files(args):
|
||||
"""
|
||||
Raise an error if an unreferenced file is found
|
||||
"""
|
||||
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(args, apkbuild_path)
|
||||
sources_chk = parse_source_from_checksums(args, apkbuild_path)
|
||||
|
||||
# Collect install files from subpackages
|
||||
subpackage_installs = []
|
||||
if apkbuild["subpackages"]:
|
||||
for subpackage in apkbuild["subpackages"].values():
|
||||
if not subpackage:
|
||||
continue
|
||||
try:
|
||||
subpackage_installs += subpackage["install"]
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
# Collect trigger files
|
||||
trigger_sources = []
|
||||
if apkbuild["triggers"]:
|
||||
for trigger in apkbuild["triggers"]:
|
||||
trigger_sources.append(trigger.split("=")[0])
|
||||
|
||||
dirname = os.path.dirname(apkbuild_path)
|
||||
for file in glob.iglob(dirname + "/**", recursive=True):
|
||||
rel_file_path = os.path.relpath(file, dirname)
|
||||
# Skip APKBUILDs and directories
|
||||
if rel_file_path == "APKBUILD" or os.path.isdir(file):
|
||||
continue
|
||||
|
||||
if os.path.basename(rel_file_path) not in sources_chk \
|
||||
and rel_file_path not in apkbuild["install"] \
|
||||
and rel_file_path not in subpackage_installs \
|
||||
and rel_file_path not in trigger_sources:
|
||||
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html
|
||||
|
||||
device/*/*-pine64-pinephone/ @craftyguy
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan
|
||||
device/*/*-purism-librem5/ @craftyguy
|
||||
main/osk-sdl/ @craftyguy
|
||||
temp/u-boot-librem5/ @craftyguy
|
||||
|
||||
@@ -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.32.0
|
||||
pkgrel=8
|
||||
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="9e6078f585cee2f3bea8cc355a7f53d2efbebb47029f20f4c90f84acfbae7ade49bfff97c5b6e7eff0e4128d3f67c3f4d02e574cfa8d5483cba0a2dda2f679d5 busybox-static-1.32.0-r8-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.32.0
|
||||
pkgrel=8
|
||||
|
||||
_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="57cd3ab0e504a6a6ee27fb2aee902a4426136d1e0d3ae3a55003e5f3a4f7df03cce6c201244287f4315f4f8ba162f19fee18f3159f11a07015b7c37fe607d701 busybox-static-1.32.0-r8-armhf-edge.apk"
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.32.0
|
||||
pkgrel=8
|
||||
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="2e11a7a2b7474ddf0705f066e211bb89f2d17b81ef008080168b1cbbf6330810737e60cd44cd7ab5d0379841d78916ca9f4386e76ccf0e731dc9d69296454f8e busybox-static-1.32.0-r8-armv7-edge.apk"
|
||||
sha512sums="2bc95e9b443f124835ff293e701d9e146aa3d074b28323cb0e8f03f7c5fc90c59796bcc69dbfdc430ed831cd5ca49393207ef41de1ff04fda3a3099603a5924c busybox-static-1.32.1-r6-armv7-v3.13.apk"
|
||||
@@ -31,7 +31,7 @@ pkgver=10.2.1_pre1
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname=gcc-aarch64
|
||||
pkgrel=1
|
||||
pkgrel=3
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
|
||||
@@ -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=1
|
||||
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"
|
||||
@@ -31,7 +31,7 @@ pkgver=10.2.1_pre1
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname=gcc-armv7
|
||||
pkgrel=1
|
||||
pkgrel=3
|
||||
pkgdesc="Stage2 cross-compiler for armv7"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
|
||||
@@ -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
|
||||
Loaded 100 of 3095 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user