Compare commits
348
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dddc6d224 | ||
|
|
cbb3def4f0 | ||
|
|
496e9f57cf | ||
|
|
7388f558e0 | ||
|
|
e38f26e382 | ||
|
|
7afc86bdf4 | ||
|
|
fb7de042f5 | ||
|
|
7c1796a807 | ||
|
|
9791afbdd1 | ||
|
|
7c39d25650 | ||
|
|
75a7939a20 | ||
|
|
4c6c34794b | ||
|
|
ea3be30cf5 | ||
|
|
89d65fd4ea | ||
|
|
0ae07e41e1 | ||
|
|
a702d17dae | ||
|
|
b7ad0a121c | ||
|
|
c22e73b1a8 | ||
|
|
a214fea54b | ||
|
|
b5d6e46309 | ||
|
|
58d6bf64d0 | ||
|
|
409a45159b | ||
|
|
87d1320846 | ||
|
|
32d55a8b8e | ||
|
|
756b6daa74 | ||
|
|
5eb4f4a306 | ||
|
|
ecac330696 | ||
|
|
c21224419b | ||
|
|
587043b8de | ||
|
|
7ecabe0679 | ||
|
|
86effa48c9 | ||
|
|
6466f14ab6 | ||
|
|
c083b913c6 | ||
|
|
01e6996a8e | ||
|
|
cce4bf986b | ||
|
|
00b379773b | ||
|
|
de11eb1060 | ||
|
|
d37968c508 | ||
|
|
a0ba3764fb | ||
|
|
d45bce7310 | ||
|
|
7a56e9d162 | ||
|
|
b68e0f9f35 | ||
|
|
d302ebf503 | ||
|
|
ac65f1ae4e | ||
|
|
574e6c5885 | ||
|
|
001e77a9dc | ||
|
|
16fe34446d | ||
|
|
3482f7da22 | ||
|
|
4b16a4c44e | ||
|
|
ecaacb4b83 | ||
|
|
2b38f9e25f | ||
|
|
2c73d542d8 | ||
|
|
0bb85661d2 | ||
|
|
3bd96b82a8 | ||
|
|
980e9c1f2f | ||
|
|
987422520d | ||
|
|
ed9b6248e4 | ||
|
|
07b1c92f61 | ||
|
|
ff835a5483 | ||
|
|
b2eb3ad213 | ||
|
|
83b4e0e1b8 | ||
|
|
6375f8b134 | ||
|
|
1f4d5ba114 | ||
|
|
43af024596 | ||
|
|
f5b0a91d6a | ||
|
|
c352711162 | ||
|
|
f0509a9a19 | ||
|
|
b4ac329482 | ||
|
|
3629ac421a | ||
|
|
a2d8eb9aa1 | ||
|
|
2b973b639b | ||
|
|
f3cd6ea0ee | ||
|
|
86af0bb463 | ||
|
|
7f88a60024 | ||
|
|
fbaa5168d7 | ||
|
|
72075de4e0 | ||
|
|
e822fde276 | ||
|
|
36ff86f895 | ||
|
|
2a120bd2f6 | ||
|
|
64ef5024d0 | ||
|
|
43f309f5ed | ||
|
|
02a1a8a20b | ||
|
|
131b686bf6 | ||
|
|
b630c1a3d1 | ||
|
|
06d57aef2d | ||
|
|
b3ffa2191c | ||
|
|
0a90f9d777 | ||
|
|
7a4ea7dd4c | ||
|
|
e2f31a3d52 | ||
|
|
0389d102fb | ||
|
|
0ecbe662c7 | ||
|
|
84deb8cc6e | ||
|
|
aac3347c1c | ||
|
|
45ce85d198 | ||
|
|
72d5076fad | ||
|
|
1038e2670a | ||
|
|
3786a769fc | ||
|
|
f5a4a663e0 | ||
|
|
b334319ede | ||
|
|
22e6d12c84 | ||
|
|
de6de0bdde | ||
|
|
a7e672fc05 | ||
|
|
f33ade5ae6 | ||
|
|
af54978d9e | ||
|
|
819620d7aa | ||
|
|
10de8847fd | ||
|
|
440aa4ede3 | ||
|
|
a5b16897c1 | ||
|
|
ee7e523e61 | ||
|
|
891a4cb5a1 | ||
|
|
9a43f57791 | ||
|
|
da0c3fb72c | ||
|
|
25a4101e32 | ||
|
|
a57701d131 | ||
|
|
fbb170674a | ||
|
|
3511403475 | ||
|
|
81edc0a4d2 | ||
|
|
bf20cfc49f | ||
|
|
80793cb259 | ||
|
|
93e98706dd | ||
|
|
422d14823a | ||
|
|
1cc273fead | ||
|
|
207e9fa1b0 | ||
|
|
8271ec7b87 | ||
|
|
885ee925e5 | ||
|
|
a4b90a31e2 | ||
|
|
85cb669587 | ||
|
|
45939e84f7 | ||
|
|
fbbc1e2683 | ||
|
|
2996aad422 | ||
|
|
852017d19d | ||
|
|
f940819e64 | ||
|
|
ffeeba88a5 | ||
|
|
47158e31f8 | ||
|
|
af30557f7a | ||
|
|
6fb12b2e3a | ||
|
|
a0aa47e5a0 | ||
|
|
49023c3f33 | ||
|
|
5431f520d4 | ||
|
|
49c6f0ce39 | ||
|
|
8746bc8de7 | ||
|
|
ab1fd4e5d0 | ||
|
|
c46f7b9187 | ||
|
|
f93a733ace | ||
|
|
9ba72cea2b | ||
|
|
0e349cd4c8 | ||
|
|
58488d02de | ||
|
|
664c7ac2e7 | ||
|
|
5030271e74 | ||
|
|
36586e6107 | ||
|
|
f6c2712322 | ||
|
|
cb31d2f496 | ||
|
|
eb4a080901 | ||
|
|
9b5e57e591 | ||
|
|
f5c79dd7b3 | ||
|
|
e8a268df68 | ||
|
|
56b346b452 | ||
|
|
04383c3ae7 | ||
|
|
327fa42814 | ||
|
|
55fb881c42 | ||
|
|
17beef02f2 | ||
|
|
e8fdf51d1b | ||
|
|
d2ff4c16f2 | ||
|
|
2f78939f94 | ||
|
|
7f52cf8f04 | ||
|
|
c4d37a5a5b | ||
|
|
0e9be207dd | ||
|
|
3536cf549a | ||
|
|
2db41b939e | ||
|
|
4426b96684 | ||
|
|
0411403007 | ||
|
|
b693cdaac7 | ||
|
|
89ce95fe08 | ||
|
|
b2c4544ef2 | ||
|
|
ca34c8f202 | ||
|
|
56183bcae3 | ||
|
|
7f9549f2bd | ||
|
|
fa2bae032d | ||
|
|
3f94934954 | ||
|
|
310b01ef45 | ||
|
|
9476f65b87 | ||
|
|
ea0a6c61a3 | ||
|
|
b7cc808b7d | ||
|
|
185492156e | ||
|
|
29d71342c1 | ||
|
|
9089cd9127 | ||
|
|
dd31d3f94c | ||
|
|
a7f4ebdd77 | ||
|
|
8b5b4522ea | ||
|
|
d26cc84c32 | ||
|
|
24adb5f5cd | ||
|
|
b8e1335558 | ||
|
|
b5d1289a05 | ||
|
|
139a79fa9b | ||
|
|
6ad0ed843d | ||
|
|
c12f529dee | ||
|
|
6c628d66ed | ||
|
|
a987568e07 | ||
|
|
f5b0d1bd49 | ||
|
|
9ccd3dc338 | ||
|
|
4d269cb31a | ||
|
|
2991b783d9 | ||
|
|
85fbc51248 | ||
|
|
d4f66a1770 | ||
|
|
723a52e8e9 | ||
|
|
7381adb19b | ||
|
|
ed90e5dafe | ||
|
|
865ff8dca6 | ||
|
|
c2178fbe1a | ||
|
|
8021b27169 | ||
|
|
f28294c93b | ||
|
|
0ecaa59f4b | ||
|
|
167556d3eb | ||
|
|
97e5330cb1 | ||
|
|
83158aa8e2 | ||
|
|
f41cfe726a | ||
|
|
1b85320889 | ||
|
|
c04e85a4df | ||
|
|
1cbc5a52bd | ||
|
|
25c8729aa0 | ||
|
|
d55c91d1f9 | ||
|
|
fbafdc5cba | ||
|
|
2be78249e4 | ||
|
|
224ca9037c | ||
|
|
be91c62136 | ||
|
|
6ec43fbbb4 | ||
|
|
58ae418c0f | ||
|
|
b75e662f90 | ||
|
|
367e1484e8 | ||
|
|
1969218aec | ||
|
|
3865de4dca | ||
|
|
2ed40be4a1 | ||
|
|
f0272470e9 | ||
|
|
d00448a16e | ||
|
|
c9f9f679d2 | ||
|
|
8b0eca4231 | ||
|
|
aa80a81e38 | ||
|
|
ab83b8cbeb | ||
|
|
562f542902 | ||
|
|
3d4d3558b7 | ||
|
|
3765454957 | ||
|
|
3d7f6a5fbd | ||
|
|
f44c4e870b | ||
|
|
96c6504cfd | ||
|
|
1ffe798a68 | ||
|
|
0cea31a837 | ||
|
|
711d743a8e | ||
|
|
456cb2205f | ||
|
|
1fc1975c4f | ||
|
|
8dc7bade2f | ||
|
|
f6fbe3584a | ||
|
|
53a68a88ec | ||
|
|
9cf1eb5ba0 | ||
|
|
aa7e507d8c | ||
|
|
2450153249 | ||
|
|
8fd97238fb | ||
|
|
2b307748a6 | ||
|
|
bf8b2273df | ||
|
|
d4b43f8d24 | ||
|
|
217643fe19 | ||
|
|
0ce8404555 | ||
|
|
a23582e15c | ||
|
|
4502fc6c6e | ||
|
|
fae42ed91b | ||
|
|
0ee32f2558 | ||
|
|
560b5d05ef | ||
|
|
ff27c27bea | ||
|
|
1e5e22249c | ||
|
|
f38eb4b813 | ||
|
|
ac6091a4a7 | ||
|
|
8b4e160ce5 | ||
|
|
ddd09cb830 | ||
|
|
40a56d670c | ||
|
|
e73f0d350d | ||
|
|
5ec32e252e | ||
|
|
1e530ec655 | ||
|
|
096cd05d1c | ||
|
|
7e884d70cb | ||
|
|
82650340d4 | ||
|
|
c18b8d8533 | ||
|
|
254c2110a1 | ||
|
|
714b968f3e | ||
|
|
c67ae2a4de | ||
|
|
fc004e041c | ||
|
|
2ac6021179 | ||
|
|
08b96af2b4 | ||
|
|
58d9a7feeb | ||
|
|
279fd99207 | ||
|
|
79be2d5074 | ||
|
|
a9d66fe687 | ||
|
|
56df39676d | ||
|
|
04839b3bf4 | ||
|
|
9470da82b2 | ||
|
|
70c8bd9d23 | ||
|
|
9833cc8a64 | ||
|
|
6127af7883 | ||
|
|
00ede8bcf2 | ||
|
|
c2102de737 | ||
|
|
432627c921 | ||
|
|
164e9f010d | ||
|
|
f02f100c0d | ||
|
|
297ff6bf57 | ||
|
|
4db07ad794 | ||
|
|
a9b5f66292 | ||
|
|
18046f68f2 | ||
|
|
7c8e019085 | ||
|
|
b71d958fe7 | ||
|
|
6a8b3127f9 | ||
|
|
62348a2393 | ||
|
|
3aa5d843bc | ||
|
|
3b3290753c | ||
|
|
78ff5e897f | ||
|
|
ce2ca309a6 | ||
|
|
af08a81fcd | ||
|
|
676b6c20bf | ||
|
|
3d210e851c | ||
|
|
b3c01c4b80 | ||
|
|
67bb8836f9 | ||
|
|
5594608334 | ||
|
|
16ab9e40e5 | ||
|
|
09a17a6c80 | ||
|
|
fe05f5b898 | ||
|
|
fee7c1c74c | ||
|
|
5979bd6813 | ||
|
|
a24fb58660 | ||
|
|
341a897fbb | ||
|
|
def72d948d | ||
|
|
66608e5440 | ||
|
|
f595009430 | ||
|
|
caec14561d | ||
|
|
3c9dc84b72 | ||
|
|
b8239447d9 | ||
|
|
5eed24ebad | ||
|
|
2859f2c8f3 | ||
|
|
408cfc089b | ||
|
|
f787cdace2 | ||
|
|
b0971223a3 | ||
|
|
a28afc45d8 | ||
|
|
31517bf321 | ||
|
|
a98736733e | ||
|
|
981ca11e91 | ||
|
|
5c1ecf8891 | ||
|
|
7e6351e086 | ||
|
|
3282e81c19 | ||
|
|
638362de63 | ||
|
|
3ef09f5dbc | ||
|
|
80297800bf | ||
|
|
befe74e339 |
No files matched your search
@@ -121,6 +121,10 @@ def main():
|
||||
print("it more easily. Many times one person did a port with basic")
|
||||
print("functionality, and then someone else jumped in and")
|
||||
print("contributed major new features.")
|
||||
print("")
|
||||
print("NOTE: if you renamed a device in pmaports, rename it in the")
|
||||
print("wiki as well and make sure to add it here:")
|
||||
print("https://postmarketos.org/renamed")
|
||||
return 1
|
||||
else:
|
||||
print("*** Wiki check successful!")
|
||||
|
||||
@@ -26,7 +26,6 @@ sh_files="
|
||||
./main/postmarketos-update-kernel/update-kernel.sh
|
||||
./main/swclock-offset/swclock-offset-boot.sh
|
||||
./main/swclock-offset/swclock-offset-shutdown.sh
|
||||
./main/ttyescape/*.sh
|
||||
./main/ttyescape/*.post-install
|
||||
./main/unl0kr/unlock.sh
|
||||
./main/msm-firmware-loader/*.sh
|
||||
|
||||
@@ -17,12 +17,9 @@ def test_aports_firmware(args):
|
||||
excluded = [
|
||||
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
|
||||
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-oneplus-sdm845", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
|
||||
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
|
||||
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan
|
||||
"firmware-shift-sdm845", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-xiaomi-beryllium", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-xiaomi-ferrari", # Depends on soc-qcom-msm8916
|
||||
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
|
||||
]
|
||||
|
||||
@@ -15,7 +15,9 @@ def test_aports_ui(args):
|
||||
"""
|
||||
Raise an error if package in _pmb_recommends is not found
|
||||
"""
|
||||
for arch in pmb.config.build_device_architectures:
|
||||
pmaports_cfg = pmb.config.pmaports.read_config(args)
|
||||
|
||||
for arch in pmaports_cfg["supported_arches"].split(","):
|
||||
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(path)
|
||||
# Skip if arch isn't enabled
|
||||
|
||||
+3
-9
@@ -14,11 +14,11 @@ stages:
|
||||
# merge request ID is not available. This means, we must set the "only"
|
||||
# variable accordingly - and if we only do it for one job, all other jobs will
|
||||
# not get executed. So have the defaults here, and use them in all jobs that
|
||||
# should run on both the master branch, and in merge requests.
|
||||
# should run on both the v22.06 branch, and in merge requests.
|
||||
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
|
||||
.only-default: &only-default
|
||||
only:
|
||||
- master
|
||||
- v22.06
|
||||
- merge_requests
|
||||
- tags
|
||||
|
||||
@@ -108,7 +108,7 @@ kernel-kconfig:
|
||||
stage: lint
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
- v22.06
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
@@ -149,14 +149,8 @@ mr-settings:
|
||||
build-x86_64:
|
||||
extends: .build
|
||||
|
||||
build-x86:
|
||||
extends: .build
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
|
||||
build-armv7:
|
||||
extends: .build
|
||||
|
||||
build-armhf:
|
||||
extends: .build
|
||||
+5
-1
@@ -3,8 +3,12 @@
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
|
||||
device/*/*-purism-librem5/ @craftyguy @bshah
|
||||
main/osk-sdl/ @craftyguy
|
||||
main/mesa-pvr-dri-classic/ @xc-racer99
|
||||
main/postmarketos-ui-plasma-mobile/ @bshah
|
||||
temp/u-boot-librem5/ @craftyguy @bshah
|
||||
device/community/*-qcom-sdm845 @calebccff @joelselvaraj
|
||||
device/community/device-oneplus-enchilada @calebccff
|
||||
device/community/device-oneplus-fajita @calebccff
|
||||
main/ttyescape @calebccff
|
||||
device/community/*-xiaomi-berrylium @joelselvaraj
|
||||
|
||||
# vim: ts=4 sw=4 et
|
||||
@@ -1,33 +0,0 @@
|
||||
# Reference: https://postmarketos.org/channels.cfg
|
||||
[channels.cfg]
|
||||
recommended=edge
|
||||
|
||||
[edge]
|
||||
description=Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
|
||||
branch_pmaports=master
|
||||
branch_aports=master
|
||||
mirrordir_alpine=edge
|
||||
|
||||
[v21.12]
|
||||
description=Latest release / Recommended for best stability
|
||||
branch_pmaports=v21.12
|
||||
branch_aports=3.15-stable
|
||||
mirrordir_alpine=v3.15
|
||||
|
||||
[v21.06]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v21.06
|
||||
branch_aports=3.14-stable
|
||||
mirrordir_alpine=v3.14
|
||||
|
||||
[v21.03]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v21.03
|
||||
branch_aports=3.13-stable
|
||||
mirrordir_alpine=v3.13
|
||||
|
||||
[v20.05]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v20.05
|
||||
branch_aports=3.12-stable
|
||||
mirrordir_alpine=v3.12
|
||||
@@ -3,8 +3,8 @@
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-aarch64
|
||||
pkgver=2.37
|
||||
pkgrel=4
|
||||
pkgver=2.38
|
||||
pkgrel=2
|
||||
pkgdesc="Tools necessary to build programs for aarch64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
@@ -16,8 +16,9 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
binutils-mips-disable-assert.patch
|
||||
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
defang-no-split.patch
|
||||
binutils-ppc-fix-machine-options.patch
|
||||
binutils-s390x-1.patch
|
||||
binutils-s390x-2.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
@@ -42,14 +43,6 @@ fi
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# Remove existing empty man pages to force them to be regenerated.
|
||||
# Workaround for https://gitlab.alpinelinux.org/alpine/aports/-/issues/13034
|
||||
find "$builddir" -name '[a-z]*\.[0-9]*' -empty -delete
|
||||
}
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec aarch64)"
|
||||
"$builddir"/configure \
|
||||
@@ -81,12 +74,13 @@ package() {
|
||||
|
||||
|
||||
sha512sums="
|
||||
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
|
||||
8bf0b0d193c9c010e0518ee2b2e5a830898af206510992483b427477ed178396cd210235e85fd7bd99a96fc6d5eedbeccbd48317a10f752b7336ada8b2bb826d binutils-2.38.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
|
||||
27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch
|
||||
a9efe2689624865f0ff33d4776a5bd295bcad6484bdd38d0ca490fea43691c4933ab33d17478851998eef12922dbf83d6c3225bb1f8faf92a1367d086390f7d3 binutils-s390x-1.patch
|
||||
0e291df80ad279005265634014d0935d2c115a5ed708d25407094b7ad4ddf267d1fb7fcbcb2d9ad73bd305b4e3974628b820bd1f249f56c095e4896872434cc9 binutils-s390x-2.patch
|
||||
"
|
||||
@@ -1,234 +0,0 @@
|
||||
Upstream: yes
|
||||
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
|
||||
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 26 Jul 2021 05:59:55 -0700
|
||||
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
|
||||
|
||||
Close the file descriptor if there is no archive plugin file descriptor
|
||||
to avoid running out of file descriptors on thin archives with many
|
||||
archive members.
|
||||
|
||||
bfd/
|
||||
|
||||
PR ld/28138
|
||||
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
|
||||
descriptor there is no archive plugin file descriptor.
|
||||
|
||||
ld/
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
|
||||
native build.
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
|
||||
* testsuite/ld-plugin/pr28138.c: New file.
|
||||
* testsuite/ld-plugin/pr28138-1.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-2.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-3.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-4.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-5.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-6.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-7.c: Likewise.
|
||||
|
||||
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
|
||||
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
|
||||
---
|
||||
bfd/plugin.c | 8 +++++++
|
||||
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
|
||||
10 files changed, 104 insertions(+)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
|
||||
|
||||
diff --git a/bfd/plugin.c b/bfd/plugin.c
|
||||
index 6cfa2b66470..3bab8febe88 100644
|
||||
--- a/bfd/plugin.c
|
||||
+++ b/bfd/plugin.c
|
||||
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
|
||||
&& !bfd_is_thin_archive (abfd->my_archive))
|
||||
abfd = abfd->my_archive;
|
||||
|
||||
+ /* Close the file descriptor if there is no archive plugin file
|
||||
+ descriptor. */
|
||||
+ if (abfd->archive_plugin_fd == -1)
|
||||
+ {
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
abfd->archive_plugin_fd_open_count--;
|
||||
/* Dup the archive plugin file descriptor for later use, which
|
||||
will be closed by _bfd_archive_close_and_cleanup. */
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index def69e43ab3..999d911ce6a 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
|
||||
}
|
||||
}
|
||||
|
||||
+run_cc_link_tests [list \
|
||||
+ [list \
|
||||
+ "Build pr28138.a" \
|
||||
+ "-T" "" \
|
||||
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
|
||||
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "Build pr28138.o" \
|
||||
+ "" "" \
|
||||
+ {pr28138.c} {} \
|
||||
+ ] \
|
||||
+]
|
||||
+
|
||||
+set exec_output [run_host_cmd "sh" \
|
||||
+ "-c \"ulimit -n 20; \
|
||||
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
|
||||
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
|
||||
+set exec_output [prune_warnings $exec_output]
|
||||
+if [string match "" $exec_output] then {
|
||||
+ if { [isnative] } {
|
||||
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
|
||||
+ if [string match "PASS" $exec_output] then {
|
||||
+ pass "PR ld/28138"
|
||||
+ } else {
|
||||
+ fail "PR ld/28138"
|
||||
+ }
|
||||
+ } else {
|
||||
+ pass "PR ld/28138"
|
||||
+ }
|
||||
+} else {
|
||||
+ fail "PR ld/28138"
|
||||
+}
|
||||
+
|
||||
set testname "Build liblto-11.a"
|
||||
remote_file host delete "tmpdir/liblto-11.a"
|
||||
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
new file mode 100644
|
||||
index 00000000000..51d119e1642
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a0(void);
|
||||
+int
|
||||
+a1(void)
|
||||
+{
|
||||
+ return 1 + a0();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
new file mode 100644
|
||||
index 00000000000..1120cd797e9
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a1(void);
|
||||
+int
|
||||
+a2(void)
|
||||
+{
|
||||
+ return 1 + a1();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
new file mode 100644
|
||||
index 00000000000..ec464947ee6
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a2(void);
|
||||
+int
|
||||
+a3(void)
|
||||
+{
|
||||
+ return 1 + a2();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
new file mode 100644
|
||||
index 00000000000..475701b2c5c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a3(void);
|
||||
+int
|
||||
+a4(void)
|
||||
+{
|
||||
+ return 1 + a3();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
new file mode 100644
|
||||
index 00000000000..e24f86c363e
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a4(void);
|
||||
+int
|
||||
+a5(void)
|
||||
+{
|
||||
+ return 1 + a4();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
new file mode 100644
|
||||
index 00000000000..b5b938bdb21
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a5(void);
|
||||
+int
|
||||
+a6(void)
|
||||
+{
|
||||
+ return 1 + a5();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
new file mode 100644
|
||||
index 00000000000..4ef75bf0f0c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a6(void);
|
||||
+int
|
||||
+a7(void)
|
||||
+{
|
||||
+ return 1 + a6();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
|
||||
new file mode 100644
|
||||
index 00000000000..68252c9f382
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+extern int a7(void);
|
||||
+
|
||||
+int
|
||||
+a0(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ if (a7() == 7)
|
||||
+ {
|
||||
+ printf ("PASS\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
Fix for DARN opcode error during ppc64le compilation of rng-tools which
|
||||
occurs with binutils 2.38 but not with binutils 2.37..
|
||||
|
||||
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=cebc89b9328;hp=9cbed90ee623d75e31994e7943960c997ba565f2
|
||||
|
||||
|
||||
diff -aur a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
|
||||
--- a/gas/config/tc-ppc.c
|
||||
+++ b/gas/config/tc-ppc.c
|
||||
@@ -5965,7 +5965,30 @@
|
||||
options do not count as a new machine, instead they add
|
||||
to currently selected opcodes. */
|
||||
ppc_cpu_t machine_sticky = 0;
|
||||
- new_cpu = ppc_parse_cpu (ppc_cpu, &machine_sticky, cpu_string);
|
||||
+ /* Unfortunately, some versions of gcc emit a .machine
|
||||
+ directive very near the start of the compiler's assembly
|
||||
+ output file. This is bad because it overrides user -Wa
|
||||
+ cpu selection. Worse, there are versions of gcc that
|
||||
+ emit the *wrong* cpu, not even respecting the -mcpu given
|
||||
+ to gcc. See gcc pr101393. And to compound the problem,
|
||||
+ as of 20220222 gcc doesn't pass the correct cpu option to
|
||||
+ gas on the command line. See gcc pr59828. Hack around
|
||||
+ this by keeping sticky options for an early .machine. */
|
||||
+ asection *sec;
|
||||
+ for (sec = stdoutput->sections; sec != NULL; sec = sec->next)
|
||||
+ {
|
||||
+ segment_info_type *info = seg_info (sec);
|
||||
+ /* Are the frags for this section perturbed from their
|
||||
+ initial state? Even .align will count here. */
|
||||
+ if (info != NULL
|
||||
+ && (info->frchainP->frch_root != info->frchainP->frch_last
|
||||
+ || info->frchainP->frch_root->fr_type != rs_fill
|
||||
+ || info->frchainP->frch_root->fr_fix != 0))
|
||||
+ break;
|
||||
+ }
|
||||
+ new_cpu = ppc_parse_cpu (ppc_cpu,
|
||||
+ sec == NULL ? &sticky : &machine_sticky,
|
||||
+ cpu_string);
|
||||
if (new_cpu != 0)
|
||||
ppc_cpu = new_cpu;
|
||||
else
|
||||
@@ -0,0 +1,147 @@
|
||||
From 82a5bb730a16f8c7962568030268e784b4fb42c8 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Liebler <stli@linux.ibm.com>
|
||||
Date: Thu, 28 Apr 2022 14:29:58 +0200
|
||||
Subject: [PATCH] s390: Avoid dynamic TLS relocs in PIE
|
||||
|
||||
No dynamic relocs are needed for TLS defined in an executable, the
|
||||
TP relative offset is known at link time.
|
||||
|
||||
Fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
* elf64-s390.c (elf_s390_tls_transition): Use bfd_link_dll
|
||||
instead of bfd_link_pic for TLS.
|
||||
(elf_s390_check_relocs): Likewise.
|
||||
(allocate_dynrelocs): Likewise.
|
||||
(elf_s390_relocate_section): Likewise.
|
||||
|
||||
(cherry picked from commit 26b1426577b5dcb32d149c64cca3e603b81948a9)
|
||||
---
|
||||
bfd/elf64-s390.c | 26 +++++++++++++-------------
|
||||
1 file changed, 13 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
|
||||
index e780efa7181..00ee386baab 100644
|
||||
--- a/bfd/elf64-s390.c
|
||||
+++ b/bfd/elf64-s390.c
|
||||
@@ -774,7 +774,7 @@ elf_s390_tls_transition (struct bfd_link_info *info,
|
||||
int r_type,
|
||||
int is_local)
|
||||
{
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
return r_type;
|
||||
|
||||
switch (r_type)
|
||||
@@ -1026,7 +1026,7 @@ elf_s390_check_relocs (bfd *abfd,
|
||||
case R_390_TLS_GOTIE20:
|
||||
case R_390_TLS_GOTIE64:
|
||||
case R_390_TLS_IEENT:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
/* Fall through */
|
||||
|
||||
@@ -1107,7 +1107,7 @@ elf_s390_check_relocs (bfd *abfd,
|
||||
if (r_type == R_390_TLS_LE64 && bfd_link_pie (info))
|
||||
break;
|
||||
|
||||
- if (!bfd_link_pic (info))
|
||||
+ if (!bfd_link_dll (info))
|
||||
break;
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
/* Fall through */
|
||||
@@ -1571,7 +1571,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h,
|
||||
to R_390_TLS_LE64 requiring no TLS entry. For GOTIE12 and IEENT
|
||||
we can save the dynamic TLS relocation. */
|
||||
if (h->got.refcount > 0
|
||||
- && !bfd_link_pic (info)
|
||||
+ && !bfd_link_dll (info)
|
||||
&& h->dynindx == -1
|
||||
&& elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE)
|
||||
{
|
||||
@@ -2662,7 +2662,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
|
||||
/* Relocations for tls literal pool entries. */
|
||||
case R_390_TLS_IE64:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
asection *sreloc;
|
||||
@@ -2690,7 +2690,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
else if (h != NULL)
|
||||
{
|
||||
tls_type = elf_s390_hash_entry(h)->tls_type;
|
||||
- if (!bfd_link_pic (info) && h->dynindx == -1 && tls_type >= GOT_TLS_IE)
|
||||
+ if (!bfd_link_dll (info) && h->dynindx == -1 && tls_type >= GOT_TLS_IE)
|
||||
r_type = R_390_TLS_LE64;
|
||||
}
|
||||
if (r_type == R_390_TLS_GD64 && tls_type >= GOT_TLS_IE)
|
||||
@@ -2801,14 +2801,14 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
if (local_got_offsets == NULL)
|
||||
abort();
|
||||
off = local_got_offsets[r_symndx];
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
goto emit_tls_relocs;
|
||||
}
|
||||
else
|
||||
{
|
||||
off = h->got.offset;
|
||||
tls_type = elf_s390_hash_entry(h)->tls_type;
|
||||
- if (bfd_link_pic (info) || h->dynindx != -1 || tls_type < GOT_TLS_IE)
|
||||
+ if (bfd_link_dll (info) || h->dynindx != -1 || tls_type < GOT_TLS_IE)
|
||||
goto emit_tls_relocs;
|
||||
}
|
||||
|
||||
@@ -2825,7 +2825,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
break;
|
||||
|
||||
case R_390_TLS_LDM64:
|
||||
- if (! bfd_link_pic (info))
|
||||
+ if (! bfd_link_dll (info))
|
||||
/* The literal pool entry this relocation refers to gets ignored
|
||||
by the optimized code of the local exec model. Do nothing
|
||||
and the value will turn out zero. */
|
||||
@@ -2900,7 +2900,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
continue;
|
||||
|
||||
case R_390_TLS_LDO64:
|
||||
- if (bfd_link_pic (info) || (input_section->flags & SEC_DEBUGGING))
|
||||
+ if (bfd_link_dll (info) || (input_section->flags & SEC_DEBUGGING))
|
||||
relocation -= dtpoff_base (info);
|
||||
else
|
||||
/* When converting LDO to LE, we must negate. */
|
||||
@@ -2922,7 +2922,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
|
||||
if (r_type == R_390_TLS_LOAD)
|
||||
{
|
||||
- if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
|
||||
+ if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
|
||||
{
|
||||
/* IE->LE transition. Four valid cases:
|
||||
lg %rx,(0,%ry) -> sllg %rx,%ry,0
|
||||
@@ -2972,7 +2972,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
invalid_tls_insn (input_bfd, input_section, rel);
|
||||
return false;
|
||||
}
|
||||
- if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
|
||||
+ if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
|
||||
{
|
||||
/* GD->LE transition.
|
||||
brasl %r14,__tls_get_addr@plt -> brcl 0,. */
|
||||
@@ -2991,7 +2991,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
else if (r_type == R_390_TLS_LDCALL)
|
||||
{
|
||||
- if (!bfd_link_pic (info))
|
||||
+ if (!bfd_link_dll (info))
|
||||
{
|
||||
unsigned int insn0, insn1;
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From 9a01457e02e7bb594ff9a9ac62a38c909e2e3083 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Liebler <stli@linux.ibm.com>
|
||||
Date: Thu, 28 Apr 2022 14:30:55 +0200
|
||||
Subject: [PATCH] s390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie
|
||||
|
||||
In static-pie case, there are IRELATIVE-relocs in
|
||||
.rela.iplt (htab->irelplt), which will later be grouped
|
||||
to .rela.plt. On s390, the IRELATIVE relocations are
|
||||
always located in .rela.iplt - even for non-static case.
|
||||
Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
|
||||
to the dynamic section even if htab->srelplt->size == 0.
|
||||
See _bfd_elf_add_dynamic_tags in bfd/elflink.c.
|
||||
|
||||
bfd/
|
||||
elf64-s390.c (elf_s390_size_dynamic_sections):
|
||||
Enforce DT_JMPREL via htab->elf.dt_jmprel_required.
|
||||
|
||||
(cherry picked from commit d942d8db12adf4c9e5c7d9ed6496a779ece7149e)
|
||||
---
|
||||
bfd/elf64-s390.c | 15 ++++++++++++++-
|
||||
1 file changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
|
||||
index 00ee386baab..0b851f7ac0e 100644
|
||||
--- a/bfd/elf64-s390.c
|
||||
+++ b/bfd/elf64-s390.c
|
||||
@@ -1876,7 +1876,20 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
else if (startswith (bfd_section_name (s), ".rela"))
|
||||
{
|
||||
if (s->size != 0 && s != htab->elf.srelplt)
|
||||
- relocs = true;
|
||||
+ {
|
||||
+ relocs = true;
|
||||
+ if (s == htab->elf.irelplt)
|
||||
+ {
|
||||
+ /* In static-pie case, there are IRELATIVE-relocs in
|
||||
+ .rela.iplt (htab->irelplt), which will later be grouped
|
||||
+ to .rela.plt. On s390, the IRELATIVE relocations are
|
||||
+ always located in .rela.iplt - even for non-static case.
|
||||
+ Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
|
||||
+ to the dynamic section even if htab->srelplt->size == 0.
|
||||
+ See _bfd_elf_add_dynamic_tags in bfd/elflink.c. */
|
||||
+ htab->elf.dt_jmprel_required = true;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* We use the reloc_count field as a counter if we need
|
||||
to copy relocs into the output file. */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Trofimovich <siarheit@google.com>
|
||||
Date: Mon, 26 Jul 2021 22:51:18 +0100
|
||||
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
|
||||
[PR28144]
|
||||
|
||||
Change 2faf902da ("generate single html manual page by default")
|
||||
added use of --no-split option to makeinfo. binutils reuses
|
||||
makeinfo options for texi2pod.pl wrapper. Unsupported option
|
||||
led to silent manpage truncation.
|
||||
|
||||
The change adds no-op option support.
|
||||
|
||||
etc/
|
||||
PR 28144
|
||||
* texi2pod.pl: Handle no-op --no-split option.
|
||||
|
||||
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
|
||||
---
|
||||
etc/texi2pod.pl | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
|
||||
index 11f70d156be..dcf2b437640 100644
|
||||
--- a/etc/texi2pod.pl
|
||||
+++ b/etc/texi2pod.pl
|
||||
@@ -59,6 +59,8 @@ while ($_ = shift) {
|
||||
$flag = shift;
|
||||
}
|
||||
push (@ipath, $flag);
|
||||
+ } elsif (/^--no-split$/) {
|
||||
+ # ignore option for makeinfo compatibility
|
||||
} elsif (/^-/) {
|
||||
usage();
|
||||
} else {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Tue, 21 Sep 2021 14:53:13 +0000
|
||||
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
|
||||
libraries"
|
||||
|
||||
This revert is needed to avoid wrongly tagging objects with the incompatible
|
||||
IBM long double ABI, which is not supported by musl and will result in
|
||||
linking errors if used.
|
||||
|
||||
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
|
||||
---
|
||||
bfd/elf32-tic6x.c | 3 ---
|
||||
ld/ldlang.c | 10 ++++------
|
||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
|
||||
index 5754f3cb860..3ad1d612749 100644
|
||||
--- a/bfd/elf32-tic6x.c
|
||||
+++ b/bfd/elf32-tic6x.c
|
||||
@@ -3735,9 +3735,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/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..f13beaef9d9 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -7071,13 +7071,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 (!file->flags.just_syms
|
||||
- && ((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.33.0
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armhf
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-armhf
|
||||
pkgver=2.37
|
||||
pkgrel=4
|
||||
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
|
||||
binutils-mips-disable-assert.patch
|
||||
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
defang-no-split.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
subpackages=""
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# Remove existing empty man pages to force them to be regenerated.
|
||||
# Workaround for https://gitlab.alpinelinux.org/alpine/aports/-/issues/13034
|
||||
find "$builddir" -name '[a-z]*\.[0-9]*' -empty -delete
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
# remove files that conflict with non-cross binutils
|
||||
rm -rf "$pkgdir"/usr/lib/bfd-plugins
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="
|
||||
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
|
||||
"
|
||||
@@ -1,234 +0,0 @@
|
||||
Upstream: yes
|
||||
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
|
||||
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 26 Jul 2021 05:59:55 -0700
|
||||
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
|
||||
|
||||
Close the file descriptor if there is no archive plugin file descriptor
|
||||
to avoid running out of file descriptors on thin archives with many
|
||||
archive members.
|
||||
|
||||
bfd/
|
||||
|
||||
PR ld/28138
|
||||
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
|
||||
descriptor there is no archive plugin file descriptor.
|
||||
|
||||
ld/
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
|
||||
native build.
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
|
||||
* testsuite/ld-plugin/pr28138.c: New file.
|
||||
* testsuite/ld-plugin/pr28138-1.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-2.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-3.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-4.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-5.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-6.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-7.c: Likewise.
|
||||
|
||||
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
|
||||
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
|
||||
---
|
||||
bfd/plugin.c | 8 +++++++
|
||||
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
|
||||
10 files changed, 104 insertions(+)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
|
||||
|
||||
diff --git a/bfd/plugin.c b/bfd/plugin.c
|
||||
index 6cfa2b66470..3bab8febe88 100644
|
||||
--- a/bfd/plugin.c
|
||||
+++ b/bfd/plugin.c
|
||||
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
|
||||
&& !bfd_is_thin_archive (abfd->my_archive))
|
||||
abfd = abfd->my_archive;
|
||||
|
||||
+ /* Close the file descriptor if there is no archive plugin file
|
||||
+ descriptor. */
|
||||
+ if (abfd->archive_plugin_fd == -1)
|
||||
+ {
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
abfd->archive_plugin_fd_open_count--;
|
||||
/* Dup the archive plugin file descriptor for later use, which
|
||||
will be closed by _bfd_archive_close_and_cleanup. */
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index def69e43ab3..999d911ce6a 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
|
||||
}
|
||||
}
|
||||
|
||||
+run_cc_link_tests [list \
|
||||
+ [list \
|
||||
+ "Build pr28138.a" \
|
||||
+ "-T" "" \
|
||||
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
|
||||
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "Build pr28138.o" \
|
||||
+ "" "" \
|
||||
+ {pr28138.c} {} \
|
||||
+ ] \
|
||||
+]
|
||||
+
|
||||
+set exec_output [run_host_cmd "sh" \
|
||||
+ "-c \"ulimit -n 20; \
|
||||
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
|
||||
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
|
||||
+set exec_output [prune_warnings $exec_output]
|
||||
+if [string match "" $exec_output] then {
|
||||
+ if { [isnative] } {
|
||||
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
|
||||
+ if [string match "PASS" $exec_output] then {
|
||||
+ pass "PR ld/28138"
|
||||
+ } else {
|
||||
+ fail "PR ld/28138"
|
||||
+ }
|
||||
+ } else {
|
||||
+ pass "PR ld/28138"
|
||||
+ }
|
||||
+} else {
|
||||
+ fail "PR ld/28138"
|
||||
+}
|
||||
+
|
||||
set testname "Build liblto-11.a"
|
||||
remote_file host delete "tmpdir/liblto-11.a"
|
||||
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
new file mode 100644
|
||||
index 00000000000..51d119e1642
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a0(void);
|
||||
+int
|
||||
+a1(void)
|
||||
+{
|
||||
+ return 1 + a0();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
new file mode 100644
|
||||
index 00000000000..1120cd797e9
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a1(void);
|
||||
+int
|
||||
+a2(void)
|
||||
+{
|
||||
+ return 1 + a1();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
new file mode 100644
|
||||
index 00000000000..ec464947ee6
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a2(void);
|
||||
+int
|
||||
+a3(void)
|
||||
+{
|
||||
+ return 1 + a2();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
new file mode 100644
|
||||
index 00000000000..475701b2c5c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a3(void);
|
||||
+int
|
||||
+a4(void)
|
||||
+{
|
||||
+ return 1 + a3();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
new file mode 100644
|
||||
index 00000000000..e24f86c363e
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a4(void);
|
||||
+int
|
||||
+a5(void)
|
||||
+{
|
||||
+ return 1 + a4();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
new file mode 100644
|
||||
index 00000000000..b5b938bdb21
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a5(void);
|
||||
+int
|
||||
+a6(void)
|
||||
+{
|
||||
+ return 1 + a5();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
new file mode 100644
|
||||
index 00000000000..4ef75bf0f0c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a6(void);
|
||||
+int
|
||||
+a7(void)
|
||||
+{
|
||||
+ return 1 + a6();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
|
||||
new file mode 100644
|
||||
index 00000000000..68252c9f382
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+extern int a7(void);
|
||||
+
|
||||
+int
|
||||
+a0(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ if (a7() == 7)
|
||||
+ {
|
||||
+ printf ("PASS\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -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,14 +0,0 @@
|
||||
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
|
||||
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
|
||||
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
|
||||
@@ -6744,8 +6744,10 @@
|
||||
in the relocation. */
|
||||
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
|
||||
{
|
||||
+#if 0
|
||||
BFD_ASSERT (htab->root.target_os == is_vxworks
|
||||
|| h->global_got_area != GGA_NONE);
|
||||
+#endif
|
||||
indx = h->root.dynindx;
|
||||
if (SGI_COMPAT (output_bfd))
|
||||
defined_p = h->root.def_regular;
|
||||
@@ -1,38 +0,0 @@
|
||||
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Trofimovich <siarheit@google.com>
|
||||
Date: Mon, 26 Jul 2021 22:51:18 +0100
|
||||
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
|
||||
[PR28144]
|
||||
|
||||
Change 2faf902da ("generate single html manual page by default")
|
||||
added use of --no-split option to makeinfo. binutils reuses
|
||||
makeinfo options for texi2pod.pl wrapper. Unsupported option
|
||||
led to silent manpage truncation.
|
||||
|
||||
The change adds no-op option support.
|
||||
|
||||
etc/
|
||||
PR 28144
|
||||
* texi2pod.pl: Handle no-op --no-split option.
|
||||
|
||||
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
|
||||
---
|
||||
etc/texi2pod.pl | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
|
||||
index 11f70d156be..dcf2b437640 100644
|
||||
--- a/etc/texi2pod.pl
|
||||
+++ b/etc/texi2pod.pl
|
||||
@@ -59,6 +59,8 @@ while ($_ = shift) {
|
||||
$flag = shift;
|
||||
}
|
||||
push (@ipath, $flag);
|
||||
+ } elsif (/^--no-split$/) {
|
||||
+ # ignore option for makeinfo compatibility
|
||||
} elsif (/^-/) {
|
||||
usage();
|
||||
} else {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -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,8 +3,8 @@
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname=binutils-armv7
|
||||
pkgver=2.37
|
||||
pkgrel=4
|
||||
pkgver=2.38
|
||||
pkgrel=2
|
||||
pkgdesc="Tools necessary to build programs for armv7 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
@@ -16,8 +16,9 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
binutils-mips-disable-assert.patch
|
||||
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
defang-no-split.patch
|
||||
binutils-ppc-fix-machine-options.patch
|
||||
binutils-s390x-1.patch
|
||||
binutils-s390x-2.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
@@ -42,14 +43,6 @@ fi
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# Remove existing empty man pages to force them to be regenerated.
|
||||
# Workaround for https://gitlab.alpinelinux.org/alpine/aports/-/issues/13034
|
||||
find "$builddir" -name '[a-z]*\.[0-9]*' -empty -delete
|
||||
}
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec armv7)"
|
||||
"$builddir"/configure \
|
||||
@@ -81,12 +74,13 @@ package() {
|
||||
|
||||
|
||||
sha512sums="
|
||||
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
|
||||
8bf0b0d193c9c010e0518ee2b2e5a830898af206510992483b427477ed178396cd210235e85fd7bd99a96fc6d5eedbeccbd48317a10f752b7336ada8b2bb826d binutils-2.38.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
|
||||
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
|
||||
27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch
|
||||
a9efe2689624865f0ff33d4776a5bd295bcad6484bdd38d0ca490fea43691c4933ab33d17478851998eef12922dbf83d6c3225bb1f8faf92a1367d086390f7d3 binutils-s390x-1.patch
|
||||
0e291df80ad279005265634014d0935d2c115a5ed708d25407094b7ad4ddf267d1fb7fcbcb2d9ad73bd305b4e3974628b820bd1f249f56c095e4896872434cc9 binutils-s390x-2.patch
|
||||
"
|
||||
@@ -1,234 +0,0 @@
|
||||
Upstream: yes
|
||||
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
|
||||
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 26 Jul 2021 05:59:55 -0700
|
||||
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
|
||||
|
||||
Close the file descriptor if there is no archive plugin file descriptor
|
||||
to avoid running out of file descriptors on thin archives with many
|
||||
archive members.
|
||||
|
||||
bfd/
|
||||
|
||||
PR ld/28138
|
||||
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
|
||||
descriptor there is no archive plugin file descriptor.
|
||||
|
||||
ld/
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
|
||||
native build.
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
|
||||
* testsuite/ld-plugin/pr28138.c: New file.
|
||||
* testsuite/ld-plugin/pr28138-1.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-2.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-3.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-4.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-5.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-6.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-7.c: Likewise.
|
||||
|
||||
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
|
||||
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
|
||||
---
|
||||
bfd/plugin.c | 8 +++++++
|
||||
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
|
||||
10 files changed, 104 insertions(+)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
|
||||
|
||||
diff --git a/bfd/plugin.c b/bfd/plugin.c
|
||||
index 6cfa2b66470..3bab8febe88 100644
|
||||
--- a/bfd/plugin.c
|
||||
+++ b/bfd/plugin.c
|
||||
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
|
||||
&& !bfd_is_thin_archive (abfd->my_archive))
|
||||
abfd = abfd->my_archive;
|
||||
|
||||
+ /* Close the file descriptor if there is no archive plugin file
|
||||
+ descriptor. */
|
||||
+ if (abfd->archive_plugin_fd == -1)
|
||||
+ {
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
abfd->archive_plugin_fd_open_count--;
|
||||
/* Dup the archive plugin file descriptor for later use, which
|
||||
will be closed by _bfd_archive_close_and_cleanup. */
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index def69e43ab3..999d911ce6a 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
|
||||
}
|
||||
}
|
||||
|
||||
+run_cc_link_tests [list \
|
||||
+ [list \
|
||||
+ "Build pr28138.a" \
|
||||
+ "-T" "" \
|
||||
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
|
||||
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "Build pr28138.o" \
|
||||
+ "" "" \
|
||||
+ {pr28138.c} {} \
|
||||
+ ] \
|
||||
+]
|
||||
+
|
||||
+set exec_output [run_host_cmd "sh" \
|
||||
+ "-c \"ulimit -n 20; \
|
||||
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
|
||||
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
|
||||
+set exec_output [prune_warnings $exec_output]
|
||||
+if [string match "" $exec_output] then {
|
||||
+ if { [isnative] } {
|
||||
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
|
||||
+ if [string match "PASS" $exec_output] then {
|
||||
+ pass "PR ld/28138"
|
||||
+ } else {
|
||||
+ fail "PR ld/28138"
|
||||
+ }
|
||||
+ } else {
|
||||
+ pass "PR ld/28138"
|
||||
+ }
|
||||
+} else {
|
||||
+ fail "PR ld/28138"
|
||||
+}
|
||||
+
|
||||
set testname "Build liblto-11.a"
|
||||
remote_file host delete "tmpdir/liblto-11.a"
|
||||
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
new file mode 100644
|
||||
index 00000000000..51d119e1642
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a0(void);
|
||||
+int
|
||||
+a1(void)
|
||||
+{
|
||||
+ return 1 + a0();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
new file mode 100644
|
||||
index 00000000000..1120cd797e9
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a1(void);
|
||||
+int
|
||||
+a2(void)
|
||||
+{
|
||||
+ return 1 + a1();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
new file mode 100644
|
||||
index 00000000000..ec464947ee6
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a2(void);
|
||||
+int
|
||||
+a3(void)
|
||||
+{
|
||||
+ return 1 + a2();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
new file mode 100644
|
||||
index 00000000000..475701b2c5c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a3(void);
|
||||
+int
|
||||
+a4(void)
|
||||
+{
|
||||
+ return 1 + a3();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
new file mode 100644
|
||||
index 00000000000..e24f86c363e
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a4(void);
|
||||
+int
|
||||
+a5(void)
|
||||
+{
|
||||
+ return 1 + a4();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
new file mode 100644
|
||||
index 00000000000..b5b938bdb21
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a5(void);
|
||||
+int
|
||||
+a6(void)
|
||||
+{
|
||||
+ return 1 + a5();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
new file mode 100644
|
||||
index 00000000000..4ef75bf0f0c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a6(void);
|
||||
+int
|
||||
+a7(void)
|
||||
+{
|
||||
+ return 1 + a6();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
|
||||
new file mode 100644
|
||||
index 00000000000..68252c9f382
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+extern int a7(void);
|
||||
+
|
||||
+int
|
||||
+a0(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ if (a7() == 7)
|
||||
+ {
|
||||
+ printf ("PASS\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
Fix for DARN opcode error during ppc64le compilation of rng-tools which
|
||||
occurs with binutils 2.38 but not with binutils 2.37..
|
||||
|
||||
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=cebc89b9328;hp=9cbed90ee623d75e31994e7943960c997ba565f2
|
||||
|
||||
|
||||
diff -aur a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
|
||||
--- a/gas/config/tc-ppc.c
|
||||
+++ b/gas/config/tc-ppc.c
|
||||
@@ -5965,7 +5965,30 @@
|
||||
options do not count as a new machine, instead they add
|
||||
to currently selected opcodes. */
|
||||
ppc_cpu_t machine_sticky = 0;
|
||||
- new_cpu = ppc_parse_cpu (ppc_cpu, &machine_sticky, cpu_string);
|
||||
+ /* Unfortunately, some versions of gcc emit a .machine
|
||||
+ directive very near the start of the compiler's assembly
|
||||
+ output file. This is bad because it overrides user -Wa
|
||||
+ cpu selection. Worse, there are versions of gcc that
|
||||
+ emit the *wrong* cpu, not even respecting the -mcpu given
|
||||
+ to gcc. See gcc pr101393. And to compound the problem,
|
||||
+ as of 20220222 gcc doesn't pass the correct cpu option to
|
||||
+ gas on the command line. See gcc pr59828. Hack around
|
||||
+ this by keeping sticky options for an early .machine. */
|
||||
+ asection *sec;
|
||||
+ for (sec = stdoutput->sections; sec != NULL; sec = sec->next)
|
||||
+ {
|
||||
+ segment_info_type *info = seg_info (sec);
|
||||
+ /* Are the frags for this section perturbed from their
|
||||
+ initial state? Even .align will count here. */
|
||||
+ if (info != NULL
|
||||
+ && (info->frchainP->frch_root != info->frchainP->frch_last
|
||||
+ || info->frchainP->frch_root->fr_type != rs_fill
|
||||
+ || info->frchainP->frch_root->fr_fix != 0))
|
||||
+ break;
|
||||
+ }
|
||||
+ new_cpu = ppc_parse_cpu (ppc_cpu,
|
||||
+ sec == NULL ? &sticky : &machine_sticky,
|
||||
+ cpu_string);
|
||||
if (new_cpu != 0)
|
||||
ppc_cpu = new_cpu;
|
||||
else
|
||||
@@ -0,0 +1,147 @@
|
||||
From 82a5bb730a16f8c7962568030268e784b4fb42c8 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Liebler <stli@linux.ibm.com>
|
||||
Date: Thu, 28 Apr 2022 14:29:58 +0200
|
||||
Subject: [PATCH] s390: Avoid dynamic TLS relocs in PIE
|
||||
|
||||
No dynamic relocs are needed for TLS defined in an executable, the
|
||||
TP relative offset is known at link time.
|
||||
|
||||
Fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
* elf64-s390.c (elf_s390_tls_transition): Use bfd_link_dll
|
||||
instead of bfd_link_pic for TLS.
|
||||
(elf_s390_check_relocs): Likewise.
|
||||
(allocate_dynrelocs): Likewise.
|
||||
(elf_s390_relocate_section): Likewise.
|
||||
|
||||
(cherry picked from commit 26b1426577b5dcb32d149c64cca3e603b81948a9)
|
||||
---
|
||||
bfd/elf64-s390.c | 26 +++++++++++++-------------
|
||||
1 file changed, 13 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
|
||||
index e780efa7181..00ee386baab 100644
|
||||
--- a/bfd/elf64-s390.c
|
||||
+++ b/bfd/elf64-s390.c
|
||||
@@ -774,7 +774,7 @@ elf_s390_tls_transition (struct bfd_link_info *info,
|
||||
int r_type,
|
||||
int is_local)
|
||||
{
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
return r_type;
|
||||
|
||||
switch (r_type)
|
||||
@@ -1026,7 +1026,7 @@ elf_s390_check_relocs (bfd *abfd,
|
||||
case R_390_TLS_GOTIE20:
|
||||
case R_390_TLS_GOTIE64:
|
||||
case R_390_TLS_IEENT:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
/* Fall through */
|
||||
|
||||
@@ -1107,7 +1107,7 @@ elf_s390_check_relocs (bfd *abfd,
|
||||
if (r_type == R_390_TLS_LE64 && bfd_link_pie (info))
|
||||
break;
|
||||
|
||||
- if (!bfd_link_pic (info))
|
||||
+ if (!bfd_link_dll (info))
|
||||
break;
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
/* Fall through */
|
||||
@@ -1571,7 +1571,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h,
|
||||
to R_390_TLS_LE64 requiring no TLS entry. For GOTIE12 and IEENT
|
||||
we can save the dynamic TLS relocation. */
|
||||
if (h->got.refcount > 0
|
||||
- && !bfd_link_pic (info)
|
||||
+ && !bfd_link_dll (info)
|
||||
&& h->dynindx == -1
|
||||
&& elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE)
|
||||
{
|
||||
@@ -2662,7 +2662,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
|
||||
/* Relocations for tls literal pool entries. */
|
||||
case R_390_TLS_IE64:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
asection *sreloc;
|
||||
@@ -2690,7 +2690,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
else if (h != NULL)
|
||||
{
|
||||
tls_type = elf_s390_hash_entry(h)->tls_type;
|
||||
- if (!bfd_link_pic (info) && h->dynindx == -1 && tls_type >= GOT_TLS_IE)
|
||||
+ if (!bfd_link_dll (info) && h->dynindx == -1 && tls_type >= GOT_TLS_IE)
|
||||
r_type = R_390_TLS_LE64;
|
||||
}
|
||||
if (r_type == R_390_TLS_GD64 && tls_type >= GOT_TLS_IE)
|
||||
@@ -2801,14 +2801,14 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
if (local_got_offsets == NULL)
|
||||
abort();
|
||||
off = local_got_offsets[r_symndx];
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
goto emit_tls_relocs;
|
||||
}
|
||||
else
|
||||
{
|
||||
off = h->got.offset;
|
||||
tls_type = elf_s390_hash_entry(h)->tls_type;
|
||||
- if (bfd_link_pic (info) || h->dynindx != -1 || tls_type < GOT_TLS_IE)
|
||||
+ if (bfd_link_dll (info) || h->dynindx != -1 || tls_type < GOT_TLS_IE)
|
||||
goto emit_tls_relocs;
|
||||
}
|
||||
|
||||
@@ -2825,7 +2825,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
break;
|
||||
|
||||
case R_390_TLS_LDM64:
|
||||
- if (! bfd_link_pic (info))
|
||||
+ if (! bfd_link_dll (info))
|
||||
/* The literal pool entry this relocation refers to gets ignored
|
||||
by the optimized code of the local exec model. Do nothing
|
||||
and the value will turn out zero. */
|
||||
@@ -2900,7 +2900,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
continue;
|
||||
|
||||
case R_390_TLS_LDO64:
|
||||
- if (bfd_link_pic (info) || (input_section->flags & SEC_DEBUGGING))
|
||||
+ if (bfd_link_dll (info) || (input_section->flags & SEC_DEBUGGING))
|
||||
relocation -= dtpoff_base (info);
|
||||
else
|
||||
/* When converting LDO to LE, we must negate. */
|
||||
@@ -2922,7 +2922,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
|
||||
if (r_type == R_390_TLS_LOAD)
|
||||
{
|
||||
- if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
|
||||
+ if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
|
||||
{
|
||||
/* IE->LE transition. Four valid cases:
|
||||
lg %rx,(0,%ry) -> sllg %rx,%ry,0
|
||||
@@ -2972,7 +2972,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
invalid_tls_insn (input_bfd, input_section, rel);
|
||||
return false;
|
||||
}
|
||||
- if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
|
||||
+ if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
|
||||
{
|
||||
/* GD->LE transition.
|
||||
brasl %r14,__tls_get_addr@plt -> brcl 0,. */
|
||||
@@ -2991,7 +2991,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
else if (r_type == R_390_TLS_LDCALL)
|
||||
{
|
||||
- if (!bfd_link_pic (info))
|
||||
+ if (!bfd_link_dll (info))
|
||||
{
|
||||
unsigned int insn0, insn1;
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From 9a01457e02e7bb594ff9a9ac62a38c909e2e3083 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Liebler <stli@linux.ibm.com>
|
||||
Date: Thu, 28 Apr 2022 14:30:55 +0200
|
||||
Subject: [PATCH] s390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie
|
||||
|
||||
In static-pie case, there are IRELATIVE-relocs in
|
||||
.rela.iplt (htab->irelplt), which will later be grouped
|
||||
to .rela.plt. On s390, the IRELATIVE relocations are
|
||||
always located in .rela.iplt - even for non-static case.
|
||||
Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
|
||||
to the dynamic section even if htab->srelplt->size == 0.
|
||||
See _bfd_elf_add_dynamic_tags in bfd/elflink.c.
|
||||
|
||||
bfd/
|
||||
elf64-s390.c (elf_s390_size_dynamic_sections):
|
||||
Enforce DT_JMPREL via htab->elf.dt_jmprel_required.
|
||||
|
||||
(cherry picked from commit d942d8db12adf4c9e5c7d9ed6496a779ece7149e)
|
||||
---
|
||||
bfd/elf64-s390.c | 15 ++++++++++++++-
|
||||
1 file changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
|
||||
index 00ee386baab..0b851f7ac0e 100644
|
||||
--- a/bfd/elf64-s390.c
|
||||
+++ b/bfd/elf64-s390.c
|
||||
@@ -1876,7 +1876,20 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
else if (startswith (bfd_section_name (s), ".rela"))
|
||||
{
|
||||
if (s->size != 0 && s != htab->elf.srelplt)
|
||||
- relocs = true;
|
||||
+ {
|
||||
+ relocs = true;
|
||||
+ if (s == htab->elf.irelplt)
|
||||
+ {
|
||||
+ /* In static-pie case, there are IRELATIVE-relocs in
|
||||
+ .rela.iplt (htab->irelplt), which will later be grouped
|
||||
+ to .rela.plt. On s390, the IRELATIVE relocations are
|
||||
+ always located in .rela.iplt - even for non-static case.
|
||||
+ Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
|
||||
+ to the dynamic section even if htab->srelplt->size == 0.
|
||||
+ See _bfd_elf_add_dynamic_tags in bfd/elflink.c. */
|
||||
+ htab->elf.dt_jmprel_required = true;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* We use the reloc_count field as a counter if we need
|
||||
to copy relocs into the output file. */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Trofimovich <siarheit@google.com>
|
||||
Date: Mon, 26 Jul 2021 22:51:18 +0100
|
||||
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
|
||||
[PR28144]
|
||||
|
||||
Change 2faf902da ("generate single html manual page by default")
|
||||
added use of --no-split option to makeinfo. binutils reuses
|
||||
makeinfo options for texi2pod.pl wrapper. Unsupported option
|
||||
led to silent manpage truncation.
|
||||
|
||||
The change adds no-op option support.
|
||||
|
||||
etc/
|
||||
PR 28144
|
||||
* texi2pod.pl: Handle no-op --no-split option.
|
||||
|
||||
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
|
||||
---
|
||||
etc/texi2pod.pl | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
|
||||
index 11f70d156be..dcf2b437640 100644
|
||||
--- a/etc/texi2pod.pl
|
||||
+++ b/etc/texi2pod.pl
|
||||
@@ -59,6 +59,8 @@ while ($_ = shift) {
|
||||
$flag = shift;
|
||||
}
|
||||
push (@ipath, $flag);
|
||||
+ } elsif (/^--no-split$/) {
|
||||
+ # ignore option for makeinfo compatibility
|
||||
} elsif (/^-/) {
|
||||
usage();
|
||||
} else {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -8,7 +8,7 @@ fi
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.35.0
|
||||
pkgrel=2
|
||||
pkgrel=14
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -21,16 +21,16 @@ 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.16.apk::$_mirror/v3.16/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.16.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
5c78ac835881f3647d2f434ba79f42e2098ac59c1a32d78b11062ea1bdc07f79dd19f51dd19aeb04853525c87759c3cfc2ad255ad65e1e193bd25d1d7d8143fc busybox-static-1.35.0-r2-aarch64-edge.apk
|
||||
c7c242c2954aaa4367d176ffc27fed92b87015206f62094656cb146b75081e4ffd42d939568df87dd03a79ba12bae933901f01347aa8c32b2320f4cdd537f2f5 busybox-static-1.35.0-r14-aarch64-v3.16.apk
|
||||
"
|
||||
@@ -1,36 +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.35.0
|
||||
pkgrel=2
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-4.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="
|
||||
66eafcdcacfa2bc1bfe777add65e2471994932c2ddb68e30852e87d5d1a26e294e33b888547a4d05c281a9c2d570f0f992cb77a68de367086c055ea285ff31b6 busybox-static-1.35.0-r2-armhf-edge.apk
|
||||
"
|
||||
@@ -8,7 +8,7 @@ fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.35.0
|
||||
pkgrel=2
|
||||
pkgrel=14
|
||||
|
||||
_arch="armv7"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -21,16 +21,16 @@ 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.16.apk::$_mirror/v3.16/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.16.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
ce9099e461f7bb48a5312d00f7dc7b7e863c612925d8d0b8d1c0e6d7689a2d6b9eac47c7627f53eaa8350742d884a457b8fa65b8758ff62e349688141dcdd907 busybox-static-1.35.0-r2-armv7-edge.apk
|
||||
8fe3a2c6583c90907fdd09e0a54e60ca070a49b75d486d43606b674ba465f4dec63d404463db38427fe44eac1edc40ee41329cb7eb5fd3b1fb8ca400a94c1267 busybox-static-1.35.0-r14-armv7-v3.16.apk
|
||||
"
|
||||
@@ -1,4 +1,4 @@
|
||||
From e289226f5f16db14ca549efb41ca82accfe7ea8a Mon Sep 17 00:00:00 2001
|
||||
From feb04e50d907683385cc4dc0163cf1d82258073a 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
|
||||
@@ -38,5 +38,5 @@ index 1b0bfe37852..d7b2b19bb3c 100644
|
||||
else
|
||||
return NULL;
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 48be81c9accb55c3c5ee683c84fa1f908bb18764 Mon Sep 17 00:00:00 2001
|
||||
From d64825212f807435a4b2f8e068c0f65195c8e2e6 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
|
||||
@@ -120,7 +120,7 @@ index df1c9cc3200..5461bab88a9 100644
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 5a4b3c6c234..9d1126e9751 100644
|
||||
index cf536a15116..7d3f1ccddf3 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
@@ -131,7 +131,7 @@ index 5a4b3c6c234..9d1126e9751 100644
|
||||
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
|
||||
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
|
||||
-Wno-scalar-storage-order -Wsequence-point @gol
|
||||
@@ -7727,6 +7728,14 @@ made up of data only and thus requires no special treatment. But, for
|
||||
@@ -7728,6 +7729,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.
|
||||
|
||||
@@ -199,5 +199,5 @@ index 446d280321d..fbfc0ce03b8 100644
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 767b97ca271e82601a435015190fd15bfb28ae12 Mon Sep 17 00:00:00 2001
|
||||
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
||||
Subject: [PATCH] specs: turn on -Wl,-z,now by default
|
||||
@@ -14,10 +14,10 @@ now by default.
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 9d1126e9751..4b8335bbd1f 100644
|
||||
index 7d3f1ccddf3..485d2d6b742 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -15920,6 +15920,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
||||
@@ -15921,6 +15921,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}.
|
||||
|
||||
@@ -40,5 +40,5 @@ index a83ba34ac4b..faf9ce76b3d 100644
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
%{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b8abbd503d1be992bf1d204f0e6de5260fcdf533 Mon Sep 17 00:00:00 2001
|
||||
From 4eb1b3849325b77c4cb66b675119299de35125bb 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,
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
|
||||
index 9f993c4aff2..7db314195ff 100644
|
||||
index 11e015bdb87..de8b7bf246f 100644
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -1421,6 +1421,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
@@ -1427,6 +1427,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);
|
||||
|
||||
@@ -25,10 +25,10 @@ index 9f993c4aff2..7db314195ff 100644
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 4b8335bbd1f..833164e0a2b 100644
|
||||
index 485d2d6b742..164929f7583 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -10224,6 +10224,12 @@ also turns on the following optimization flags:
|
||||
@@ -10225,6 +10225,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.
|
||||
|
||||
@@ -42,5 +42,5 @@ index 4b8335bbd1f..833164e0a2b 100644
|
||||
@opindex O3
|
||||
Optimize yet more. @option{-O3} turns on all optimizations specified
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1837896f54bd318788c1ba6dbd19c3efe147ba20 Mon Sep 17 00:00:00 2001
|
||||
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 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,
|
||||
@@ -268,5 +268,5 @@ index faf9ce76b3d..1ad5da6d769 100644
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1ba693868db68bef5178fd797c9e7d2cc4128182 Mon Sep 17 00:00:00 2001
|
||||
From 85e12e3d32a44c3fd10b5327edd542972a179eec 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.
|
||||
@@ -30,5 +30,5 @@ index 2005b783c68..c5c6af427cc 100644
|
||||
|
||||
Wformat-overflow=
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From eb2f1f7d7c503959279a7317af7b9a7625eecc6e Mon Sep 17 00:00:00 2001
|
||||
From f1e92f5f3576779776c9f3d6aeef76e1569e719a 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.
|
||||
@@ -21,5 +21,5 @@ index d15105a73f3..29f9504cb68 100644
|
||||
|
||||
Wtype-limits
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 7a4086e83e3abbf2c20b7211e2a2c0bf00f25ff8 Mon Sep 17 00:00:00 2001
|
||||
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 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
|
||||
@@ -49,5 +49,5 @@ index 8ba281b4cfa..bab39cdf8a2 100644
|
||||
|
||||
-param=stack-clash-protection-guard-size=
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1c38cbf1f75066c3acc145f449f1fbd0b5de7968 Mon Sep 17 00:00:00 2001
|
||||
From c4dd51fe15a938fdd76d781a4eede2a9205eacbc 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
|
||||
@@ -50,5 +50,5 @@ index 8edd2e05639..63f61fcf96f 100644
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From e4c844ce0c1c355c2d1cf6a6e1595030b8ce2a5e Mon Sep 17 00:00:00 2001
|
||||
From 0a1fd78184f00fb77dac00dabe98eb025620efc2 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.
|
||||
@@ -24,5 +24,5 @@ index f4c0fe11d6f..cf4b1043e4d 100644
|
||||
/* Like asprintf but allocates memory without fail. This works like
|
||||
xmalloc. */
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 79309ae34db26104ec85f6af31a4a8133142fe6d Mon Sep 17 00:00:00 2001
|
||||
From f81d67f6fe1f1066642606209c882b333d937cb7 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
|
||||
@@ -20,5 +20,5 @@ index 4f1213b983b..d0224649d30 100644
|
||||
else true; fi
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From fdf5ef3d1e61625cb96647d5bdc4ca0a32d287ec Mon Sep 17 00:00:00 2001
|
||||
From 3b732288ce771348cbcc9fb633a36b7aff2b4ad4 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
|
||||
@@ -29,5 +29,5 @@ index a3d84896cc5..ecb281d5919 100644
|
||||
# work out any special compilation flags as necessary.
|
||||
case "${target_cpu}" in
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 9442d683845f63b931374ff81a7d08a31f992135 Mon Sep 17 00:00:00 2001
|
||||
From a3e556187d0a8e9d39544f023960eca0f07d3e83 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
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
|
||||
index 16765718cc3..4a855b791b9 100644
|
||||
index 1772fb16c9a..77e04b0c2df 100644
|
||||
--- a/gcc/config/i386/i386-expand.c
|
||||
+++ b/gcc/config/i386/i386-expand.c
|
||||
@@ -11063,10 +11063,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
@@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644
|
||||
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
|
||||
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 7a3e354de1ab87e992bfdaf858677ca140b80732 Mon Sep 17 00:00:00 2001
|
||||
From f520e67fba621f213146271408ff3210b3527176 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
|
||||
@@ -71,5 +71,5 @@ index 5461bab88a9..1577529ffb7 100644
|
||||
AC_SUBST([NO_PIE_FLAG])
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 9a5417a787c2ba197c0a3002ea7423488bedab0a Mon Sep 17 00:00:00 2001
|
||||
From 37310cabb8bc7256899c4d45cc68a47ca2a3232b 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
|
||||
@@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644
|
||||
with both write and execute permission. Code compiled when this
|
||||
option is defined will attempt to map such pages once, but if it
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From ecc537cc597fba87f00d3128fddd5f2a17e7d222 Mon Sep 17 00:00:00 2001
|
||||
From 586e82425a024d85d1bd9952ca51d8a671aa9b5d 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
|
||||
@@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 273edfbf9845a349cec0643c23fff5a740c76f78 Mon Sep 17 00:00:00 2001
|
||||
From 26daa73d678b87a6950df1d79d171ba40ecbce15 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:18:32 +0000
|
||||
Subject: [PATCH] dlang: use libucontext on mips64
|
||||
@@ -20,5 +20,5 @@ index 0643daeb613..b74d9fb3f25 100644
|
||||
power*-*-freebsd*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 602c9c669e8270f51b8c9c07c3b8840d3cc5d5e4 Mon Sep 17 00:00:00 2001
|
||||
From caeae8288593dbd5a1a6d93508d875eb0d8fdf49 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:19:12 +0000
|
||||
Subject: [PATCH] dlang: libdruntime: define fcntl.h constants for mips64
|
||||
@@ -34,5 +34,5 @@ index 59df921ba41..9ee9f943948 100644
|
||||
static assert(0, "Platform not supported");
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 94f4f85904f1c042e4d0c0ac855143129d58fdbd Mon Sep 17 00:00:00 2001
|
||||
From 374a19de60fcd5c31321c3f4d26dcc4b631e8c3f 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
|
||||
@@ -38,5 +38,5 @@ index 5cd5ef64f56..1c611a82cab 100644
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From dac504eb0d50d751ac558efaf84d37716e9ee05b Mon Sep 17 00:00:00 2001
|
||||
From ad053bc46b535e78397f992e3c2c1d28c1ebd1f4 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
|
||||
@@ -20,5 +20,5 @@ index 047be0255e2..426949aa91c 100644
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 5cc67e1262c1641aefa6da1e31bc759ecd1becbd Mon Sep 17 00:00:00 2001
|
||||
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 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
|
||||
@@ -21,5 +21,5 @@ index 4e1db60fced..7fcf402b416 100644
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 154f797756e8098f33fa16799749b4cd827dd81c Mon Sep 17 00:00:00 2001
|
||||
From 38d27ebdcc5a8bea0807b5d56203f0ea5e16868f 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
|
||||
@@ -27,5 +27,5 @@ index 99314032ec2..6e91767efe8 100644
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From a025b2325486bcba0cdf82a0468013961fe7cb99 Mon Sep 17 00:00:00 2001
|
||||
From 0cc2a1befaf343e5ce1cbc15bd247eee812bdf33 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
|
||||
@@ -65,5 +65,5 @@ index 6e91767efe8..22dbbf85850 100644
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From da8359d60789065ad866b0d5e3efa03d69829851 Mon Sep 17 00:00:00 2001
|
||||
From feea6f782e83a53487ad633608484dfa3483be1b 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] mips64: disable multilib support
|
||||
@@ -44,5 +44,5 @@ index 130e1f04707..a64ac2bbb5b 100644
|
||||
+ ../lib32 \
|
||||
+ ../lib
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 56a29e6c843999581b043b9a826853f90a2fd1e8 Mon Sep 17 00:00:00 2001
|
||||
From cbd96a32dc2aaa61f6adcb3643e1da21f185f80e Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:12:55 +0000
|
||||
Subject: [PATCH] aarch64: disable multilib support
|
||||
@@ -22,5 +22,5 @@ index 241b0ef20b6..18e63b34d8b 100644
|
||||
|
||||
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2886563232a0c829e29a4a8d0e1d83392e134aef Mon Sep 17 00:00:00 2001
|
||||
From e87e415e9a88dbce68ed7b9d8386c3c2d0c0d6b6 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:13:59 +0000
|
||||
Subject: [PATCH] s390x: disable multilib support
|
||||
@@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 88e39c0c4bc64a5734fdd6f255b62fd8711d73bb Mon Sep 17 00:00:00 2001
|
||||
From 5c24869c9bc1a552f8bb5c32a8538c6e065a4db8 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:14:33 +0000
|
||||
Subject: [PATCH] ppc64[le]: disable multilib support
|
||||
@@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2df8f5e7bfe077f5bdb1506d971644c471af4a06 Mon Sep 17 00:00:00 2001
|
||||
From 25927f8106583ee594e7bcdf92dd1387e0fd024c Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:14:54 +0000
|
||||
Subject: [PATCH] x86_64: disable multilib support
|
||||
@@ -22,5 +22,5 @@ index d288b093522..2949033aa04 100644
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f45e75200cdebab7c23960d3ccebec862e269557 Mon Sep 17 00:00:00 2001
|
||||
From 18bcf23cae4069ffe9d9f64e851193d29dd4814f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Mon, 3 Jan 2022 07:14:48 +0100
|
||||
Subject: [PATCH] riscv: disable multilib support
|
||||
@@ -70,5 +70,5 @@ index 216d2776a18..1a8a863853e 100644
|
||||
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
|
||||
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 97972b0c9ef7b7f6b7ca87e2bbae6cb4e3adff51 Mon Sep 17 00:00:00 2001
|
||||
From a46c8d6cb9428db29fbf8a80609ff449354ce111 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
|
||||
@@ -47,5 +47,5 @@ index 2c8be561eb5..c557750b1b3 100644
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 62e3ecf4d1216fb0daf9b12db3f4310170a80f8f Mon Sep 17 00:00:00 2001
|
||||
From d7064ab25a561bb99c3d0b35663154656013aed2 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
|
||||
@@ -131,5 +131,5 @@ index 757a6cdfdad..82df94f6a00 100644
|
||||
|
||||
pragma Assert (Result in 0 | ENOMEM);
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From a259508e9e3eb1dd5ebd160ac4600cb948d850fc Mon Sep 17 00:00:00 2001
|
||||
From 5193de0a6c96fefe0c46fc9a6b8c27623ad85640 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
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] ada: musl support fixes
|
||||
4 files changed, 32 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
|
||||
index 987eff0abba..03c8bc6f496 100644
|
||||
index b5b8b573ea4..6fce40d1e98 100644
|
||||
--- a/gcc/ada/Makefile.rtl
|
||||
+++ b/gcc/ada/Makefile.rtl
|
||||
@@ -1748,7 +1748,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
|
||||
@@ -50,7 +50,7 @@ index 987eff0abba..03c8bc6f496 100644
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
|
||||
$(GNATRTL_128BIT_PAIRS) \
|
||||
@@ -2699,7 +2699,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
|
||||
@@ -2700,7 +2700,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) \
|
||||
@@ -219,5 +219,5 @@ index ec9db3a6a4c..6f92e50dd67 100644
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From eec75a34ecc5074ed5857a8a2964d5a1e8fe5a66 Mon Sep 17 00:00:00 2001
|
||||
From 8a42d93247c375f199f3079538d659f95b9ff2a0 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
|
||||
@@ -39,5 +39,5 @@ index 11e4ec436bd..fe866eacb27 100644
|
||||
|
||||
if test "${GOOS}" = "aix"; then
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From dfd96cebf29a04f8a89587deb7469274cd206382 Mon Sep 17 00:00:00 2001
|
||||
From c205f79c18add13247a06cfd843f5eb44c4c3cb4 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 25 Nov 2021 01:47:03 +0000
|
||||
Subject: [PATCH] There are more than one st_{a,m,c}tim fields in struct stat
|
||||
@@ -23,5 +23,5 @@ index 0c52ea5d71a..6fef104cc1c 100755
|
||||
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
|
||||
fi
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 54aca66b0640f56b7b0473ebd08ec8e9c8edb78e Mon Sep 17 00:00:00 2001
|
||||
From af64f915a4717036a7f1fe637308b455c94e0f1e 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
|
||||
@@ -25,5 +25,5 @@ index 2eece687e35..e86490ce203 100644
|
||||
}
|
||||
throw("sigaction read failure")
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c61dfe08fa888a93fd1d65484a79dc4dd4260c03 Mon Sep 17 00:00:00 2001
|
||||
From 6e41b6753af412388e9259fe791904146695e84e 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
|
||||
@@ -23,5 +23,5 @@ index 38bf7a6b255..e50403b5a75 100644
|
||||
|
||||
static inline void
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 9e7be29ad618d48740f42c98ba93e8367341b63f Mon Sep 17 00:00:00 2001
|
||||
From cc89c078ffc58a7f6675a60fbca24224effcb7e3 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
|
||||
@@ -21,5 +21,5 @@ index 426949aa91c..f97db1ef569 100644
|
||||
--srcdir=$${topdir}/$$module_srcdir \
|
||||
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f9defb064cdd5565d308df5d61f6881ea601e276 Mon Sep 17 00:00:00 2001
|
||||
From 3fb914ca83ac18287ee24aa75aba9149e35487ad Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Mon, 19 Apr 2021 07:21:41 +0200
|
||||
Subject: [PATCH] Use generic errstr.go implementation on musl
|
||||
@@ -44,5 +44,5 @@ index 5b19e6f202d..8dc60172186 100644
|
||||
package syscall
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c25b1e409bd20c7a1c47063e36c75f0dcca0b410 Mon Sep 17 00:00:00 2001
|
||||
From 52ce9c86c0c89ae45e0d08cc232682e1811aa8f2 Mon Sep 17 00:00:00 2001
|
||||
From: Drew DeVault <sir@cmpwn.com>
|
||||
Date: Wed, 9 Dec 2020 16:07:26 +0000
|
||||
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
|
||||
@@ -271,5 +271,5 @@ index 22dbbf85850..90aa576037a 100644
|
||||
|
||||
#ifdef ENABLE_DEFAULT_SSP
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0282e9fc31d4245f0c562ac42fa7c900363c2c12 Mon Sep 17 00:00:00 2001
|
||||
From 5010fa237897bca92291ba8835123125d4af933a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sun, 29 Aug 2021 09:45:27 +0200
|
||||
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
|
||||
@@ -53,5 +53,5 @@ index 670b0d72cfe..38c2cd9345f 100644
|
||||
alpha*)
|
||||
# fenv.c needs this option to generate inexact exceptions.
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From eab088e3a76ce23cf2365351c59707e2dd0aa599 Mon Sep 17 00:00:00 2001
|
||||
From 2d924c522dde7426afbb8096d9301b17d0e73121 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sun, 28 Nov 2021 00:54:37 +0100
|
||||
Subject: [PATCH] libgo: Recognize off64_t and loff_t definitions of musl libc
|
||||
@@ -80,5 +80,5 @@ index 8ce061e2f5f..b85add15a7b 100644
|
||||
// be signed in some OSes.
|
||||
#ifdef SIOCGIFMTU
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From cad142fc0fa5fa52c886ad8807cc62b34e5f1540 Mon Sep 17 00:00:00 2001
|
||||
From 72f32e3383129ad139df76d9a063fac9b03079b1 Mon Sep 17 00:00:00 2001
|
||||
From: Alex McGrath <amk@amk.ie>
|
||||
Date: Wed, 13 Oct 2021 23:24:27 +0100
|
||||
Subject: [PATCH] Fix attempt to use poisoned calloc error in libgccjit
|
||||
@@ -76,5 +76,5 @@ index 0cc650f9810..2f44481eeb0 100644
|
||||
#include "libgccjit.h"
|
||||
#include "jit-recording.h"
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4ede09cec9f5df24d0d24e7d82b07a9a0ffccdda Mon Sep 17 00:00:00 2001
|
||||
From aeef0ee2aac43d89ae26c6a3559aae4f8a1d53da Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Thu, 25 Nov 2021 17:44:04 +0100
|
||||
Subject: [PATCH] stddef.h: add support for musl typedef macro guards
|
||||
@@ -102,5 +102,5 @@ index 66619fe43b1..50d710a5ab9 100644
|
||||
#endif /* _BSD_RUNE_T_DEFINED_ */
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 61fc6a52f3fc5fe6c66dc2dd0fa222ba1349d7e5 Mon Sep 17 00:00:00 2001
|
||||
From 36c79820c1085590f272ef1afcad4744125d96d0 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Sun, 30 Aug 2020 18:33:49 +0200
|
||||
Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap
|
||||
@@ -59,5 +59,5 @@ index fa3389d857e..57bed97c710 100644
|
||||
if uintptr(p) == _MAP_FAILED {
|
||||
return nil, errno()
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
From 30e4c9be8d17c7806beaca9e78f6aff6ebae6463 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Wed, 15 Dec 2021 00:14:19 +0100
|
||||
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
|
||||
|
||||
The -fsplit-stack option requires the pthread_t TCB definition in the
|
||||
libc to provide certain struct fields at specific hardcoded offsets. As
|
||||
far as I know, only glibc provides these fields at the required offsets.
|
||||
Most notably, musl libc does not have these fields. However, since gcc
|
||||
accesses the fields using a fixed offset this does not cause a
|
||||
compile-time error but instead results in a silent memory corruption at
|
||||
run-time. For example, on s390x libgcc's __stack_split_initialize CTOR
|
||||
will overwrite the cancel field in the pthread_t TCB on musl.
|
||||
|
||||
The -fsplit-stack option is used within the gcc code base by gcc-go by
|
||||
default. On musl based systems with split-stack support (e.g. s390x or
|
||||
x86) this causes Go programs compiled with gcc-go to misbehave at
|
||||
run-time.
|
||||
|
||||
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
|
||||
since it is not supported on non-glibc targets anyhow. This is achieved
|
||||
by checking if TARGET_GLIBC_MAJOR is defined to a non-zero value (it
|
||||
defaults to zero on non-glibc systems). The check has been added for x86
|
||||
and s390x, the rs6000 config already checks for TARGET_GLIBC_MAJOR. With
|
||||
this patch applied, the gcc-go configure script will detect that
|
||||
-fsplit-stack support is not available and will not use it.
|
||||
|
||||
This patch has been tested on Alpine Linux Edge on the s390x
|
||||
architecture by bootstrapping Google's Go implementation with gcc-go.
|
||||
|
||||
See https://www.openwall.com/lists/musl/2012/10/16/12
|
||||
---
|
||||
gcc/common/config/s390/s390-common.c | 9 ++++++++-
|
||||
gcc/config/i386/gnu-user-common.h | 5 +++--
|
||||
gcc/config/i386/gnu.h | 6 +++++-
|
||||
3 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
|
||||
index b6bc8501742..afbd8d3fe66 100644
|
||||
--- a/gcc/common/config/s390/s390-common.c
|
||||
+++ b/gcc/common/config/s390/s390-common.c
|
||||
@@ -116,13 +116,20 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
|
||||
|
||||
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
|
||||
We don't verify it, since earlier versions just have padding at
|
||||
- its place, which works just as well. */
|
||||
+ its place, which works just as well. For other libc implementations
|
||||
+ we disable the feature entirely to avoid corrupting the TCB. */
|
||||
|
||||
static bool
|
||||
s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
|
||||
struct gcc_options *opts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
+#if TARGET_GLIBC_MAJOR
|
||||
return true;
|
||||
+#else
|
||||
+ if (report)
|
||||
+ error("%<-fsplit-stack%> currently only supported on GNU/Linux");
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
#undef TARGET_DEFAULT_TARGET_FLAGS
|
||||
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
|
||||
index 00226f5a455..554e146dbbe 100644
|
||||
--- a/gcc/config/i386/gnu-user-common.h
|
||||
+++ b/gcc/config/i386/gnu-user-common.h
|
||||
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
|
||||
/* We only build the -fsplit-stack support in libgcc if the
|
||||
- assembler has full support for the CFI directives. */
|
||||
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
|
||||
+ assembler has full support for the CFI directives and
|
||||
+ uses glibc. */
|
||||
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && TARGET_GLIBC_MAJOR
|
||||
#define TARGET_CAN_SPLIT_STACK
|
||||
#endif
|
||||
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
|
||||
index 25fbc07f58c..895a7369816 100644
|
||||
--- a/gcc/config/i386/gnu.h
|
||||
+++ b/gcc/config/i386/gnu.h
|
||||
@@ -35,7 +35,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
|
||||
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
|
||||
#endif
|
||||
|
||||
-#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
|
||||
+ field is only available for glibc. Disable -fsplit-stack for
|
||||
+ other libc implementation to avoid silent TCB corruptions. */
|
||||
+
|
||||
+#if defined (TARGET_LIBC_PROVIDES_SSP) && TARGET_GLIBC_MAJOR
|
||||
|
||||
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
|
||||
#define TARGET_THREAD_SSP_OFFSET 0x14
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
From c1408c2e323bf724db3bb8b1523e4cf5848c7e63 Mon Sep 17 00:00:00 2001
|
||||
From 353c8abdc34a294c89c24423ef0c4182189117f6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
|
||||
Date: Sun, 2 Jan 2022 01:07:03 +0100
|
||||
Subject: [PATCH] libgo: include asm/ptrace.h for pt_regs definition on PowerPC
|
||||
@@ -54,5 +54,5 @@ index d30d1603adc..fc01e04e4a1 100644
|
||||
|
||||
#ifndef SA_RESTART
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
From 2c6bf28619c9b3bf713f7f5319c5d750a6c297ae Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
|
||||
Date: Fri, 21 Jan 2022 19:22:46 +0000
|
||||
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The -fsplit-stack option requires the pthread_t TCB definition in the
|
||||
libc to provide certain struct fields at specific hardcoded offsets. As
|
||||
far as I know, only glibc provides these fields at the required offsets.
|
||||
Most notably, musl libc does not have these fields. However, since gcc
|
||||
accesses the fields using a fixed offset, this does not cause a
|
||||
compile-time error, but instead results in a silent memory corruption at
|
||||
run-time with musl libc. For example, on s390x libgcc's
|
||||
__stack_split_initialize CTOR will overwrite the cancel field in the
|
||||
pthread_t TCB on musl.
|
||||
|
||||
The -fsplit-stack option is used within the gcc code base itself by
|
||||
gcc-go (if available). On musl-based systems with split-stack support
|
||||
(i.e. s390x or x86) this causes Go programs compiled with gcc-go to
|
||||
misbehave at run-time.
|
||||
|
||||
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
|
||||
since it is not supported on non-glibc targets anyhow. This is achieved
|
||||
by checking if gcc targets a glibc-based system. This check has been
|
||||
added for x86 and s390x, the rs6000 config already checks for
|
||||
TARGET_GLIBC_MAJOR. Other architectures do not have split-stack
|
||||
support. With this patch applied, the gcc-go configure script will
|
||||
detect that -fsplit-stack support is not available and will not use it.
|
||||
|
||||
See https://www.openwall.com/lists/musl/2012/10/16/12
|
||||
|
||||
This patch was written under the assumption that glibc is the only libc
|
||||
implementation which supports the required fields at the required
|
||||
offsets in the pthread_t TCB. The patch has been tested on Alpine Linux
|
||||
Edge on the s390x and x86 architectures by bootstrapping Google's Go
|
||||
implementation with gcc-go.
|
||||
|
||||
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
|
||||
|
||||
gcc/ChangeLog:
|
||||
|
||||
* common/config/s390/s390-common.c (s390_supports_split_stack):
|
||||
Only support split-stack on glibc targets.
|
||||
* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN): Ditto.
|
||||
* config/i386/gnu.h (defined): Ditto.
|
||||
---
|
||||
gcc/common/config/s390/s390-common.c | 14 ++++++++++----
|
||||
gcc/config/i386/gnu-user-common.h | 5 +++--
|
||||
gcc/config/i386/gnu.h | 5 ++++-
|
||||
3 files changed, 17 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
|
||||
index b6bc8501742..8c1e590322d 100644
|
||||
--- a/gcc/common/config/s390/s390-common.c
|
||||
+++ b/gcc/common/config/s390/s390-common.c
|
||||
@@ -116,13 +116,19 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
|
||||
|
||||
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
|
||||
We don't verify it, since earlier versions just have padding at
|
||||
- its place, which works just as well. */
|
||||
+ its place, which works just as well. For other libc implementations
|
||||
+ we disable the feature entirely to avoid corrupting the TCB. */
|
||||
|
||||
static bool
|
||||
-s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
|
||||
- struct gcc_options *opts ATTRIBUTE_UNUSED)
|
||||
+s390_supports_split_stack (bool report,
|
||||
+ struct gcc_options *opts)
|
||||
{
|
||||
- return true;
|
||||
+ if (opts->x_linux_libc == LIBC_GLIBC)
|
||||
+ return true;
|
||||
+
|
||||
+ if (report)
|
||||
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
|
||||
+ return false;
|
||||
}
|
||||
|
||||
#undef TARGET_DEFAULT_TARGET_FLAGS
|
||||
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
|
||||
index 00226f5a455..6e13315b5a3 100644
|
||||
--- a/gcc/config/i386/gnu-user-common.h
|
||||
+++ b/gcc/config/i386/gnu-user-common.h
|
||||
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
|
||||
/* We only build the -fsplit-stack support in libgcc if the
|
||||
- assembler has full support for the CFI directives. */
|
||||
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
|
||||
+ assembler has full support for the CFI directives and
|
||||
+ targets glibc. */
|
||||
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
|
||||
#define TARGET_CAN_SPLIT_STACK
|
||||
#endif
|
||||
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
|
||||
index 25fbc07f58c..afd3e8e8841 100644
|
||||
--- a/gcc/config/i386/gnu.h
|
||||
+++ b/gcc/config/i386/gnu.h
|
||||
@@ -35,7 +35,10 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
|
||||
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
|
||||
#endif
|
||||
|
||||
-#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
|
||||
+ field is only available for glibc. Disable -fsplit-stack for
|
||||
+ other libc implementations to avoid silent TCB corruptions. */
|
||||
+#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
|
||||
|
||||
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
|
||||
#define TARGET_THREAD_SSP_OFFSET 0x14
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
From 4ea687132408a7c662706c4a7eb3c61b7773d735 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Fri, 21 Jan 2022 13:24:00 -0800
|
||||
Subject: [PATCH] x86: Properly disable -fsplit-stack support on non-glibc
|
||||
targets
|
||||
|
||||
Revert x86 changes in
|
||||
|
||||
commit c163647ffbc9a20c8feb6e079dbecccfe016c82e
|
||||
Author: Soren Tempel <soeren@soeren-tempel.net>
|
||||
Date: Fri Jan 21 19:22:46 2022 +0000
|
||||
|
||||
Disable -fsplit-stack support on non-glibc targets
|
||||
|
||||
and change ix86_supports_split_stack to return true only on glibc.
|
||||
|
||||
PR bootstrap/104170
|
||||
* common/config/i386/i386-common.c (ix86_supports_split_stack):
|
||||
Return true only on glibc.
|
||||
* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN):
|
||||
Revert commit c163647ffbc.
|
||||
* config/i386/gnu.h (TARGET_LIBC_PROVIDES_SSP): Likewise.
|
||||
---
|
||||
gcc/common/config/i386/i386-common.c | 17 +++++++++++------
|
||||
gcc/config/i386/gnu-user-common.h | 5 ++---
|
||||
gcc/config/i386/gnu.h | 5 +----
|
||||
3 files changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
|
||||
index 96549aa7d7e..a3b5258e828 100644
|
||||
--- a/gcc/common/config/i386/i386-common.c
|
||||
+++ b/gcc/common/config/i386/i386-common.c
|
||||
@@ -1696,16 +1696,21 @@ ix86_option_init_struct (struct gcc_options *opts)
|
||||
field in the TCB, so they cannot be used together. */
|
||||
|
||||
static bool
|
||||
-ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
|
||||
+ix86_supports_split_stack (bool report,
|
||||
struct gcc_options *opts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
|
||||
+ if (opts->x_linux_libc != LIBC_GLIBC)
|
||||
+#endif
|
||||
+ {
|
||||
+ if (report)
|
||||
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
bool ret = true;
|
||||
|
||||
-#ifndef TARGET_THREAD_SPLIT_STACK_OFFSET
|
||||
- if (report)
|
||||
- error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
|
||||
- ret = false;
|
||||
-#else
|
||||
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
|
||||
if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
|
||||
{
|
||||
if (report)
|
||||
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
|
||||
index 6e13315b5a3..00226f5a455 100644
|
||||
--- a/gcc/config/i386/gnu-user-common.h
|
||||
+++ b/gcc/config/i386/gnu-user-common.h
|
||||
@@ -66,8 +66,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
|
||||
/* We only build the -fsplit-stack support in libgcc if the
|
||||
- assembler has full support for the CFI directives and
|
||||
- targets glibc. */
|
||||
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
|
||||
+ assembler has full support for the CFI directives. */
|
||||
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
|
||||
#define TARGET_CAN_SPLIT_STACK
|
||||
#endif
|
||||
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
|
||||
index afd3e8e8841..25fbc07f58c 100644
|
||||
--- a/gcc/config/i386/gnu.h
|
||||
+++ b/gcc/config/i386/gnu.h
|
||||
@@ -35,10 +35,7 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
|
||||
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
|
||||
#endif
|
||||
|
||||
-/* -fsplit-stack uses a field in the TCB at a fixed offset. This
|
||||
- field is only available for glibc. Disable -fsplit-stack for
|
||||
- other libc implementations to avoid silent TCB corruptions. */
|
||||
-#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
|
||||
+#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
|
||||
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
|
||||
#define TARGET_THREAD_SSP_OFFSET 0x14
|
||||
--
|
||||
2.35.1
|
||||
|
||||
+3
-4
@@ -1,9 +1,8 @@
|
||||
From 7b7f146c0dd01fde892ed5b5f40850bdacd7431b Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
From e74e2946a534fbac7e8ec6c687c407761daef49a Mon Sep 17 00:00:00 2001
|
||||
From: Mathias LANG <pro.mathias.lang@gmail.com>
|
||||
Date: Mon, 17 Jan 2022 16:31:09 +0000
|
||||
Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext
|
||||
|
||||
from: Mathias LANG <pro.mathias.lang@gmail.com>
|
||||
ref: alpine/aports#13422
|
||||
---
|
||||
Makefile.in | 2 +-
|
||||
@@ -23,5 +22,5 @@ index 7e577ed3dbb..da40b61a8c5 100644
|
||||
--srcdir=$${topdir}/$$module_srcdir \
|
||||
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
|
||||
--
|
||||
2.34.1
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
From 7b5108375bb67532af30d1e7f553ac5f3b1096fe Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelinek <jakub@redhat.com>
|
||||
Date: Mon, 24 Jan 2022 11:13:39 +0100
|
||||
Subject: [PATCH] properly disable -fsplit-stack on non-glibc targets
|
||||
[PR104170]
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
On Sat, Jan 22, 2022 at 10:32:21AM +0100, Martin Liška wrote:
|
||||
> I've just noticed the patch broke a few cross compilers:
|
||||
>
|
||||
> s390x-ibm-tpf:
|
||||
>
|
||||
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc: In function ‘bool s390_supports_split_stack(bool, gcc_options*)’:
|
||||
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc:126:13: error: ‘struct gcc_options’ has no member named ‘x_linux_libc’
|
||||
> 126 | if (opts->x_linux_libc == LIBC_GLIBC)
|
||||
> | ^~~~~~~~~~~~
|
||||
>
|
||||
> i686-kopensolaris-gnu, i686-symbolics-gnu
|
||||
>
|
||||
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc: In function ‘bool ix86_supports_split_stack(bool, gcc_options*)’:
|
||||
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc:1721:13: error: ‘struct gcc_options’ has no member named ‘x_linux_libc’
|
||||
> 1721 | if (opts->x_linux_libc != LIBC_GLIBC)
|
||||
> | ^~~~~~~~~~~~
|
||||
> make[1]: *** [Makefile:2418: i386-common.o] Error 1
|
||||
>
|
||||
> Can you please take a look? Btw. do you have a bugzilla account?
|
||||
|
||||
I bet instead of opts->x_linux_libc != LIBC_GLIBC it needs to use
|
||||
#ifdef OPTION_GLIBC
|
||||
if (!OPTION_GLIBC)
|
||||
#endif
|
||||
or so. I think the first committed patch actually used that
|
||||
but used it in #if directive, which is wrong because it is something
|
||||
that needs to be evaluated at runtime.
|
||||
|
||||
That doesn't work well either, because the *supports_split_stack
|
||||
hooks have opts argument and OPTION_GLIBC doesn't take that.
|
||||
|
||||
So, here is a patch that introduces OPTION_*_P macros that take opts
|
||||
as an argument and redefines OPTION_* using those (similarly to how
|
||||
the option scripts create TARGET_*_P and TARGET_* macros).
|
||||
|
||||
2022-01-24 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR bootstrap/104170
|
||||
* config/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
|
||||
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
|
||||
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
|
||||
using OPTION_*_P macros.
|
||||
* config/alpha/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
|
||||
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
|
||||
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
|
||||
using OPTION_*_P macros.
|
||||
* config/rs6000/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
|
||||
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
|
||||
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
|
||||
using OPTION_*_P macros.
|
||||
* config/rs6000/linux64.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
|
||||
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
|
||||
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
|
||||
using OPTION_*_P macros.
|
||||
* config/fuchsia.h (OPTION_MUSL_P): Redefine.
|
||||
* config/glibc-stdint.h (OPTION_MUSL_P): Define if not defined.
|
||||
* common/config/s390/s390-common.cc (s390_supports_split_stack): Re-add
|
||||
ATTRIBUTE_UNUSED to opts parameter. If OPTION_GLIBC_P is defined, use
|
||||
OPTION_GLIBC_P (opts) as condition, otherwise assume if (false).
|
||||
* common/config/i386/i386-common.cc (ix86_supports_split_stack): If
|
||||
OPTION_GLIBC_P is defined use !OPTION_GLIBC_P (opts) as condition,
|
||||
otherwise assume if (true).
|
||||
---
|
||||
gcc/common/config/i386/i386-common.c | 4 ++--
|
||||
gcc/common/config/s390/s390-common.c | 6 ++++--
|
||||
gcc/config/alpha/linux.h | 25 +++++++++++++++----------
|
||||
gcc/config/fuchsia.h | 2 ++
|
||||
gcc/config/glibc-stdint.h | 3 +++
|
||||
gcc/config/linux.h | 25 +++++++++++++++----------
|
||||
gcc/config/rs6000/linux.h | 25 +++++++++++++++----------
|
||||
gcc/config/rs6000/linux64.h | 25 +++++++++++++++----------
|
||||
8 files changed, 71 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
|
||||
index a3b5258e828..864e68ab985 100644
|
||||
--- a/gcc/common/config/i386/i386-common.c
|
||||
+++ b/gcc/common/config/i386/i386-common.c
|
||||
@@ -1699,8 +1699,8 @@ static bool
|
||||
ix86_supports_split_stack (bool report,
|
||||
struct gcc_options *opts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
-#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
|
||||
- if (opts->x_linux_libc != LIBC_GLIBC)
|
||||
+#if defined(TARGET_THREAD_SPLIT_STACK_OFFSET) && defined(OPTION_GLIBC_P)
|
||||
+ if (!OPTION_GLIBC_P (opts))
|
||||
#endif
|
||||
{
|
||||
if (report)
|
||||
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
|
||||
index 8c1e590322d..11116f131cb 100644
|
||||
--- a/gcc/common/config/s390/s390-common.c
|
||||
+++ b/gcc/common/config/s390/s390-common.c
|
||||
@@ -121,10 +121,12 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
|
||||
|
||||
static bool
|
||||
s390_supports_split_stack (bool report,
|
||||
- struct gcc_options *opts)
|
||||
+ struct gcc_options *opts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- if (opts->x_linux_libc == LIBC_GLIBC)
|
||||
+#ifdef OPTION_GLIBC_P
|
||||
+ if (OPTION_GLIBC_P (opts))
|
||||
return true;
|
||||
+#endif
|
||||
|
||||
if (report)
|
||||
error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
|
||||
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
|
||||
index bde7fb0d292..812ec8ecb31 100644
|
||||
--- a/gcc/config/alpha/linux.h
|
||||
+++ b/gcc/config/alpha/linux.h
|
||||
@@ -58,18 +58,23 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define WCHAR_TYPE "int"
|
||||
|
||||
#ifdef SINGLE_LIBC
|
||||
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
|
||||
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
|
||||
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
this includes full c99 runtime and sincos. */
|
||||
diff --git a/gcc/config/fuchsia.h b/gcc/config/fuchsia.h
|
||||
index 54602dc300d..47c0dfd8b81 100644
|
||||
--- a/gcc/config/fuchsia.h
|
||||
+++ b/gcc/config/fuchsia.h
|
||||
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
|
||||
/* We are using MUSL as our libc. */
|
||||
#undef OPTION_MUSL
|
||||
#define OPTION_MUSL 1
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) 1
|
||||
|
||||
#ifndef TARGET_SUB_OS_CPP_BUILTINS
|
||||
#define TARGET_SUB_OS_CPP_BUILTINS()
|
||||
diff --git a/gcc/config/glibc-stdint.h b/gcc/config/glibc-stdint.h
|
||||
index c8d7ba18d1c..f095197514f 100644
|
||||
--- a/gcc/config/glibc-stdint.h
|
||||
+++ b/gcc/config/glibc-stdint.h
|
||||
@@ -27,6 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#ifndef OPTION_MUSL
|
||||
#define OPTION_MUSL 0
|
||||
#endif
|
||||
+#ifndef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) 0
|
||||
+#endif
|
||||
|
||||
#define SIG_ATOMIC_TYPE "int"
|
||||
|
||||
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
|
||||
index 7fcf402b416..ab62a1741f7 100644
|
||||
--- a/gcc/config/linux.h
|
||||
+++ b/gcc/config/linux.h
|
||||
@@ -29,18 +29,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
|
||||
/* C libraries supported on Linux. */
|
||||
#ifdef SINGLE_LIBC
|
||||
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
|
||||
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
|
||||
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
|
||||
|
||||
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
|
||||
do { \
|
||||
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
|
||||
index 47c9d9ac0b6..be04462d357 100644
|
||||
--- a/gcc/config/rs6000/linux.h
|
||||
+++ b/gcc/config/rs6000/linux.h
|
||||
@@ -27,18 +27,23 @@
|
||||
#define NO_PROFILE_COUNTERS 1
|
||||
|
||||
#ifdef SINGLE_LIBC
|
||||
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
|
||||
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
|
||||
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
this includes full c99 runtime and sincos. */
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index 43499ed29cf..1d73a09a476 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -267,18 +267,23 @@ extern int dot_symbols;
|
||||
#define OS_MISSING_POWERPC64 !TARGET_64BIT
|
||||
|
||||
#ifdef SINGLE_LIBC
|
||||
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
|
||||
#else
|
||||
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
|
||||
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
|
||||
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
|
||||
-#undef OPTION_MUSL
|
||||
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
|
||||
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
|
||||
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL_P
|
||||
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
|
||||
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
|
||||
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
this includes full c99 runtime and sincos. */
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From 400bae077d11c3a2ee9f4c8b96c31bbf39416a4f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
|
||||
Date: Mon, 21 Feb 2022 04:13:47 +0100
|
||||
Subject: [PATCH] x86: Fix -fsplit-stack feature detection via
|
||||
TARGET_CAN_SPLIT_STACK
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Since commit c163647ffbc9a20c8feb6e079dbecccfe016c82e -fsplit-stack
|
||||
is only supported on glibc targets. However, this original commit
|
||||
required some fixups. As part of the fixup, the changes to the
|
||||
gnu-user-common.h and gnu.h where partially reverted in commit
|
||||
60953a23d57b13a672f751bec0c6eefc059eb1ab thus causing TARGET_CAN_SPLIT_STACK
|
||||
to be defined for non-glibc targets even though -fsplit-stack is
|
||||
actually not supported and attempting to use it causes a runtime error.
|
||||
|
||||
This causes gcc internal code, such as ./gcc/go/gospec.c to not
|
||||
correctly detect that -fsplit-stack is not supported and thus causes
|
||||
gccgo to fail compilation on non-glibc targets.
|
||||
|
||||
This commit ensures that TARGET_CAN_SPLIT_STACK is set based on the
|
||||
changes performed in 2c31a8be4a5db11a0a0e97c366dded6362421086, i.e.
|
||||
the new OPTION_GLIBC_P macro is now used to detect if -fsplit-stack is
|
||||
supported in the x86 header files.
|
||||
|
||||
The proposed changes have been tested on x86_64 Alpine Linux (which uses
|
||||
musl libc) and fix compilation of gccgo for this target.
|
||||
|
||||
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
|
||||
|
||||
gcc/ChangeLog:
|
||||
|
||||
* config/i386/gnu-user-common.h (defined): Only define
|
||||
TARGET_CAN_SPLIT_STACK for glibc targets.
|
||||
* config/i386/gnu.h (defined): Ditto.
|
||||
---
|
||||
gcc/config/i386/gnu-user-common.h | 5 +++--
|
||||
gcc/config/i386/gnu.h | 5 +++--
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
|
||||
index 00226f5a455..4e3fbb1de05 100644
|
||||
--- a/gcc/config/i386/gnu-user-common.h
|
||||
+++ b/gcc/config/i386/gnu-user-common.h
|
||||
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
|
||||
/* We only build the -fsplit-stack support in libgcc if the
|
||||
- assembler has full support for the CFI directives. */
|
||||
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
|
||||
+ assembler has full support for the CFI directives. Also
|
||||
+ we only support -fsplit-stack on glibc targets. */
|
||||
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && defined(OPTION_GLIBC_P)
|
||||
#define TARGET_CAN_SPLIT_STACK
|
||||
#endif
|
||||
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
|
||||
index 25fbc07f58c..41a6a37dfee 100644
|
||||
--- a/gcc/config/i386/gnu.h
|
||||
+++ b/gcc/config/i386/gnu.h
|
||||
@@ -41,8 +41,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define TARGET_THREAD_SSP_OFFSET 0x14
|
||||
|
||||
/* We only build the -fsplit-stack support in libgcc if the
|
||||
- assembler has full support for the CFI directives. */
|
||||
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
|
||||
+ assembler has full support for the CFI directives. Also
|
||||
+ we only support -fsplit-stack on glibc targets. */
|
||||
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && defined(OPTION_GLIBC_P)
|
||||
#define TARGET_CAN_SPLIT_STACK
|
||||
#endif
|
||||
/* We steal the last transactional memory word. */
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From dba87d9796b61f4f3eea83c200a2d208564e2277 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Mon, 21 Feb 2022 10:04:47 +0000
|
||||
Subject: [PATCH] go/gospec: forcibly disable -fsplit-stack support
|
||||
|
||||
for some reason, TARGET_CAN_SPLIT_STACK still gets defined on 32-bit x86,
|
||||
so hackfix it for now
|
||||
---
|
||||
gcc/go/gospec.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c
|
||||
index cf8d0f2b60e..d5bfa57ea45 100644
|
||||
--- a/gcc/go/gospec.c
|
||||
+++ b/gcc/go/gospec.c
|
||||
@@ -269,11 +269,12 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
|
||||
/* Copy the 0th argument, i.e., the name of the program itself. */
|
||||
new_decoded_options[j++] = decoded_options[i++];
|
||||
|
||||
-#ifdef TARGET_CAN_SPLIT_STACK
|
||||
+ /* Hackfix: we never support split stack on Alpine GCC */
|
||||
+#if 0
|
||||
supports_split_stack = 1;
|
||||
#endif
|
||||
|
||||
-#ifdef TARGET_CAN_SPLIT_STACK_64BIT
|
||||
+#if 0
|
||||
if (is_m64)
|
||||
supports_split_stack = 1;
|
||||
#endif
|
||||
--
|
||||
2.35.1
|
||||
|
||||
+65
-53
@@ -25,13 +25,13 @@ _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname=gcc-aarch64
|
||||
_pkgbase=11.2.1
|
||||
pkgver=11.2.1_git20220117
|
||||
pkgver=11.2.1_git20220219
|
||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname=gcc-aarch64
|
||||
pkgrel=0
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
@@ -245,9 +245,14 @@ source="https://dev.alpinelinux.org/~nenolod/gcc-${pkgver}.tar.xz
|
||||
0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
|
||||
0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
|
||||
0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||
0045-Disable-fsplit-stack-support-on-non-glibc-targets.patch
|
||||
0046-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
|
||||
0047-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
0045-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
|
||||
0046-Disable-fsplit-stack-support-on-non-glibc-targets.patch
|
||||
0047-x86-Properly-disable-fsplit-stack-support-on-non-gli.patch
|
||||
0048-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
0049-properly-disable-fsplit-stack-on-non-glibc-targets-P.patch
|
||||
0050-x86-Fix-fsplit-stack-feature-detection-via-TARGET_CA.patch
|
||||
0051-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||
libgo-musl-1.2.3.patch
|
||||
"
|
||||
|
||||
# we build out-of-tree
|
||||
@@ -599,7 +604,9 @@ gdc() {
|
||||
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/libgdruntime.so "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.so "$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/
|
||||
@@ -709,52 +716,57 @@ gnat() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
e756307338258432bd8dfc41cf27440117bca4cd7a3a80a7009eb06d06004ade0a61eefd773969ed6578afadef96b4813d41961faf8a43c28d0af77a388fea7d gcc-11.2.1_git20220117.tar.xz
|
||||
7e5d342e302b376c729e17998d3fdbb8397ed9330c44e0335c4a7319c010bb8d1680c45f37d9eb96d67f99d052290fe943aa818799307271a846a50232db0aa0 0001-posix_memalign.patch
|
||||
fe147a13e8e460a8ec6df26b7bed67455d55bd6ca238fc52f04095bb8151ec54c85bb048a90fa0ed4f42f97caacd158dec0b3651f32ecac3ce39c53e18aa3747 0002-gcc-poison-system-directories.patch
|
||||
6d8d6335ae657a65fea2bfed74c1da41208ae8849bd156622425c691d45d29a3e42ad419284ca70630c10cb14a458322dbcefc23ee87f24b85fdd0bb28bedc61 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||
122e99feaa5954aea8f9bf9157b1d486725ea6643727eee440ab818d4a69c817eca6ac5ece3952687e53ca92781c3d00b5ae3e6fb20c71880377ff1b9c72650b 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
dc98a6f99dbaee44b1fb1ecdb5eb924a9636d705dc556d1a760611b0d38c215b9e33a9cd13f5307d2d3c16f86ebe8e9f700ecffc05cf9739554f57f3d953da0b 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
f55372e68065c31020a8afb5bb0b341a155f59887c8723151e3d2842f1a93842e86dc91a3860661762fbba6de340ba75727ad87e04b177975428f5d4010016d3 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
f599d8c0e65782938a1fb31d40720f31c9f0acb4fa7a34b3dd732dc0ead211447e8f9d153dd527471acea0508bdf625056a2128ab43f247080068bc54b711e85 0007-Enable-Wtrampolines-by-default.patch
|
||||
2a1f0c8f1a956e63aa4f61154a883aa510d619d5c5e3acedac2b19d0996d97e35f30e47fa7dca90f24fc8b6133860c91b43379afcf57fcf677c3490e7320cf2f 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
140cbba61b82069d153416be4b0ac6164280f2a8f9c96f122175dba0c1ba6ea7aaba3c32db38e580c1caed4a94d4f2a22972f021ca82c3a609b8287f53d40a23 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
39bad14674b741e4745b6e1a6e3f34af9c37b8b8258cc2b260ac3833e61480aebded0afc33ae45c7c126b4b5debfb01439a02521d4b299781bab0532736f462c 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
ffe5fd575cce27ba84b05a1cc37df8b3f5fa5c879fe4214054b6b441b85df974ac6f56d45eedcdeb81a4aa7db3418977e7acc50b05343ded15049d9d40da4f83 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
07a38d9233f1541cb3ba9c64b1ed8078c37fabeee46c4fb223171416105091cf8ec388b1dc7db4496b2da62c4198534de379e0f99490ff8cfb5cf9e508b0188c 0012-libitm-disable-FORTIFY.patch
|
||||
a42cf4072d23010b55be2d87e8a345dcc9cc09e3a655c8624d231659647d776053381f245a86214d1a11f3bc607248d08881e014d51e3920fb5659656d4b70e6 0013-libgcc_s.patch
|
||||
8b30699003a32f81ab9db6091570ad473e3a7269b2e4a1a1c0381c09031cc360ad8189f4f1cf7805a683e72b190752d5b7667626c5e4d8dd6ccf1741e7c53d6a 0014-nopie.patch
|
||||
cfe8a7a8060022d4210cacdac6a863ca1d9ab0f8e68c93928cace8d5219bb2cea6fa8aa78ec3217df51c44ff0b3814e3a6d5bce22375ff67da749d385e3d3f5d 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
||||
511ab327571ad82f58acf94d9ec40c7b0920a1b163ff1aecce185281fb6121624bf2c1cdc6761bc794601882d0973fffb4664031315f0eab2623acc5ad40621a 0016-dlang-update-zlib-binding.patch
|
||||
49b8d10142e1cd5a01235cab5560d87d32a8c6c4f05e14db521eee1809128b038695e49dc5a61876e35a34845b2241c0169cb58fc0011dab62af2b0e6b185ca5 0017-dlang-use-libucontext-on-mips64.patch
|
||||
b092da7ac532fcb7b931d27eb0175374adb9f4a16e782c4f803af9cf073457b074f0c1fe0065a03f8432f2d422fa4e0ebe760d849d8f614337e33f3f027bb714 0018-dlang-libdruntime-define-fcntl.h-constants-for-mips6.patch
|
||||
6604a8653b660655baa0ed844326f49a6535e12934bc196acadf19fbcb83a37ea455e3a1fc60d529d62a672e5fbe97524b278eaa8fb3e25fb4a6ba362ef9ca91 0019-ada-fix-shared-linking.patch
|
||||
37b534d4c9fbc340e5df790e85b8997986db100fd86ea1b27b912ef5fd0ce5f6b248e468ffbd03e0a543906f57dcffe33d3975c63dcda95efac6713ed03c1606 0020-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
1c8be5fa094ad499a021e983d9f29a9e4375e03e0633c789aebc0ee7af0d33c4a1ac952257e3a807f17b7393d110657bd149459e0526a56b4f6380e09d3c4eec 0021-add-fortify-headers-paths.patch
|
||||
ba1d19e92e85551d8581a9eef6c103e1aee2ed47af8f6261d1c26c5d26b7a4b94cc98a6a22936f0d6ef868f3ebf77ed9cb5e8f3147a33c7270810084c47e22a7 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
d1aa039a04a69a2b08ec44a54541c90b66be6b19d24a1060c587ec72e40adb1e8c33e2a5036f8c1f9b43a062c373b094e57f4bbb1225220c1527218661e5d9b6 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
d5468649da2e973bc7ce389dd9797e0b3bb2acf93b3f17e0dcd9cf70b79fb81dc0268d0989693e72821a13376c134c648942cad6b8633f6615ac57573153e879 0024-mips64-disable-multilib-support.patch
|
||||
198a369b7bc67431cd11b3bc179a97349640864b3397d09932002ccea9e3c06cdd93671587ec43cf59aef66fc42649afb2939e08fa0d7354accd3554ede21dd7 0025-aarch64-disable-multilib-support.patch
|
||||
967b238f8740c6622613645a04415e7fd1a366fe46252ba49271be59b1396eb8ab73211516fda51c2b71f306b195e5527e065a58ef34f14984dbecacae38981c 0026-s390x-disable-multilib-support.patch
|
||||
7fff62eda6c6b0214825cb2ca29e5f8957b5b3fafdd3e3c2d1ab9036d0d1a62e002b8fca2db750152593ff08aba15ecf281f5a8b1aee662107969f0fd07de3a1 0027-ppc64-le-disable-multilib-support.patch
|
||||
ee883dd8775eaaf486cb926ec301d53a89043074917afb84fe2d639ff7fa5bb0497c204509f447f9920ddb09dcd73c179056b3790a13b145cc46dff451484b36 0028-x86_64-disable-multilib-support.patch
|
||||
b1ab2f7a6bbf659b0b37eec3bfbf1f85e017ca1d4382816ce8f0c6db6c3a5328c9ace8ca4c1716e715d6d076eb5e9e3bd6212299ddae7a13776f93dfc26ff1cc 0029-riscv-disable-multilib-support.patch
|
||||
1990d2e5d38f338b7beb888490cacfb0020a9c836402400f6b828341f946ff65bdc77b872f470fdfeaaff3e933396baace3233d3bf21fad76f999c0ce916d8f5 0030-always-build-libgcc_eh.a.patch
|
||||
0e7db3d9ab218122beecf663fe2cef236ca02538bc465f002a3fbde295d2d90e75b6b95942cd9018f72a466ecf149fa6d785999c75862d409ba10f6dce5a969a 0031-ada-libgnarl-compatibility-for-musl.patch
|
||||
1c4cdbecffa8a46b5fc21b886a03c8d7447d90b0c44f13438f431b02f66583894166c4798df9d71c45006df43d3808748f52be18317197eab629b7630cdbe5ec 0032-ada-musl-support-fixes.patch
|
||||
bb0f762bbfde7f38d1e82b2a443e3b8e662460bbe797f6260e51172d12a32c502d7b98c5d738f36da16d47a38bc739231fd5a76222159f5c50c034929da5b6e3 0033-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
||||
fe5817651c3a1d981da6e4f34302d9345db5dcfe4e48feb1ef303620ab4f145ac758c80e40ec4ed442c445d6a1b087d175fa16d0e88c419aaa7e627cd884e369 0034-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
|
||||
61225c94843c8fc89cdc84c4e04e9c5f3c113e3ec893d2e4be2935697851a29501cb8a2c8272a7ebe3b5fce110b061579b58439dfcb40a85224eba0f53ab082b 0035-gcc-go-signal-34-is-special-on-musl-libc.patch
|
||||
b4898ff728edef81b7553aa619ce4036256abad907e7c3e00b027a7552cd84fd79048021d29bfaa18a4f75b73f6207e4da63e010d01eb906f6db12cfdd88cb67 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
||||
715e21327c3264f81503116a86a8f725590e58be3249632d4e4c7f81ee3e82c86ec2745329acf8f413c234fc8b3a0e0a02cbfe6d0ea625486caaa3cc8a93951f 0037-gcc-go-link-to-libucontext.patch
|
||||
2e7588d07594e7e84e797bcdf2d6983c6f33a4303374643d23b56d595160c61d8777495c52a3739d99bd50b7b8c06749f1462dbc05a4076b23a4344438ce887e 0038-Use-generic-errstr.go-implementation-on-musl.patch
|
||||
766aa0b11ff8270ee5850ae4167bc2b84ec2c98d8f68e8e0f2a474f2ac27c3b45c7208afbe4d2051a526691107ec00d8258264d40cf5fc086ad40f63acd5630d 0039-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||
7f79cd3bc3b345ad8b5d3d9494db285d5d1da57f4c1fb1f57aafe21d9a2f9c091ec1da9a64550d6bf7473f92adf7d249dfdb255c31f54ef2d0829b47e854d471 0040-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||
f5b20eef9db3a60a7a0f3214a92fdd5ab7a158ce7d36bfef002a469d39f1fedc1531250bde80d56c640066a22145ca0707f4b2ae779d19e18954db1cf45102cd 0041-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||
ecb6a3836226fc43e72cee0fe1d59dcdc435e0eaf66378e31d1b6e8109572674c553a954a3409d733fea213ceb9dde8804b97f5802d1f5bc6c8f89c19f81558f 0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
|
||||
9e6a5942b9b23df83aa453fa1440a3c90861f4760c8fb0481d24efa9c68c9bdf6bfc211877000221a7c663a907f01d26ce0798825b6bc0b82c1549279144e223 0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
|
||||
e9cd07f298fff1539e835b7cf440c17acf5fbe2ab4b468e645634e0005bdc45992b25de41d5766a9884beeceb8e92231f5e93967c801e96442327db6d4e6f987 0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||
2776ffba938a293c7589483684a2c75991fb500918899c2853efa61a7e8295a5dcd192085730c835c6fd51afcee4d84d8c4883ba71230a8d4ceb65691940e13a 0045-Disable-fsplit-stack-support-on-non-glibc-targets.patch
|
||||
51edccd279c70628d8b34db74e2667de75482ed659f1a5f57407f433af89163d9b6b47986467a59d534e2177f872e5de90c95ede1dc8f1b2829fbe57590d8f4d 0046-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
|
||||
43b67d2970dcf65d90149ff2ea4f7264f7e01267f3152b0a244850e4f8a6e43da117015dc75dfd30c6428f7088d3cf4b6703f8735f0430959f128ce53de0b821 0047-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
94d4d2e31f5a84455055d34cfbbcc63d5bd63e60345c2a4e30aa404724e65e5d14868ef50b7fcf5537dd12dc6f1381a27cede269801050e193b4bdb8f2919971 gcc-11.2.1_git20220219.tar.xz
|
||||
d46a87edb919697a37c15af99c9142c6ad8ec364fe9b5747f5808368e619766163d3d8b64e987b1155785ddc91b5b191b795857cd70118d64f978e46b476bfff 0001-posix_memalign.patch
|
||||
59fa772417c1d1baf8bd8477ef4e30975fbd616d949fbd72fa88cc72d9662f2e28214305a188d75e30c54a95be111c7998784f7d1499562490acbe194a3c2116 0002-gcc-poison-system-directories.patch
|
||||
556240f9888c24706694560ad3ba1a90d3ed6da1dd3d7eebb603f4e3551d5743908840d4b1f598d6d5dc3cc52bcfafbcd777282ec8864051c3c8aba623866d3e 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||
747a2ba2c0227471dd8a327bddd4699aa6aad5ddce2e523816e43e04fd5a4d8c2f1a69f02980632263ab1c23334d01e27d5df737a0ba9f6bd16b9c85112de82a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
0fe2b802ce0b9c986d7ea5378df49899b028baad419ccd4071fd1a2dad90736e0f04eef29056f6c74c1fa2482359629b5e3747d58fcbf3520c6ed10c66c7b87e 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
7d37f31108cddfeb25ebf7e462d999873dc184bb26f74c9d7d6d32534a15070291661ab58be41ccedb44af20de0568e704b4152668c6bd803cf88f1ddfb6e35c 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
698893670d00df1ddbaa7dd970b17049f94d0cc2fec3225925bbad606e44c29288e38a7afa4b4cae3c9c26be35646c52e9eadc67022b89d7b4ce97ce64a5a2ac 0007-Enable-Wtrampolines-by-default.patch
|
||||
b549d45824d6b9f2ec830ed66ba192ebfe9d9c3db554bf0b51379e9b624de0f0a1a315520487a1a3bfbe9d65d41c41239b9461bc9f1b5059c51d5f4dc7581872 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
15089ea9465057f6897d5c570e79abd068b85f9fc77490668872397699025905aa065eaf7318ddb0847747da4397676242064f290b45e16f616bab86258be260 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
cc9aa31e3b4227f7887d9be470bb19cb3ccd8125155741721921b4c8f791710fabc279b492232454fda0a47bf98509bd2fd4bcdbf5a5aad8b8f476bc5aa74d07 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
c2c74411717e5bf6e261bde4d5c50b12645de2d556b3eb898600e7629772f7d9d213e32f5a0b81d8ee2ba2e4bc55ea64ee60119d9d9a03045574016d94b76f61 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
d92fe356d745fbc858cbb338b0027b814a2f7812fc7bb6147d641e7319d4ff09ac4ade766b419566e70e6250847ec56e95fd74617a82069dc93f669d827dd48e 0012-libitm-disable-FORTIFY.patch
|
||||
2e5c0845581c92573fc2e60f7771d9f99e23fd32bf4da7c09bc1738f69174f8becfe9f0c9ee96fbc87b3264dcf2d4b801d051606bd528b43e76cd1fb9ddf6b40 0013-libgcc_s.patch
|
||||
2a79fd03fe9b98cca3cdbed368969304f9ebcedb7701703740c30a1fe70bfdeceaddac4cbf796f60ee080f0d62a926da6c48042c563b081d9116691c4531a68c 0014-nopie.patch
|
||||
4a1d53c120047702ea51df3c611af3e4ae82b9cf63dc8244ac38042de44b24afe98578e70aa964884b22ef76ee65d1d703355defc613637acf52d580ce86f17c 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
||||
64065ec9243eb12424cb75822219376e7829f1e1d206d93c4b4cbe18eb4e538019361cc1b5b7d88da4d2d5c891d9e282d579902db534d09b7d58ec91bfada6b5 0016-dlang-update-zlib-binding.patch
|
||||
35ffecaa8ec56b64c73df93530d858632f0429de007d70869432c183610d344711a1552b1bb00f2180ae952c66a66e1c6285139a8818d656691a121cd7abdba7 0017-dlang-use-libucontext-on-mips64.patch
|
||||
f78fc1bc99669a90bd68051f9d17bfc25065e49c7d4e853cda293be3a9f17b08867de31e73b90a82b948005f5e17020ccf55dfa4a1b0b9b0cba707c0ed635a46 0018-dlang-libdruntime-define-fcntl.h-constants-for-mips6.patch
|
||||
463ce54bb32d9ba52ed7f0d7df99011f17543e80f6aca9a61b747e074662b283c563434b96a0bc8ae4636e154f1033c5720f3c8113bc6ad095592a1d5584981c 0019-ada-fix-shared-linking.patch
|
||||
194647e5a87fb7ebd7602eee9ffa5d3e713dc26baa5f8fa50ada513ca5d28898d1fcee5e9db0d3af6d5b774961426fc1e2f9b5155992ead9981412c627967219 0020-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
d707e47a10c866c0e6d085f9a2bfa1b21eff8e6a1b222840abbbe1b2f21cc4a50f4fa45f7dbbb1ad86dc2eb7c88160c715e69039d3de7f7784de7d5f2a87d6e4 0021-add-fortify-headers-paths.patch
|
||||
e746e250451eb76726a9de8f42de5eb1d23a228fd3d8961cd2a6c6f691a5418fcd32a817998e3a5aaf8d2d90cd03371aaf7912c9b834ed6c663c649f85f1d058 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
c6d3a4b5d541b52f44641e59556c6312d785c4e12d47fac11a530ae0746170e891c0ed64ce6e9856e5581debfae0d5216753afaf87df1a2d40d50bdfa24ea7dc 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
a29ad877662bbdbc6422456d32ed31aab3764edcc1eb3e1abe7be0f22d162da6d0f0d6565a25c7a43bf23151faba0492122ddcf832bdac57b3e47f89a6ab158d 0024-mips64-disable-multilib-support.patch
|
||||
18be870ec68865f4661ac73f9bf50765164711582b497beb852928e1d993bc257a0d2b015f435e93461c35edc1811505d31f3a46147bccb4764dcf9b8319c93a 0025-aarch64-disable-multilib-support.patch
|
||||
b2b830626396936be105361e87c82490b5cd3d26ce7b8dbccf156d53eb5d0db82a28167656aaa5e47b6a1315263abf070432db693c5ae10da892217ce2728728 0026-s390x-disable-multilib-support.patch
|
||||
094ed675ff5512829bbf7f2bd2632498300b7f15cec6b4a397b145f378a41c17c99f05ea0b94ed1408773a3e8b1fd713ba302c64dba00269df270d401b0e6443 0027-ppc64-le-disable-multilib-support.patch
|
||||
ee67238c66132f30fd00cc084d37012a927abe32ac48b4617779f22069d86384826c063b79626ab64f6adefdac0f00fcd5c18b95c8a2f11fb2cbee67babc9beb 0028-x86_64-disable-multilib-support.patch
|
||||
2ddf60a03db15c9c3e847001e300a54dfd9b5435da630e18379313e516fccbb8ea5e26571bb4f88baa6756cdb5c8ba7d059249c46a2f56e67bfca368750431eb 0029-riscv-disable-multilib-support.patch
|
||||
e7f9088809a4a4b87a6a5670227fb31766fb124ecdcea9936b00a7b98fdc06d7e7f27b6f67a575c434ba978623cb5f1183691dd63d6db98b180c4e08d62e5c5e 0030-always-build-libgcc_eh.a.patch
|
||||
653b2dbdf43ad336e75aa33ee3e520edd4c8cdb486bf8f5a30dbd8496b96451aa508e12e6a81dd16d36119f22fb9b0c46bcc39d731c89443c435fa4d1ca6fa08 0031-ada-libgnarl-compatibility-for-musl.patch
|
||||
9d46489087018366eea3b6537f6a86b0e183c7d49f8fecc2f50fbbcebf78727f5a1661ee6a50b5bddef0d54ebe47668ad61440784495194420b0896d5bd3f1aa 0032-ada-musl-support-fixes.patch
|
||||
63a2f9a81f94826dfac05073d6b7cb599c5b1d026c460edfd329f770c72208e369af1e427904528351aa78bce6e9445af9c59ca73ef5302f7362027757fa5d46 0033-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
||||
8d3a01d7e5e983eaabdf5c4a7e58ef33c55a794ed4cb5d438b41218ded367d3214b868a5c8d68f52ef74b0f83abb95d29b36ef8d0c7be68f7d1537a04e65d5c1 0034-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
|
||||
56c7c1911fef05beaecfa1b41703d46d18c5e967430c79c719f8685f4c4971bb177f2de35b0a1631d5d3ed7292cb54c618e52fa859f483fafb5445511e5b226b 0035-gcc-go-signal-34-is-special-on-musl-libc.patch
|
||||
07921d5c30f3a23ba1c0540e106abe49e1675f183ffe2b326bdab80c59847b9ed5f39efd2836bc47d4ac1b3a3152f8de092c498ba91682e51c20548a65c0f105 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
||||
ef8df8a047b4145f30884b052345e4e390fc1efb35a9c7da63899aa115c19b8cc04513a57b2340a6a58ed02dc6881b10f684da653734afe5acf69761e3d064e7 0037-gcc-go-link-to-libucontext.patch
|
||||
cf000459b493815bb0c9bccbbccc61ab8101f067b5b45d0f30cf49bf0ec6745f6ae360e4b5dccdb5c9bef1974835830efbb349c2ab38d1ee4dcc22385546873b 0038-Use-generic-errstr.go-implementation-on-musl.patch
|
||||
0baffb0d19c26a387d38525c87b3500c4486bf11aeb9d98cec559eb67db4b71d5bc580fa6aebb9a12295422edb53aea77101e521e91f5189c744749448b89b4a 0039-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||
d80074e1fa09cf6f7047a4dac7acadcfb53fcc93667af3348c61b22390999d618f2b16107c30a0fc52b145e27f14d6fddbe43ea36e6a9089741cb3b0b64fd856 0040-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||
04434b605d71b6d4e9dedd03a810f250725d31fc70a5ad28d69499a04436caf6b0ec69f5c7223cb511063cc18c350ffdd95b722de97467f827789006ebcb2c73 0041-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||
a3dc43ba56f12f4243c186572b32809d47a9d29c7a40edcf7f6da34c7add65a271c77635a5b9ae325d167e24a2e6bbe883c63eccec3af5d6f925cb304f8ba92b 0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
|
||||
04ebbf2143a2d4b6c6d768c3aeea2899e6261adf414e16faed1247bc94eeaf61e54f88a2ba7ffdca90e9c0ee87c6fd7e3746481d184c539b8e0130a14b215fa7 0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
|
||||
e47183b5a565bdc64a497e14124d767a3e889e9f9d77a92567b0047b285c5ca49897b46ba681e339a8982611b70583ae87a3472dae33f07becaeceb21b3cfe74 0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||
a5adab61de2d4b2c3ccb1a55c70384a8496c447f7727a6680fa29263c4f57599a3dfb85e1e322859797f86605491af0f68f9dd1141ab4bbbe8b5183f67f3b32e 0045-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
|
||||
9c0e461eeba709110ca88d60236190c9b71d57d4e13786e2f15521a902e37dacc08d466966764abce9bc84e27d06e2e8523a1a80325f8a16d6ec16d2bf89fa05 0046-Disable-fsplit-stack-support-on-non-glibc-targets.patch
|
||||
f62778ab53125a9ba5a8088e064c2182c014bc264a46fd3d28d1ee0142dd02a7ed2c684dc63e9768a56a6f8f65621bea20026cd6b65053c2ff9ee51568ee260d 0047-x86-Properly-disable-fsplit-stack-support-on-non-gli.patch
|
||||
c44c6e5b28b622897af60e7e2dbf0d0284379eb57b39b480936e6d8b3743a24287c2a9ed69a530ef4f2327b5e5ca61ce00e92d415e0ed033e54bdffde345e6a9 0048-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
160ef16fde90546474e1548f1487c18d9b8edbae1d42a13ad06041b03214d06ff2c3586acd4d0bae27d48e48bb651861c6b9a140ade4ac59f00a268e85275da4 0049-properly-disable-fsplit-stack-on-non-glibc-targets-P.patch
|
||||
f4d9ebf6d5c80d2f303404b9bf315bf81435c0d369b03b92f8e8510d82db72c2a30d84603307ddc0697df3845862ba93045e4a3724f8e491e7c01bd4396d8864 0050-x86-Fix-fsplit-stack-feature-detection-via-TARGET_CA.patch
|
||||
8ac54b3a46f7270d975fa3e1198ac37a2311a4b9940938958ffc148e4e9c82c3e81cf3e3c3abd43cef29137897cd6768220b432f828672e036308f7994422d2e 0051-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||
fa59b0fb081d97f8f63506b8793699588a95c602b5d468140eb1e80456597e52e1cc45dc0b234ac8e60e2b0cd606d94d111c8b0ae64c0a2be1bc1b8a184ceb93 libgo-musl-1.2.3.patch
|
||||
"
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
|
||||
index 6fef104..06289a4 100755
|
||||
--- a/libgo/mksysinfo.sh
|
||||
+++ b/libgo/mksysinfo.sh
|
||||
@@ -126,7 +126,7 @@ if ! grep '^const SIGCLD ' ${OUT} >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
# The syscall numbers. We force the names to upper case.
|
||||
-grep '^const _SYS_' gen-sysinfo.go | \
|
||||
+grep '^const _SYS_[a-z]' gen-sysinfo.go | \
|
||||
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
|
||||
while read sys; do
|
||||
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
@@ -1,42 +0,0 @@
|
||||
From e289226f5f16db14ca549efb41ca82accfe7ea8a 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 1b0bfe37852..d7b2b19bb3c 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.34.1
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
From 48be81c9accb55c3c5ee683c84fa1f908bb18764 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 a75b44ee47e..d15105a73f3 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -683,6 +683,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 2de5a463315..059c818c895 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -218,6 +218,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 708328e1670..4b977e313b5 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -1020,6 +1020,7 @@ enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_link_serialization
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1782,6 +1783,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
|
||||
@@ -31790,6 +31793,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 df1c9cc3200..5461bab88a9 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7311,6 +7311,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 5a4b3c6c234..9d1126e9751 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -369,6 +369,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
|
||||
@@ -7727,6 +7728,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 8ba410c9e17..a83ba34ac4b 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1152,6 +1152,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 446d280321d..fbfc0ce03b8 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. */
|
||||
@@ -395,6 +396,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.34.1
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From 767b97ca271e82601a435015190fd15bfb28ae12 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
||||
Subject: [PATCH] specs: turn on -Wl,-z,now by default
|
||||
|
||||
Previously, we also used to turn on -z relro here, but we now build
|
||||
binutils with --enable-relro, which is functionally equivalent.
|
||||
|
||||
Binutils does not appear to have a similar option for enabling -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 9d1126e9751..4b8335bbd1f 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -15920,6 +15920,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,now} is used. To disable, use @option{-Wl,-z,nonow}.
|
||||
+
|
||||
@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 a83ba34ac4b..faf9ce76b3d 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1150,6 +1150,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 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.34.1
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From b8abbd503d1be992bf1d204f0e6de5260fcdf533 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 9f993c4aff2..7db314195ff 100644
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -1421,6 +1421,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 4b8335bbd1f..833164e0a2b 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -10224,6 +10224,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.34.1
|
||||
|
||||
@@ -1,272 +0,0 @@
|
||||
From 1837896f54bd318788c1ba6dbd19c3efe147ba20 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 7f2529a2a1d..b097e1688aa 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 c1dae8ca2cf..a87dc740171 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 0c1c4e70b6b..8b581afacdd 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 5ebbf42a13d..902378e1bad 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -136,7 +136,7 @@ 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 LIBHWASAN_EARLY_SPEC
|
||||
#define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
|
||||
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#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 a23e7ab3eb7..12ac8cb93a9 100644
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -68,7 +68,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 f3e25b1412a..712b0f1c30e 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 ac40c3dfd3f..6e19e25c35a 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 a390bcece83..be0ee289367 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 fce5b896e6e..ee29979dd34 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 DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
|
||||
%{mno-relax:--no-relax} \
|
||||
%{mbig-endian:-EB} \
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index e3f2cd254f6..43499ed29cf 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -374,13 +374,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 510abe169c5..3c1f3a8ec5d 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 daa48fdfc2b..2fcfc5d770f 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 2550d7ee8f0..7596d0b2757 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 faf9ce76b3d..1ad5da6d769 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -737,8 +737,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
|
||||
@@ -773,8 +776,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
|
||||
@@ -791,8 +797,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
|
||||
@@ -807,8 +816,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.34.1
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
From 1ba693868db68bef5178fd797c9e7d2cc4128182 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 2005b783c68..c5c6af427cc 100644
|
||||
--- a/gcc/c-family/c.opt
|
||||
+++ b/gcc/c-family/c.opt
|
||||
@@ -637,7 +637,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
|
||||
@@ -658,7 +658,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.34.1
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From eb2f1f7d7c503959279a7317af7b9a7625eecc6e 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 d15105a73f3..29f9504cb68 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -775,7 +775,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.34.1
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From 7a4086e83e3abbf2c20b7211e2a2c0bf00f25ff8 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 1ad5da6d769..99314032ec2 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -989,6 +989,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" \
|
||||
@@ -1288,7 +1294,7 @@ static const char *cc1_options =
|
||||
%{-version:--version}\
|
||||
%{-help=*:--help=%*}\
|
||||
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%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 8ba281b4cfa..bab39cdf8a2 100644
|
||||
--- a/gcc/params.opt
|
||||
+++ b/gcc/params.opt
|
||||
@@ -946,7 +946,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.34.1
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From 1c38cbf1f75066c3acc145f449f1fbd0b5de7968 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 ab716ff04ea..e595268d9fc 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 8edd2e05639..63f61fcf96f 100644
|
||||
--- a/libstdc++-v3/po/Makefile.in
|
||||
+++ b/libstdc++-v3/po/Makefile.in
|
||||
@@ -553,6 +553,7 @@ uninstall-am:
|
||||
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From e4c844ce0c1c355c2d1cf6a6e1595030b8ce2a5e 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 f4c0fe11d6f..cf4b1043e4d 100644
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
|
||||
/* 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.34.1
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From 79309ae34db26104ec85f6af31a4a8133142fe6d 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 4f1213b983b..d0224649d30 100644
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -264,6 +264,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.34.1
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From fdf5ef3d1e61625cb96647d5bdc4ca0a32d287ec 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 a3d84896cc5..ecb281d5919 100644
|
||||
--- a/libitm/configure.tgt
|
||||
+++ b/libitm/configure.tgt
|
||||
@@ -47,6 +47,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.34.1
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
From 9442d683845f63b931374ff81a7d08a31f992135 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 16765718cc3..4a855b791b9 100644
|
||||
--- a/gcc/config/i386/i386-expand.c
|
||||
+++ b/gcc/config/i386/i386-expand.c
|
||||
@@ -11063,10 +11063,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 ef463848f9d..1a3de052c80 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
|
||||
__cpu_features2);
|
||||
}
|
||||
|
||||
-#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.34.1
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
From 7a3e354de1ab87e992bfdaf858677ca140b80732 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 4b977e313b5..592e81e40f6 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -32300,6 +32300,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 5461bab88a9..1577529ffb7 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7571,6 +7571,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.34.1
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 9a5417a787c2ba197c0a3002ea7423488bedab0a 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.34.1
|
||||
|
||||
@@ -1,425 +0,0 @@
|
||||
From ecc537cc597fba87f00d3128fddd5f2a17e7d222 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.34.1
|
||||
|
||||
Loaded 100 of 3730 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user