Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54d94a28ad | ||
|
|
2f58606447 | ||
|
|
93ad6d91d6 | ||
|
|
a6491c6261 | ||
|
|
083d9dd5bf | ||
|
|
2e302b27ce | ||
|
|
a8daefb6f7 | ||
|
|
227e75a584 | ||
|
|
d1bb34d5ea | ||
|
|
4091828042 | ||
|
|
f2a7a469f0 | ||
|
|
18a927063d | ||
|
|
94c26cc1da | ||
|
|
2a168992db | ||
|
|
500c2c2a3f | ||
|
|
b1c9480b5d | ||
|
|
77142727d5 | ||
|
|
cb095c1009 | ||
|
|
af927b2bd5 | ||
|
|
92edc1bcce | ||
|
|
bc0c95b0ba | ||
|
|
c292d7e023 | ||
|
|
ba39be1cbb | ||
|
|
6c49176686 | ||
|
|
5c5735a0e8 | ||
|
|
2031f7056a | ||
|
|
0c7501844f | ||
|
|
b25d9ec485 | ||
|
|
cd6a3bb2e1 | ||
|
|
cd5239778b | ||
|
|
63fd2bb579 | ||
|
|
65e01ae411 | ||
|
|
d4b6e60e0c | ||
|
|
db4b216343 | ||
|
|
93c8f4129b | ||
|
|
46a8a23b9e | ||
|
|
f4b9ea4cde | ||
|
|
9ccfcbcfd9 | ||
|
|
7842b44979 | ||
|
|
7c1771b29a | ||
|
|
f0cca1b32e | ||
|
|
800d4ca064 | ||
|
|
8352814a05 | ||
|
|
bc275e47b1 | ||
|
|
fb3ab8e7cb | ||
|
|
a41c671b4b | ||
|
|
c60e00f1f0 | ||
|
|
98d485f738 | ||
|
|
d7e5388396 | ||
|
|
bfd5e53eba | ||
|
|
45be343e07 | ||
|
|
70caeac647 | ||
|
|
4c3e2d264c | ||
|
|
e2d345b624 | ||
|
|
c9349f0605 | ||
|
|
146aa73de5 | ||
|
|
9a8cc6836a | ||
|
|
162ac55019 | ||
|
|
58e951a1bb | ||
|
|
ce57516757 | ||
|
|
2cbde0daf2 | ||
|
|
4670cae1dd | ||
|
|
f48e2709b4 | ||
|
|
cc76e044a4 | ||
|
|
c227d28173 | ||
|
|
4622b5ec6b | ||
|
|
8e7853c14d | ||
|
|
2ac5e8f90a | ||
|
|
4a6bb34e86 | ||
|
|
c7a80bf667 | ||
|
|
631a37a814 | ||
|
|
e28e6c1270 | ||
|
|
7c1bf8f52b | ||
|
|
9e9700e8a9 | ||
|
|
3e5779b378 | ||
|
|
a506883463 | ||
|
|
a23b660620 | ||
|
|
df16808825 | ||
|
|
02b422296e | ||
|
|
6ab8903bef | ||
|
|
0b1dc55ab5 | ||
|
|
1cf4803c60 | ||
|
|
86a34811d4 | ||
|
|
d4bd9b9c15 | ||
|
|
e65318f7dd | ||
|
|
1a9fc14b52 | ||
|
|
0520275b7c | ||
|
|
4cbc71ca7a | ||
|
|
264ab9e638 | ||
|
|
3d7ef2e389 | ||
|
|
f2cd5f3db4 | ||
|
|
ad53487a79 | ||
|
|
fd3e56bbf4 | ||
|
|
1f47e97574 | ||
|
|
f62c768c84 | ||
|
|
d08764999c | ||
|
|
0ba7df11ad | ||
|
|
71deb1c26f | ||
|
|
275f8694af | ||
|
|
1d1895c0e8 | ||
|
|
b394879408 | ||
|
|
c39d814103 | ||
|
|
8e2a6e3a3f | ||
|
|
4227ad38a6 | ||
|
|
6ba9532d0b | ||
|
|
d06adbe1f3 | ||
|
|
4d74ad1f51 | ||
|
|
c937dcc06d | ||
|
|
36f32032e2 | ||
|
|
74d586b0f4 | ||
|
|
836a44ca6d | ||
|
|
7feb46f8ab | ||
|
|
72f2362a31 | ||
|
|
a313b703bb | ||
|
|
d99387032f | ||
|
|
dcc35c49e1 | ||
|
|
d0ee389e77 | ||
|
|
d2a855dd85 | ||
|
|
fb494c88c4 | ||
|
|
ac0ee64c31 | ||
|
|
194d9c0010 | ||
|
|
75c430cf9b | ||
|
|
ebea7af6c4 | ||
|
|
468bc8a84e | ||
|
|
6b6bd979ea | ||
|
|
17fa587815 | ||
|
|
0dab1e636d | ||
|
|
ca70996603 | ||
|
|
23989c3a5b | ||
|
|
8d95279325 | ||
|
|
8d659ba0d9 | ||
|
|
ae413af003 | ||
|
|
66a3ceacb9 | ||
|
|
cf8ad3bdf5 | ||
|
|
57fdbda072 | ||
|
|
2f6530a6f1 | ||
|
|
18b33877a9 | ||
|
|
084f024c4c | ||
|
|
f337ef4e1c | ||
|
|
254c4ad434 | ||
|
|
ec23a657b5 | ||
|
|
d42286c08d | ||
|
|
ecbe3abfaa | ||
|
|
f89f5cebd4 | ||
|
|
9fc14d21aa | ||
|
|
b59c638d5a | ||
|
|
a6eae55e82 | ||
|
|
a6da8fb2db | ||
|
|
d8ce78b462 | ||
|
|
aaa3c4c6c6 | ||
|
|
3506c41032 | ||
|
|
142d79d889 | ||
|
|
97d5041cea | ||
|
|
190877d6cb | ||
|
|
dec474dc97 | ||
|
|
066f19ac21 | ||
|
|
aaf133ab15 | ||
|
|
7b18e24238 | ||
|
|
f03d7a6948 | ||
|
|
772ae5dda5 | ||
|
|
677b2900b2 | ||
|
|
c6913666ae | ||
|
|
05bd81cf9b | ||
|
|
aab032e6aa | ||
|
|
3fe62bfa34 | ||
|
|
ae7abe75ab | ||
|
|
8ace569db0 | ||
|
|
bb40afc0dd | ||
|
|
1e6bdb3ef6 | ||
|
|
8b821594fa | ||
|
|
0d53ad9328 | ||
|
|
402355e51e | ||
|
|
44124b3cab | ||
|
|
b66064edaf | ||
|
|
b9c874774f | ||
|
|
164efeb854 | ||
|
|
332f855a93 | ||
|
|
163a42effc | ||
|
|
cf3153eb5b | ||
|
|
6823479b18 | ||
|
|
c5f26eeb65 | ||
|
|
3c868bc254 | ||
|
|
a09d92d8c2 | ||
|
|
5ad58ff0be | ||
|
|
28365e0978 | ||
|
|
6ad46e30ed | ||
|
|
2491984432 | ||
|
|
f3c6247f43 | ||
|
|
00f73eeff4 | ||
|
|
59a374f6f9 | ||
|
|
b917f76531 | ||
|
|
11da9f51f9 | ||
|
|
cc95140b96 | ||
|
|
acc021adcd | ||
|
|
472ab0b435 | ||
|
|
b25292607a | ||
|
|
47849bdca4 | ||
|
|
e446bb9741 | ||
|
|
2e71c343cb | ||
|
|
4753cf3540 | ||
|
|
3f932b85ae | ||
|
|
a8336387d6 | ||
|
|
7452c1afa9 | ||
|
|
b99636ef97 | ||
|
|
29ddfe49a5 | ||
|
|
e98f7ed18a | ||
|
|
1780b0c755 | ||
|
|
1016a2c137 | ||
|
|
8c5e5f0089 | ||
|
|
5199c9f337 | ||
|
|
cb0a04988e | ||
|
|
2766f8b3f3 | ||
|
|
916f5df5b1 | ||
|
|
6e9a8456b2 | ||
|
|
378db3273a | ||
|
|
fe3a8d8303 | ||
|
|
45a9f64691 | ||
|
|
df1224a7b1 | ||
|
|
0a950e8a0a | ||
|
|
bc1e8288d2 | ||
|
|
8f3fd3a5f4 | ||
|
|
95093eb1d7 | ||
|
|
acf2331c95 | ||
|
|
cbe0a0bef2 | ||
|
|
333bca33d5 | ||
|
|
1df4264d19 | ||
|
|
4ffe52b874 | ||
|
|
4bfb9c049d | ||
|
|
87d96df264 | ||
|
|
daf57f7e9e | ||
|
|
f577bfbcff | ||
|
|
47957f223d | ||
|
|
3d600b0210 | ||
|
|
6d0f6f8c7a | ||
|
|
c095935351 | ||
|
|
7f72ef9c3f | ||
|
|
9ffe49be97 | ||
|
|
045fc69f74 | ||
|
|
df33857021 | ||
|
|
5eab0792bd | ||
|
|
18ba5a8cdb | ||
|
|
e8ba30763f | ||
|
|
09eee6b115 | ||
|
|
f75d0c9b71 | ||
|
|
f33935a033 | ||
|
|
3105f126f2 | ||
|
|
1765dac445 | ||
|
|
e97b944b1a | ||
|
|
48056a0ebf | ||
|
|
72d1ecf880 | ||
|
|
b078a67f78 | ||
|
|
b91f81712b | ||
|
|
3006ac5a0d | ||
|
|
c80b2791ff | ||
|
|
3da51fe777 | ||
|
|
2e2a12d14e | ||
|
|
b88df955bd | ||
|
|
78d4e4b895 | ||
|
|
5e4fa95d1e | ||
|
|
b5fcc3afb8 | ||
|
|
f3c1570dd3 | ||
|
|
8cfa41c971 | ||
|
|
19f075664b | ||
|
|
9f0ca81da6 | ||
|
|
470101358c | ||
|
|
e8bd4e4d1e | ||
|
|
f092bb64ed | ||
|
|
1c64dfe120 | ||
|
|
dc09126241 | ||
|
|
efd71386d3 | ||
|
|
d9fea2af81 | ||
|
|
3c5789200a | ||
|
|
284b02c3ba | ||
|
|
3db21d5852 | ||
|
|
5d10a2d66b | ||
|
|
9013626904 | ||
|
|
a07e273007 | ||
|
|
c7c52d89bb | ||
|
|
528d62883e | ||
|
|
3b6f950e3d | ||
|
|
1df6f9d3d0 | ||
|
|
8ec2760445 | ||
|
|
dbd4670271 | ||
|
|
9d5d8167f4 | ||
|
|
aac67acb87 | ||
|
|
09490e3fef | ||
|
|
e8e0c2a550 | ||
|
|
b65c71f2ea | ||
|
|
443ba0d367 | ||
|
|
93440ecb1f | ||
|
|
65c5863827 | ||
|
|
e0e1f2b395 | ||
|
|
c975a3d3e3 | ||
|
|
8e2ccf9594 | ||
|
|
80cd5dcdbc | ||
|
|
da704ea809 | ||
|
|
7a0583e80e | ||
|
|
df75f6f234 | ||
|
|
84fd68c6c8 | ||
|
|
a43f3bbfdd | ||
|
|
ad9e8af2a2 | ||
|
|
856008e1c2 | ||
|
|
b920ec64f2 | ||
|
|
487ac41ed8 | ||
|
|
50604efc0b | ||
|
|
ebb3022898 | ||
|
|
2bd016c459 | ||
|
|
67101ee5d0 | ||
|
|
b9a7135807 | ||
|
|
535c350e55 | ||
|
|
8ecce307b4 | ||
|
|
52257709fb | ||
|
|
8982f37a88 | ||
|
|
fc390510bc | ||
|
|
8785de1747 | ||
|
|
7adc4e1893 | ||
|
|
ae0a051f01 | ||
|
|
b341c1d2f6 | ||
|
|
0be9aa2cad | ||
|
|
d2f4a4eeec |
No files matched your search
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2019 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Config: pmbootstrap tag (or branch)
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
tag="$1"
|
||||
else
|
||||
tag="master"
|
||||
fi
|
||||
|
||||
# Get download URL and pmaports path
|
||||
url="https://gitlab.com/postmarketOS/pmbootstrap/-/archive/$tag/pmbootstrap-$tag.tar.bz2"
|
||||
pmaports="$(cd $(dirname $0)/..; pwd -P)"
|
||||
|
||||
# Set up binfmt_misc
|
||||
echo "Setting-up binfmt_misc"
|
||||
sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
|
||||
# Download pmbootstrap (to /tmp/pmbootstrap)
|
||||
echo "Downloading pmbootstrap ($tag): $url"
|
||||
cd /tmp
|
||||
wget -q -O "pmb.tar.bz2" "$url"
|
||||
tar -xf "pmb.tar.bz2"
|
||||
mv pmbootstrap-* pmbootstrap
|
||||
|
||||
# Install to $PATH and init
|
||||
sudo ln -s /tmp/pmbootstrap/pmbootstrap.py /usr/bin/pmbootstrap
|
||||
echo "Initializing pmbootstrap with aports at '$pmaports'"
|
||||
yes '' | pmbootstrap -q --aports "$pmaports" init
|
||||
+59
-21
@@ -5,8 +5,8 @@ image: alpine:latest
|
||||
after_script:
|
||||
- .gitlab-ci/move_logs.sh $CI_PROJECT_DIR
|
||||
stages:
|
||||
- first
|
||||
- second
|
||||
- lint
|
||||
- build
|
||||
|
||||
# defaults for "only"
|
||||
# We need to run the CI jobs in a "merge request specific context", if CI is
|
||||
@@ -18,13 +18,13 @@ stages:
|
||||
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
|
||||
.only-default: &only-default
|
||||
only:
|
||||
- master
|
||||
- v20.05
|
||||
- merge_requests
|
||||
- tags
|
||||
|
||||
# device documentation
|
||||
wiki:
|
||||
stage: first
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
only:
|
||||
refs:
|
||||
@@ -38,7 +38,7 @@ wiki:
|
||||
|
||||
# testcases linting
|
||||
testcases-linting:
|
||||
stage: first
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
only:
|
||||
refs:
|
||||
@@ -53,7 +53,7 @@ testcases-linting:
|
||||
|
||||
# shellcheck
|
||||
shellcheck:
|
||||
stage: first
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
image: alpine:edge
|
||||
before_script:
|
||||
@@ -64,12 +64,12 @@ shellcheck:
|
||||
|
||||
# aports checks (generic)
|
||||
aports-static:
|
||||
stage: first
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh pytest
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- apk -q add git
|
||||
- su pmos -c ".gitlab-ci/run_testcases.sh"
|
||||
- su pmos -c ".gitlab-ci/check_changed_aports_versions.py"
|
||||
artifacts:
|
||||
@@ -80,48 +80,86 @@ aports-static:
|
||||
- pmbootstrap.cfg
|
||||
expire_in: 1 week
|
||||
|
||||
distfile-check:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- apk -q add make findutils
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/archive/master/ci-common-master.tar.bz2"
|
||||
- tar -xf ci-common-master.tar.bz2
|
||||
- mv ci-common-master/distfile-check/*.sh ci-common-master/distfile-check/Makefile .
|
||||
- rm -r ci-common-master ci-common-master.tar.bz2
|
||||
script:
|
||||
- make -j999
|
||||
|
||||
# APKBUILD linting
|
||||
aport-lint:
|
||||
stage: first
|
||||
stage: lint
|
||||
before_script:
|
||||
- apk -q add git atools python3
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh
|
||||
script:
|
||||
- .gitlab-ci/apkbuild-linting.py
|
||||
- su pmos -c ".gitlab-ci/apkbuild-linting.py"
|
||||
only:
|
||||
- merge_requests
|
||||
allow_failure: true
|
||||
|
||||
# kernel kconfig check
|
||||
kernel-kconfig:
|
||||
stage: first
|
||||
stage: lint
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
- v20.05
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
- main/linux-*/config-*
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh pytest
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- su pmos -c "pmbootstrap kconfig check"
|
||||
|
||||
# MR settings
|
||||
# (Checks for "Allow commits from members who can merge to the target branch")
|
||||
mr-settings:
|
||||
stage: first
|
||||
stage: lint
|
||||
only:
|
||||
- merge_requests
|
||||
before_script:
|
||||
- apk -q add python3
|
||||
script:
|
||||
- .gitlab-ci/check_mr_settings.py
|
||||
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
|
||||
- python3 ./check_mr_settings.py
|
||||
|
||||
# build changed aports
|
||||
aports-build:
|
||||
stage: second
|
||||
.build:
|
||||
stage: build
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh git
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh
|
||||
script:
|
||||
- PYTHONUNBUFFERED=1 su pmos -c ".gitlab-ci/build_changed_aports.py"
|
||||
- .gitlab-ci/build.sh
|
||||
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- packages/
|
||||
|
||||
build-x86_64:
|
||||
extends: .build
|
||||
|
||||
# disabled on v20.05
|
||||
# build-x86:
|
||||
# extends: .build
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
|
||||
build-armv7:
|
||||
extends: .build
|
||||
|
||||
# disabled on v20.05
|
||||
# build-armhf:
|
||||
# extends: .build
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import common
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -20,9 +19,10 @@ if __name__ == "__main__":
|
||||
print(f"NOTE: Skipping linting of {apkbuild}")
|
||||
continue
|
||||
|
||||
result = subprocess.run(["apkbuild-lint", apkbuild], capture_output=True)
|
||||
if len(result.stdout) > 0:
|
||||
issues.append([apkbuild, result.stdout.decode("utf-8")])
|
||||
package = os.path.basename(os.path.dirname(apkbuild))
|
||||
result = common.run_pmbootstrap(["-q", "lint", package], output_return=True)
|
||||
if len(result) > 0:
|
||||
issues.append([apkbuild, result])
|
||||
|
||||
if len(issues) > 0:
|
||||
print("Linting issues found:")
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh -e
|
||||
# Convenience wrapper for short arch-specific build jobs in .gitlab-ci.yml
|
||||
|
||||
export PYTHONUNBUFFERED=1
|
||||
JOB_ARCH="${CI_JOB_NAME#build-}"
|
||||
|
||||
set -x
|
||||
su pmos -c ".gitlab-ci/build_changed_aports.py $JOB_ARCH"
|
||||
@@ -1,37 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import sys
|
||||
|
||||
# Same dir
|
||||
import common
|
||||
|
||||
# pmbootstrap
|
||||
import testcases.add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
import pmb.helpers.pmaports
|
||||
|
||||
def check_build(packages, verify_only=False):
|
||||
# Initialize build environment with less logging
|
||||
|
||||
def build_strict(packages, arch):
|
||||
common.run_pmbootstrap(["build_init"])
|
||||
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
|
||||
"--force", "--arch", arch] + list(packages))
|
||||
|
||||
if verify_only:
|
||||
common.run_pmbootstrap(["--details-to-stdout", "checksum",
|
||||
"--verify"] + list(packages))
|
||||
else:
|
||||
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
|
||||
"--force"] + list(packages))
|
||||
|
||||
def verify_checksums(packages, arch):
|
||||
# Only do this with one build-{arch} job
|
||||
arch_verify = "x86_64"
|
||||
if arch != arch_verify:
|
||||
print(f"NOTE: doing checksum verification in build-{arch_verify} job,"
|
||||
" not here.")
|
||||
return
|
||||
|
||||
common.run_pmbootstrap(["build_init"])
|
||||
common.run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
|
||||
list(packages))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Architecture to build for (as in build-{arch})
|
||||
if len(sys.argv) != 2:
|
||||
print("usage: build_changed_aports.py ARCH")
|
||||
sys.exit(1)
|
||||
arch = sys.argv[1]
|
||||
|
||||
# Get and print modified packages
|
||||
common.add_upstream_git_remote()
|
||||
packages = common.get_changed_packages()
|
||||
|
||||
# Build changed packages
|
||||
# Package count sanity check
|
||||
common.get_changed_packages_sanity_check(len(packages))
|
||||
|
||||
# [ci:skip-build]: verify checksums and stop
|
||||
verify_only = common.commit_message_has_string("[ci:skip-build]")
|
||||
if verify_only:
|
||||
print("WARNING: not building changed packages ([ci:skip-build])!")
|
||||
print("verifying checksums: " + ", ".join(packages))
|
||||
verify_checksums(packages, arch)
|
||||
sys.exit(0)
|
||||
|
||||
# Prepare "args" to use pmbootstrap code
|
||||
sys.argv = ["pmbootstrap", "chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Filter out packages that can't be built for given arch
|
||||
# (Iterate over copy of packages, because we modify it in this loop)
|
||||
for package in packages.copy():
|
||||
apkbuild_path = pmb.helpers.pmaports.find(args, package)
|
||||
apkbuild = pmb.parse._apkbuild.apkbuild(args,
|
||||
f"{apkbuild_path}/APKBUILD")
|
||||
|
||||
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
|
||||
print(f"{package}: not enabled for {arch}, skipping")
|
||||
packages.remove(package)
|
||||
|
||||
# No packages: skip build
|
||||
if len(packages) == 0:
|
||||
print("no aports changed in this branch")
|
||||
else:
|
||||
verify_only = common.commit_message_has_string("[ci:skip-build]")
|
||||
if verify_only:
|
||||
print("WARNING: not building changed packages ([ci:skip-build])!")
|
||||
print("verifying checksums: " + ", ".join(packages))
|
||||
else:
|
||||
print("building in strict mode: " + ", ".join(packages))
|
||||
check_build(packages, verify_only)
|
||||
print(f"no packages changed, which can be built for {arch}")
|
||||
sys.exit(0)
|
||||
|
||||
# Build packages
|
||||
print(f"building in strict mode for {arch}: {', '.join(packages)}")
|
||||
build_strict(packages, arch)
|
||||
@@ -19,7 +19,7 @@ import pmb.helpers.logging
|
||||
|
||||
def get_package_version(args, package, revision, check=True):
|
||||
# Redirect stderr to /dev/null, so git doesn't complain about files not
|
||||
# existing in master for new packages
|
||||
# existing in upstream branch for new packages
|
||||
stderr = None
|
||||
if not check:
|
||||
stderr = subprocess.DEVNULL
|
||||
@@ -56,20 +56,23 @@ def version_compare_operator(result):
|
||||
|
||||
|
||||
def exit_with_error_message():
|
||||
branch = common.get_upstream_branch()
|
||||
print()
|
||||
print("ERROR: Modified package(s) don't have an increased version!")
|
||||
print("ERROR: Modified package(s) don't have an increased version or a")
|
||||
print("new package has a nonzero pkgrel!")
|
||||
print()
|
||||
print("This can either happen if you did not change the pkgver/pkgrel")
|
||||
print("This can happen if you added a new package with a nonzero")
|
||||
print("pkgrel, or if you did not change the pkgver/pkgrel")
|
||||
print("variables in the APKBUILDs. Or you did change them, but the")
|
||||
print("packages have been updated in the official master branch, and now")
|
||||
print("your versions are not higher anymore.")
|
||||
print(f"packages have been updated in the official '{branch}' branch, and")
|
||||
print("now your versions are not higher anymore.")
|
||||
print()
|
||||
print("Your options:")
|
||||
print("a) If you made changes to the packages, and did not increase the")
|
||||
print(" pkgrel/pkgver: increase them now, and force push your branch.")
|
||||
print(" => https://postmarketos.org/howto-bump-pkgrel-pkgver")
|
||||
print("b) If you had already increased the package versions, rebase on")
|
||||
print(" master, increase the versions again and then force push:")
|
||||
print(f" '{branch}', increase the versions again and then force push:")
|
||||
print(" => https://postmarketos.org/rebase")
|
||||
print("c) If you made a change, that does not require rebuilding the")
|
||||
print(" packages, such as only changing the arch=... line: you can")
|
||||
@@ -83,29 +86,34 @@ def exit_with_error_message():
|
||||
def check_versions(args, packages):
|
||||
error = False
|
||||
|
||||
# Get relevant commits: compare HEAD against upstream/master or HEAD~1
|
||||
# (the latter if this CI check is running on upstream/master). Note that
|
||||
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
|
||||
# (the latter if this CI check is running on upstream branch). Note that
|
||||
# for the common.get_changed_files() code, we don't check against
|
||||
# upstream/master, but against the latest common ancestor. This is not
|
||||
# upstream branch HEAD, but against the latest common ancestor. This is not
|
||||
# desired here, since we already know what packages changed, and really
|
||||
# want to check if the version was increased towards *current* master.
|
||||
commit = "upstream/master"
|
||||
# want to check if the version was increased towards *current* upstream
|
||||
# branch HEAD.
|
||||
commit = f"upstream/{common.get_upstream_branch()}"
|
||||
if common.run_git(["rev-parse", "HEAD"]) == common.run_git(["rev-parse",
|
||||
commit]):
|
||||
print("NOTE: upstream/master is on same commit as HEAD, comparing"
|
||||
print(f"NOTE: {commit} is on same commit as HEAD, comparing"
|
||||
" HEAD against HEAD~1.")
|
||||
commit = "HEAD~1"
|
||||
|
||||
for package in packages:
|
||||
# Get versions, skip new packages
|
||||
head = get_package_version(args, package, "HEAD")
|
||||
master = get_package_version(args, package, commit, False)
|
||||
if not master:
|
||||
print("- {}: {} (HEAD) (new package)".format(package, head))
|
||||
upstream = get_package_version(args, package, commit, False)
|
||||
if not upstream:
|
||||
if head.rpartition('r')[2] != "0":
|
||||
print(f"- {package}: {head} (HEAD) (new package) [ERROR]")
|
||||
error = True
|
||||
else:
|
||||
print(f"- {package}: {head} (HEAD) (new package)")
|
||||
continue
|
||||
|
||||
# Compare head and master versions
|
||||
result = pmb.parse.version.compare(head, master)
|
||||
# Compare head and upstream versions
|
||||
result = pmb.parse.version.compare(head, upstream)
|
||||
if result != 1:
|
||||
error = True
|
||||
|
||||
@@ -114,7 +122,7 @@ def check_versions(args, packages):
|
||||
if result != 1:
|
||||
formatstr += " [ERROR]"
|
||||
operator = version_compare_operator(result)
|
||||
print(formatstr.format(package, head, operator, master, commit))
|
||||
print(formatstr.format(package, head, operator, upstream, commit))
|
||||
|
||||
if error:
|
||||
exit_with_error_message()
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2020 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
|
||||
def check_environment_variables():
|
||||
""" Make sure that all environment variables from GitLab CI are present,
|
||||
and exit right here when a variable is missing. """
|
||||
keys = ["CI_MERGE_REQUEST_IID",
|
||||
"CI_MERGE_REQUEST_PROJECT_PATH",
|
||||
"CI_MERGE_REQUEST_SOURCE_PROJECT_URL"]
|
||||
for key in keys:
|
||||
if key in os.environ:
|
||||
continue
|
||||
print("ERROR: missing environment variable: " + key)
|
||||
print("Reference: https://docs.gitlab.com/ee/ci/variables/")
|
||||
exit(1)
|
||||
|
||||
|
||||
def get_url_api():
|
||||
""" :returns: single merge request API URL, as documented here:
|
||||
https://docs.gitlab.com/ee/api/merge_requests.html#get-single-mr """
|
||||
project_path = os.environ["CI_MERGE_REQUEST_PROJECT_PATH"]
|
||||
project_path = urllib.parse.quote_plus(project_path)
|
||||
mr_id = os.environ["CI_MERGE_REQUEST_IID"]
|
||||
|
||||
url = "https://gitlab.com/api/v4/projects/{}/merge_requests/{}"
|
||||
return url.format(project_path, mr_id)
|
||||
|
||||
|
||||
def get_url_mr_edit():
|
||||
""" :returns: the link where the user can edit their own MR """
|
||||
url = "https://gitlab.com/{}/merge_requests/{}/edit"
|
||||
return url.format(os.environ["CI_MERGE_REQUEST_PROJECT_PATH"],
|
||||
os.environ["CI_MERGE_REQUEST_IID"])
|
||||
|
||||
|
||||
def get_url_repo_settings():
|
||||
""" :returns: link to the user's forked pmaports project's settings """
|
||||
prefix = os.environ["CI_MERGE_REQUEST_SOURCE_PROJECT_URL"]
|
||||
return prefix + "/settings/repository"
|
||||
|
||||
|
||||
def get_mr_settings(path):
|
||||
""" Get the merge request API data and parse it as JSON. Print the whole
|
||||
thing on failure.
|
||||
|
||||
:param path: to a local file with the saved API data (will download a
|
||||
fresh copy when set to None)
|
||||
:returns: dict of settings data (see GitLab API reference) """
|
||||
content = ""
|
||||
if path:
|
||||
# Read file
|
||||
with open(path, encoding="utf-8") as handle:
|
||||
content = handle.read()
|
||||
else:
|
||||
# Download from GitLab API
|
||||
url = get_url_api()
|
||||
print("Download " + url)
|
||||
content = urllib.request.urlopen(url).read().decode("utf-8")
|
||||
|
||||
# Parse JSON
|
||||
try:
|
||||
return json.loads(content)
|
||||
except:
|
||||
print("ERROR: failed to decode JSON. Here's the whole content for"
|
||||
" debugging:")
|
||||
print("---")
|
||||
print(content)
|
||||
exit(1)
|
||||
|
||||
|
||||
def settings_read(settings, key):
|
||||
if key not in settings:
|
||||
print("ERROR: missing '" + key + "' key in settings!")
|
||||
print("Here are the whole settings for debugging:")
|
||||
print("---")
|
||||
print(settings)
|
||||
exit(1)
|
||||
return settings[key]
|
||||
|
||||
|
||||
def check_allow_push(settings):
|
||||
""" :returns: True when maintainers are allowed to push to the branch
|
||||
(what we want!), False otherwise """
|
||||
|
||||
# Check if source branch is in same repository
|
||||
source = settings_read(settings, "source_project_id")
|
||||
target = settings_read(settings, "target_project_id")
|
||||
if source == target:
|
||||
return True
|
||||
|
||||
return settings_read(settings, "allow_maintainer_to_push")
|
||||
|
||||
|
||||
def main():
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--path", help="use a local file instead of querying"
|
||||
" the GitLab API", default=None)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check the merge request
|
||||
check_environment_variables()
|
||||
settings = get_mr_settings(args.path)
|
||||
|
||||
# Make sure that squashing is disabled
|
||||
if settings_read(settings, "squash"):
|
||||
print("*** MR settings check failed!")
|
||||
print('ERROR: Please turn off the "Squash commits when merge request'
|
||||
' is accepted." option in the merge request settings.')
|
||||
return 1
|
||||
if check_allow_push(settings):
|
||||
print("*** MR settings check successful!")
|
||||
else:
|
||||
print("*** MR settings check failed!")
|
||||
print()
|
||||
print("We need to be able to push changes to your merge request.")
|
||||
print("So we can rebase it on master right before merging, add the")
|
||||
print("MR-ID to the commit messages, etc.")
|
||||
print()
|
||||
print("How to fix it:")
|
||||
print("1) Open the 'edit' page of your merge request:")
|
||||
print(" " + get_url_mr_edit())
|
||||
print("2) Enable this option and save:")
|
||||
print(" 'Allow commits from members who can merge to the target"
|
||||
" branch'")
|
||||
print("3) Run these tests again with an empty commit in your MR:")
|
||||
print(" $ git commit --allow-empty -m 'run mr-settings test again'")
|
||||
print()
|
||||
print("If that setting is disabled, then you have created the MR from")
|
||||
print("a protected branch. When you had forked the repository from")
|
||||
print("postmarketOS, the protected branch settings were copied to")
|
||||
print("your fork.")
|
||||
print()
|
||||
print("Resolve this with:")
|
||||
print("1) Open your repository settings:")
|
||||
print(" " + get_url_repo_settings())
|
||||
print("2) Scroll down to 'Protected Branches' and expand it")
|
||||
print("3) Click 'unprotect' next to the branch from your MR")
|
||||
print("4) Follow steps 1-3 from the first list again, the option")
|
||||
print(" should not be disabled anymore.")
|
||||
print()
|
||||
print("Thank you and sorry for the inconvenience.")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
sys.exit(main())
|
||||
+55
-25
@@ -4,13 +4,22 @@
|
||||
|
||||
# Various functions used in CI scripts
|
||||
|
||||
import configparser
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
cache = {}
|
||||
|
||||
|
||||
def get_pmaports_dir():
|
||||
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
global cache
|
||||
if "pmaports_dir" in cache:
|
||||
return cache["pmaports_dir"]
|
||||
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
cache["pmaports_dir"] = ret
|
||||
return ret
|
||||
|
||||
|
||||
def run_git(parameters, check=True, stderr=None):
|
||||
@@ -35,14 +44,45 @@ def commit_message_has_string(needle):
|
||||
return needle in run_git(["show", "-s", "--format=full", "HEAD"])
|
||||
|
||||
|
||||
def run_pmbootstrap(parameters):
|
||||
def run_pmbootstrap(parameters, output_return=False):
|
||||
""" Run pmbootstrap with the pmaports dir as --aports """
|
||||
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
|
||||
process = subprocess.Popen(cmd)
|
||||
process.communicate()
|
||||
if process.returncode != 0:
|
||||
print("** Test failed")
|
||||
exit(1)
|
||||
stdout = subprocess.PIPE if output_return else None
|
||||
result = subprocess.run(cmd, stdout=stdout, universal_newlines=True)
|
||||
result.check_returncode()
|
||||
if output_return:
|
||||
return result.stdout
|
||||
|
||||
|
||||
def get_upstream_branch():
|
||||
""" Use pmaports.cfg from current branch (e.g. "v20.05_fix-ci") and
|
||||
channels.cfg from master to retrieve the upstream branch.
|
||||
|
||||
:returns: branch name, e.g. "v20.05" """
|
||||
global cache
|
||||
if "upstream_branch" in cache:
|
||||
return cache["upstream_branch"]
|
||||
|
||||
# Get channel (e.g. "stable") from pmaports.cfg
|
||||
# https://postmarketos.org/pmaports.cfg
|
||||
pmaports_dir = get_pmaports_dir()
|
||||
pmaports_cfg = configparser.ConfigParser()
|
||||
pmaports_cfg.read(f"{pmaports_dir}/pmaports.cfg")
|
||||
channel = pmaports_cfg["pmaports"]["channel"]
|
||||
|
||||
# Get branch_pmaports (e.g. "v20.05") from channels.cfg
|
||||
# https://postmarketos.org/channels.cfg
|
||||
channels_cfg_str = run_git(["show", "upstream/master:channels.cfg"])
|
||||
channels_cfg = configparser.ConfigParser()
|
||||
channels_cfg.read_string(channels_cfg_str)
|
||||
assert channel in channels_cfg, \
|
||||
f"Channel '{channel}' from pmaports.cfg in your branch is unknown." \
|
||||
" This appears to be an old branch, consider recreating your change" \
|
||||
" on top of master."
|
||||
|
||||
ret = channels_cfg[channel]["branch_pmaports"]
|
||||
cache["upstream_branch"] = ret
|
||||
return ret
|
||||
|
||||
|
||||
def get_changed_files(removed=True):
|
||||
@@ -51,18 +91,19 @@ def get_changed_files(removed=True):
|
||||
:param removed: also return removed files (default: True)
|
||||
:returns: set of changed files
|
||||
"""
|
||||
branch_upstream = f"upstream/{get_upstream_branch()}"
|
||||
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
|
||||
commit_upstream_master = run_git(["rev-parse", "upstream/master"])[:-1]
|
||||
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
|
||||
print("commit HEAD: " + commit_head)
|
||||
print("commit upstream/master: " + commit_upstream_master)
|
||||
print(f"commit {branch_upstream}: f{commit_upstream}")
|
||||
|
||||
# Check if we are latest upstream/master
|
||||
if commit_head == commit_upstream_master:
|
||||
# Check if we are HEAD on the upstream branch
|
||||
if commit_head == commit_upstream:
|
||||
# then compare with previous commit
|
||||
commit = "HEAD~1"
|
||||
else:
|
||||
# otherwise compare with latest common ancestor
|
||||
commit = run_git(["merge-base", "upstream/master", "HEAD"])[:-1]
|
||||
commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1]
|
||||
print("comparing HEAD with: " + commit)
|
||||
|
||||
# Changed files
|
||||
@@ -88,6 +129,7 @@ def get_changed_packages_sanity_check(count):
|
||||
if count <= 10:
|
||||
return
|
||||
|
||||
branch = get_upstream_branch()
|
||||
print()
|
||||
print("ERROR: Too many packages have changed!")
|
||||
print()
|
||||
@@ -97,7 +139,7 @@ def get_changed_packages_sanity_check(count):
|
||||
print()
|
||||
print("Your options:")
|
||||
print("a) If you *did not* modify everything listed above, then rebase")
|
||||
print(" your branch on the official postmarketOS/pmaports.git master")
|
||||
print(f" your branch on the official postmarketOS/pmaports.git {branch}")
|
||||
print(" branch. Feel free to ask in the chat for help if you need any.")
|
||||
print("b) If you *did* modify all these packages, and you assume that")
|
||||
print(" they will build within one hour: skip this sanity check by")
|
||||
@@ -148,15 +190,3 @@ def get_changed_packages():
|
||||
ret.add(os.path.basename(dirname))
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def check_build(packages, verify_only=False):
|
||||
# Initialize build environment with less logging
|
||||
run_pmbootstrap(["build_init"])
|
||||
|
||||
if verify_only:
|
||||
run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
|
||||
list(packages))
|
||||
else:
|
||||
run_pmbootstrap(["--details-to-stdout", "build", "--strict",
|
||||
"--force"] + list(packages))
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2020 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# usage: install_pmbootstrap.sh [ADDITIONAL_PACKAGE, ...]
|
||||
|
||||
# Config: pmbootstrap tag (or branch)
|
||||
tag="master"
|
||||
|
||||
# Get download URL and pmaports path
|
||||
url="https://gitlab.com/postmarketOS/pmbootstrap.git"
|
||||
pmaports="$(cd $(dirname $0)/..; pwd -P)"
|
||||
|
||||
# Set up depends and binfmt_misc
|
||||
depends="coreutils openssl python3 sudo git $@"
|
||||
echo "Installing dependencies: $depends"
|
||||
apk -q add $depends
|
||||
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
|
||||
# Create pmos user
|
||||
echo "Creating pmos user"
|
||||
adduser -D pmos
|
||||
chown -R pmos:pmos .
|
||||
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# Download pmbootstrap (to /tmp/pmbootstrap)
|
||||
echo "Downloading pmbootstrap ($tag): $url"
|
||||
cd /tmp
|
||||
git clone -q "$url"
|
||||
git -C pmbootstrap checkout -q "$tag"
|
||||
|
||||
# Install to $PATH and init
|
||||
ln -s /tmp/pmbootstrap/pmbootstrap.py /usr/local/bin/pmbootstrap
|
||||
echo "Initializing pmbootstrap"
|
||||
if ! su pmos -c "yes '' | pmbootstrap -q --aports '$pmaports' --details-to-stdout init"; then
|
||||
echo "ERROR: pmbootstrap init failed!"
|
||||
echo
|
||||
echo "Most likely, this means that pmbootstrap requires a newer"
|
||||
echo "pmaports version. Please rebase on the official pmaports.git"
|
||||
echo "master branch and try again."
|
||||
echo
|
||||
echo "Let us know in the chat or issues if you have trouble with that"
|
||||
echo "and we will be happy to help. Sorry for the inconvenience."
|
||||
echo
|
||||
echo "(If that does not help, click on 'Browse' in the 'Job artifacts'"
|
||||
echo "next to this log output, and have a look at log.txt.)"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
@@ -5,6 +5,8 @@
|
||||
import shutil
|
||||
import sys
|
||||
import os
|
||||
import importlib
|
||||
import importlib.util
|
||||
from distutils.sysconfig import get_python_lib
|
||||
|
||||
|
||||
@@ -33,5 +35,7 @@ def path_pmbootstrap():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Add pmbootstrap dir to import path
|
||||
sys.path.append(os.path.realpath(path_pmbootstrap()))
|
||||
# Check if pmb module can be imported
|
||||
if importlib.util.find_spec("pmb") is None:
|
||||
# Add pmbootstrap dir to import path
|
||||
sys.path.append(os.path.realpath(path_pmbootstrap()))
|
||||
@@ -10,6 +10,8 @@ import os
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
import pmb.parse.apkindex
|
||||
import pmb.helpers.repo
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -96,11 +98,23 @@ def device_dependency_check(apkbuild, path):
|
||||
" <https://postmarketos.org/devicepkg>.")
|
||||
|
||||
|
||||
def test_aports_kernel(args):
|
||||
"""
|
||||
Various tests performed on the /**/linux-* aports.
|
||||
"""
|
||||
for path in glob.iglob(args.aports + "**/linux-*/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
if "pmb:cross-native" not in apkbuild["options"]:
|
||||
raise RuntimeError("\"pmb:cross-native\" missing in"
|
||||
f" options= line: {path}")
|
||||
|
||||
|
||||
def test_aports_device(args):
|
||||
"""
|
||||
Various tests performed on the /device/*/device-* aports.
|
||||
"""
|
||||
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
# Depends: Require "postmarketos-base"
|
||||
@@ -160,3 +174,32 @@ def test_aports_device_kernel(args):
|
||||
" multiple kernels in depends (see"
|
||||
" <https://postmarketos.org/devicepkg>): " +
|
||||
path)
|
||||
|
||||
|
||||
def test_aports_ui(args):
|
||||
"""
|
||||
Raise an error if package in _pmb_recommends is not found
|
||||
"""
|
||||
for arch in pmb.config.build_device_architectures:
|
||||
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
# Skip if arch isn't enabled
|
||||
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
|
||||
continue
|
||||
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from"
|
||||
f" _pmb_recommends not found for arch '{arch}'")
|
||||
|
||||
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
|
||||
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
|
||||
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
|
||||
for package in apkbuild["_pmb_recommends"]:
|
||||
depend = pmb.helpers.package.get(args, package,
|
||||
arch, must_exist=False)
|
||||
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
|
||||
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
|
||||
f"of -extras subpackage is not found for arch '{arch}'")
|
||||
@@ -2,6 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import glob
|
||||
import os
|
||||
import stat
|
||||
|
||||
expected_directories = [
|
||||
"console",
|
||||
@@ -9,12 +10,11 @@ expected_directories = [
|
||||
"device/community",
|
||||
"device/main",
|
||||
"device/testing",
|
||||
"firmware",
|
||||
"hybris",
|
||||
"kde",
|
||||
"maemo",
|
||||
"main",
|
||||
"modem",
|
||||
"sxmo",
|
||||
"temp",
|
||||
]
|
||||
|
||||
@@ -25,7 +25,24 @@ def test_directories():
|
||||
apkbuilds = set(glob.iglob("**/APKBUILD", recursive=True))
|
||||
expected = set(f for d in expected_directories for f in glob.iglob(d + "/*/APKBUILD"))
|
||||
assert apkbuilds == expected, "Found APKBUILD in unexpected directory. " \
|
||||
"Consider adding it to test_directory_structure.py!"
|
||||
"Note that we moved firmware/* to device/{main,community,testing}/*."
|
||||
|
||||
|
||||
# Ensure no file in pmaports are executable.
|
||||
# see https://gitlab.com/postmarketOS/pmaports/-/issues/593.
|
||||
def test_executable_files():
|
||||
for file in glob.iglob("**/*", recursive=True):
|
||||
if os.path.isdir(file) or os.path.islink(file):
|
||||
continue
|
||||
# still check other less common inode types
|
||||
permissions = os.stat(file).st_mode
|
||||
executable_bits = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
|
||||
if permissions & executable_bits != 0:
|
||||
raise RuntimeError(f"\"{file}\" is executable. Files in pmaports" +
|
||||
" should not be executables. post-* files" +
|
||||
" don't need to be executable and executables" +
|
||||
" should be installed using `install -D" +
|
||||
"m0755` or a variation thereof.")
|
||||
|
||||
|
||||
# Make sure files are either:
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Reference: https://postmarketos.org/channels.cfg
|
||||
[channels.cfg]
|
||||
recommended=edge
|
||||
|
||||
[edge]
|
||||
description=Rolling release channel
|
||||
branch_pmaports=master
|
||||
branch_aports=master
|
||||
mirrordir_pmos=master
|
||||
mirrordir_alpine=edge
|
||||
|
||||
[stable]
|
||||
description=Upcoming beta release (WIP, DO NOT USE!)
|
||||
branch_pmaports=release/20.04
|
||||
branch_aports=3.11-stable
|
||||
mirrordir_pmos=v20.04
|
||||
mirrordir_alpine=v3.11
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributor: Danct12 <danct12@disroot.org>
|
||||
# Maintainer: Danct12 <danct12@disroot.org>
|
||||
pkgname="console-keyboard-basic"
|
||||
pkgname=console-keyboard-basic
|
||||
pkgver=0_git20200104
|
||||
pkgrel=0
|
||||
pkgdesc="A basic console keyboard"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributor: Danct12 <danct12@disroot.org>
|
||||
# Maintainer: Danct12 <danct12@disroot.org>
|
||||
pkgname="console-keyboard-multiplexer"
|
||||
pkgname=console-keyboard-multiplexer
|
||||
pkgver=0_git20200104
|
||||
pkgrel=0
|
||||
pkgdesc="An on screen keyboard for terminals"
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -1,6 +1,6 @@
|
||||
# Contributor: Danct12 <danct12@disroot.org>
|
||||
# Maintainer: Danct12 <danct12@disroot.org>
|
||||
pkgname="libconsolekeyboard"
|
||||
pkgname=libconsolekeyboard
|
||||
pkgver=1.0.0_git20191011
|
||||
pkgrel=0
|
||||
pkgdesc="A terminal multiplexer library"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributor: Danct12 <danct12@disroot.org>
|
||||
# Maintainer: Danct12 <danct12@disroot.org>
|
||||
pkgname="libttymultiplex"
|
||||
pkgname=libttymultiplex
|
||||
pkgver=0.0.1_git20200204
|
||||
pkgrel=0
|
||||
pkgdesc="A terminal multiplexer library"
|
||||
|
||||
@@ -12,7 +12,7 @@ pkgdesc="Wrappers for ccache + distcc (native and foreign chroots)"
|
||||
url="https://postmarketOS.org"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
options="!check !tracedeps"
|
||||
options="!check !tracedeps pmb:cross-native"
|
||||
|
||||
package() {
|
||||
# Architectures and binaries
|
||||
|
||||
@@ -2,23 +2,22 @@
|
||||
# Generator: pmbootstrap aportgen binutils-aarch64
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname="binutils-aarch64"
|
||||
|
||||
builddir="$srcdir/binutils-2.34"
|
||||
|
||||
pkgname=binutils-aarch64
|
||||
pkgver=2.34
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
pkgdesc="Tools necessary to build programs for aarch64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
arch="armhf armv7 x86_64 x86"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
@@ -28,16 +27,15 @@ fi
|
||||
|
||||
# secfixes:
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec aarch64)"
|
||||
cd "$builddir"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
@@ -55,7 +53,6 @@ build() {
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
@@ -64,7 +61,7 @@ package() {
|
||||
|
||||
|
||||
|
||||
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
|
||||
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
|
||||
@@ -1,70 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armhf
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname="binutils-armhf"
|
||||
pkgver=2.34
|
||||
pkgrel=0
|
||||
pkgdesc="Tools necessary to build programs for armhf targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
arch="armv7 aarch64 x86_64 x86"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec armhf)"
|
||||
cd "$builddir"
|
||||
"$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() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
rm -rf "$pkgdir"/usr/share
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
|
||||
@@ -1,46 +0,0 @@
|
||||
This fixes static linking for our hardened toolchain
|
||||
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
|
||||
index e8126cb..9532bfb 100644
|
||||
--- a/ld/scripttempl/elf.sc
|
||||
+++ b/ld/scripttempl/elf.sc
|
||||
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
|
||||
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
|
||||
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
else
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
|
||||
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
- KEEP (*crtbegin.o(.ctors))
|
||||
- KEEP (*crtbegin?.o(.ctors))
|
||||
+ KEEP (*crtbegin*.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
${CONSTRUCTING+${CTOR_END}}
|
||||
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
DTOR=".dtors ${CONSTRUCTING-0} :
|
||||
{
|
||||
${CONSTRUCTING+${DTOR_START}}
|
||||
- KEEP (*crtbegin.o(.dtors))
|
||||
- KEEP (*crtbegin?.o(.dtors))
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
+ KEEP (*crtbegin*.o(.dtors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
${CONSTRUCTING+${DTOR_END}}
|
||||
@@ -1,39 +0,0 @@
|
||||
# DP: Fix gold on mips64 targets.
|
||||
|
||||
gold/
|
||||
|
||||
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
|
||||
|
||||
|
||||
--- a/gold/configure.tgt
|
||||
+++ b/gold/configure.tgt
|
||||
@@ -153,6 +153,13 @@ aarch64*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*el*-*-*|mips*64*le*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS_RS3_LE
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=false
|
||||
+ targ_extra_big_endian=true
|
||||
+ ;;
|
||||
mips*el*-*-*|mips*le*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS_RS3_LE
|
||||
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=true
|
||||
+ targ_extra_big_endian=false
|
||||
+ ;;
|
||||
mips*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ./ld/configure.tgt.orig
|
||||
+++ ./ld/configure.tgt
|
||||
@@ -541,12 +541,12 @@
|
||||
;;
|
||||
mips*-*-windiss) targ_emul=elf32mipswindiss
|
||||
;;
|
||||
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
|
||||
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
|
||||
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
|
||||
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
|
||||
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
|
||||
+mips64*-*-linux-*) targ_emul=elf64btsmip
|
||||
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
mips*el-*-linux-*) targ_emul=elf32ltsmip
|
||||
@@ -2,23 +2,22 @@
|
||||
# Generator: pmbootstrap aportgen binutils-armv7
|
||||
# Based on: main/binutils
|
||||
|
||||
pkgname="binutils-armv7"
|
||||
|
||||
builddir="$srcdir/binutils-2.34"
|
||||
|
||||
pkgname=binutils-armv7
|
||||
pkgver=2.34
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
pkgdesc="Tools necessary to build programs for armv7 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
||||
arch="armhf aarch64 x86_64 x86"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
@@ -28,16 +27,15 @@ fi
|
||||
|
||||
# secfixes:
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec armv7)"
|
||||
cd "$builddir"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
@@ -55,7 +53,6 @@ build() {
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
@@ -64,7 +61,7 @@ package() {
|
||||
|
||||
|
||||
|
||||
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
|
||||
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
|
||||
@@ -1,9 +1,14 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-aarch64
|
||||
|
||||
# Stub for apkbuild-lint
|
||||
if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
arch_to_hostspec() { :; }
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.31.1
|
||||
pkgrel=14
|
||||
pkgrel=20
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
|
||||
@@ -16,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/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.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="d8b821b9f03837fde107cd6b4260b339c57c532d0c643d4bdf142c2cc33248029023238240a863117deed1ea3cb4531f51cbad0de4767f44801ce18cef4b3475 busybox-static-1.31.1-r14-aarch64.apk"
|
||||
sha512sums="4d95fbfa910840ba5b36a5c343b62167245999d37e7f3a5598ef1870dcfaa3a15445269651431701d7f6e020fbe21ce1b06561ade6ee20899b8692de9f649114 busybox-static-1.31.1-r20-aarch64.apk"
|
||||
@@ -1,29 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-armhf
|
||||
|
||||
pkgname=busybox-static-armhf
|
||||
pkgver=1.31.1
|
||||
pkgrel=14
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
|
||||
|
||||
url="http://busybox.net"
|
||||
license="GPL2"
|
||||
arch="all"
|
||||
options="!check !strip"
|
||||
pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.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.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="ceeb5786a2ca8a904dece9b9b3132e883c03eeb216b9343def3faa2a0d64a4744ee359f991730c531859ed7e82baa88a9f95349265735ac6e1c539f28adf668e busybox-static-1.31.1-r14-armhf.apk"
|
||||
@@ -1,9 +1,14 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-armv7
|
||||
|
||||
# Stub for apkbuild-lint
|
||||
if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
arch_to_hostspec() { :; }
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.31.1
|
||||
pkgrel=14
|
||||
pkgrel=20
|
||||
|
||||
_arch="armv7"
|
||||
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
|
||||
@@ -16,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/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.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="7c5053f6eb683917708b36fc255630386e9b6e6deb265ee44bdcb7fdd272a54a0b9d0d589355f454bacdd6be75ebe5eeec9e0650d90e403c81c080204d422a59 busybox-static-1.31.1-r14-armv7.apk"
|
||||
sha512sums="170964dcd726c3bd05420d2a46663e75037f2f25391db5a63647ab9e2969e0ef1262f6f02833e7af4861ca26f997952f3c47eadf5938237eeaa1f585343ff869 busybox-static-1.31.1-r20-armv7.apk"
|
||||
@@ -0,0 +1,22 @@
|
||||
Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
|
||||
Reason: GDC produced errors about duplicate symbols when the same interface
|
||||
was implemented by two classes in the same project.
|
||||
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
|
||||
index 3824060..7afb1aa 100644 (file)
|
||||
--- a/gcc/d/decl.cc
|
||||
+++ b/gcc/d/decl.cc
|
||||
@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
|
||||
|
||||
DECL_CONTEXT (thunk) = d_decl_context (decl);
|
||||
|
||||
- /* Thunks inherit the public access of the function they are targetting. */
|
||||
- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
|
||||
+ /* Thunks inherit the public access of the function they are targetting.
|
||||
+ When the function is outside the current compilation unit however, then the
|
||||
+ thunk must be kept private to not conflict. */
|
||||
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
|
||||
+
|
||||
DECL_EXTERNAL (thunk) = 0;
|
||||
|
||||
/* Thunks are always addressable. */
|
||||
@@ -30,7 +30,7 @@ pkgver=9.3.0
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname="gcc-aarch64"
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
@@ -214,6 +214,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
|
||||
403-dlang-ibmz.patch
|
||||
404-dlang-zlib.patch
|
||||
405-dlang-mips.patch
|
||||
406-dlang-fix-interface-visibility.patch
|
||||
"
|
||||
|
||||
# gcc-4.8-build-args.patch
|
||||
@@ -438,6 +439,10 @@ done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||
|
||||
# install lto plugin so regular binutils may use it
|
||||
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
|
||||
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -660,4 +665,5 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
|
||||
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
|
||||
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
|
||||
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
|
||||
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
|
||||
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch
|
||||
c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch"
|
||||
@@ -1,42 +0,0 @@
|
||||
From 65eb86f3e110998d30489df009d44b4bc1043adc Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Fri, 26 Jan 2018 20:32:50 +0000
|
||||
Subject: [PATCH 02/12] 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 ffbb7f82cf5..b0b890d2403 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.17.1
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
From 48c670d2678e0323d88eb72205e039f393cabe05 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 03/39] gcc: poison-system-directories
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Inappropriate [distribution: codesourcery]
|
||||
---
|
||||
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 | 19 +++++++++++++++++++
|
||||
7 files changed, 66 insertions(+)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index d6ef85928f3..7b29efe3882 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -679,6 +679,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 5bccb408016..1c784a8276b 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -194,6 +194,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 5c345ce0fd7..cafd05fd150 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -953,6 +953,7 @@ with_system_zlib
|
||||
enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1696,6 +1697,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
|
||||
@@ -29715,6 +29718,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 65dbf1f2f80..dd5b38195ce 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -6341,6 +6341,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 255149fcfb8..cb71b60fe3c 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -303,6 +303,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Wpacked -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
|
||||
-Wparentheses -Wno-pedantic-ms-format @gol
|
||||
-Wplacement-new -Wplacement-new=@var{n} @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
|
||||
-Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
|
||||
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
|
||||
@@ -5712,6 +5713,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 a716f708259..02b3cd39fc2 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1061,6 +1060,8 @@
|
||||
"-z relro -z now " \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
+ %{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 b11c6a57939..e3b7a21966f 100644
|
||||
--- a/gcc/incpath.c
|
||||
+++ b/gcc/incpath.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[INC_QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
|
||||
+ || (!strncmp (p->name, "/sw/include", 11))
|
||||
+ || (!strncmp (p->name, "/opt/include", 12)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.17.0
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From b693804c8dba92fea7beee98f0aa520853a0532b Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Thu, 22 Dec 2016 11:22:28 +0000
|
||||
Subject: [PATCH 08/12] s390x muslldso
|
||||
|
||||
---
|
||||
gcc/config/s390/linux.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 525c17c2c9f..2d4f4a0654e 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -76,6 +76,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Wed, 28 Feb 2018 00:54:05 +0000
|
||||
Subject: [PATCH 10/12] ldbl128 config
|
||||
|
||||
---
|
||||
gcc/configure | 13 +++++++++++++
|
||||
gcc/configure.ac | 16 ++++++++++++++--
|
||||
2 files changed, 27 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 6121e163259..07ff8597d48 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then :
|
||||
withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128"
|
||||
else
|
||||
|
||||
+ case "$target" in
|
||||
+ s390*-*-linux-musl*)
|
||||
+ gcc_cv_target_ldbl128=yes
|
||||
+ ;;
|
||||
+ powerpc*-*-linux-musl*)
|
||||
+ gcc_cv_target_ldbl128=no
|
||||
+ ;;
|
||||
+ *)
|
||||
+
|
||||
if test $glibc_version_major -gt 2 \
|
||||
|| ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then :
|
||||
gcc_cv_target_ldbl128=yes
|
||||
@@ -29320,6 +29329,10 @@ else
|
||||
&& gcc_cv_target_ldbl128=yes
|
||||
|
||||
fi
|
||||
+
|
||||
+ ;;
|
||||
+ esac
|
||||
+
|
||||
fi
|
||||
|
||||
;;
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index b066cc609e1..6c15ed898c0 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -5971,13 +5971,25 @@ case "$target" in
|
||||
AC_ARG_WITH(long-double-128,
|
||||
[AS_HELP_STRING([--with-long-double-128],
|
||||
[use 128-bit long double by default])],
|
||||
- gcc_cv_target_ldbl128="$with_long_double_128",
|
||||
+ gcc_cv_target_ldbl128="$with_long_double_128", [
|
||||
+ case "$target" in
|
||||
+ s390*-*-linux-musl*)
|
||||
+ gcc_cv_target_ldbl128=yes
|
||||
+ ;;
|
||||
+ powerpc*-*-linux-musl*)
|
||||
+ gcc_cv_target_ldbl128=no
|
||||
+ ;;
|
||||
+ *)]
|
||||
[GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
|
||||
[gcc_cv_target_ldbl128=no
|
||||
grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
|
||||
$target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
|
||||
&& gcc_cv_target_ldbl128=yes
|
||||
- ]])])
|
||||
+ ]])]
|
||||
+ [
|
||||
+ ;;
|
||||
+ esac
|
||||
+ ])
|
||||
;;
|
||||
esac
|
||||
if test x$gcc_cv_target_ldbl128 = xyes; then
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
From a4aa319f7c19e564dced3daeb7222c9315af936c Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 18 Aug 2018 23:58:45 +0000
|
||||
Subject: [PATCH 12/12] static-pie
|
||||
|
||||
in gcc-8 -static means static non-pie, even if -pie or -static-pie
|
||||
are specified, -static-pie can be used to build static pie.
|
||||
|
||||
in musl toolchains -static -pie always meant static pie, so this
|
||||
patch fixes the link specs accordingly, the new -static-pie is just
|
||||
an alias to -static -pie.
|
||||
---
|
||||
gcc/common.opt | 4 ++--
|
||||
gcc/config/gnu-user.h | 12 +++++-------
|
||||
gcc/config/rs6000/sysv4.h | 11 +++++------
|
||||
gcc/gcc.c | 6 +++---
|
||||
4 files changed, 15 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index b52ef0b38c8..0ce5857e01d 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -3197,11 +3197,11 @@ Driver
|
||||
|
||||
no-pie
|
||||
Driver RejectNegative Negative(shared)
|
||||
-Don't create a dynamically linked position independent executable.
|
||||
+Don't create a position independent executable.
|
||||
|
||||
pie
|
||||
Driver RejectNegative Negative(no-pie)
|
||||
-Create a dynamically linked position independent executable.
|
||||
+Create a position independent executable.
|
||||
|
||||
static-pie
|
||||
Driver RejectNegative Negative(pie)
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index 8620de3e42d..235328a2642 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -51,13 +51,12 @@
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{shared:; \
|
||||
pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
|
||||
- static:crt1.o%s; \
|
||||
- static-pie:rcrt1.o%s; \
|
||||
+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \
|
||||
" PIE_SPEC ":Scrt1.o%s; \
|
||||
:crt1.o%s} " \
|
||||
GNU_USER_TARGET_CRTI " \
|
||||
- %{static:crtbeginT.o%s; \
|
||||
- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
|
||||
+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \
|
||||
+ static:crtbeginT.o%s; \
|
||||
:crtbegin.o%s} \
|
||||
%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
@@ -76,8 +75,7 @@
|
||||
"%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_end_preinit.o%s; \
|
||||
fvtable-verify=std:vtv_end.o%s} \
|
||||
- %{static:crtend.o%s; \
|
||||
- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
|
||||
+ %{shared|" PIE_SPEC ":crtendS.o%s; \
|
||||
:crtend.o%s} " \
|
||||
GNU_USER_TARGET_CRTN " " \
|
||||
CRTOFFLOADEND
|
||||
@@ -133,7 +131,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
|
||||
|
||||
#if defined(HAVE_LD_EH_FRAME_HDR)
|
||||
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
|
||||
+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} "
|
||||
#endif
|
||||
|
||||
#undef LINK_GCC_C_SEQUENCE_SPEC
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index eb1610ba8b0..87560afb03c 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -900,7 +900,7 @@ proper position among the other output files. */
|
||||
#define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC
|
||||
#define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;"
|
||||
#else
|
||||
-#define PIE_SPEC "pie"
|
||||
+#define PIE_SPEC "pie|static-pie"
|
||||
#define FPIE1_SPEC "fpie"
|
||||
#define NO_FPIE1_SPEC FPIE1_SPEC ":;"
|
||||
#define FPIE2_SPEC "fPIE"
|
||||
@@ -924,12 +924,12 @@ proper position among the other output files. */
|
||||
#ifndef LINK_PIE_SPEC
|
||||
#ifdef HAVE_LD_PIE
|
||||
#ifndef LD_PIE_SPEC
|
||||
-#define LD_PIE_SPEC "-pie"
|
||||
+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}"
|
||||
#endif
|
||||
#else
|
||||
#define LD_PIE_SPEC ""
|
||||
#endif
|
||||
-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
|
||||
+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
|
||||
#endif
|
||||
|
||||
#ifndef LINK_BUILDID_SPEC
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
Fixes errors such as:
|
||||
|
||||
GEGL-Message: 16:04:13.794: Module '/usr/lib/gegl-0.4/raw-load.so' load error: Error relocating /usr/lib/libgomp.so.1: __cxa_finalize: initial-exec TLS resolves to dynamic definition in /usr/lib/libgomp.so.1
|
||||
|
||||
--- a/libgomp/configure.tgt 2018-11-08 18:13:04.000000000 +0100
|
||||
+++ b/libgomp/configure.tgt 2019-06-29 20:06:31.972950350 +0200
|
||||
@@ -10,23 +10,6 @@
|
||||
# XCFLAGS Add extra compile flags to use.
|
||||
# XLDFLAGS Add extra link flags to use.
|
||||
|
||||
-# Optimize TLS usage by avoiding the overhead of dynamic allocation.
|
||||
-if test $gcc_cv_have_tls = yes ; then
|
||||
- case "${target}" in
|
||||
-
|
||||
- *-*-k*bsd*-gnu*)
|
||||
- ;;
|
||||
-
|
||||
- *-*-linux* | *-*-gnu*)
|
||||
- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
|
||||
- ;;
|
||||
-
|
||||
- *-*-rtems*)
|
||||
- XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
|
||||
- ;;
|
||||
- esac
|
||||
-fi
|
||||
-
|
||||
# Since we require POSIX threads, assume a POSIX system by default.
|
||||
config_path="posix"
|
||||
@@ -1,33 +0,0 @@
|
||||
# Turn on -Wl,-z,relro,-z,now by default.
|
||||
|
||||
---
|
||||
gcc/doc/invoke.texi | 3 +++
|
||||
gcc/gcc.c | 1 +
|
||||
2 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: b/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -11424,6 +11424,9 @@ For example, @option{-Wl,-Map,output.map
|
||||
linker. When using the GNU linker, you can also get the same effect with
|
||||
@option{-Wl,-Map=output.map}.
|
||||
|
||||
+NOTE: In Alpine Linux, for LDFLAGS, the option
|
||||
+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
|
||||
+
|
||||
@item -u @var{symbol}
|
||||
@opindex u
|
||||
Pretend the symbol @var{symbol} is undefined, to force linking of
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -890,6 +890,7 @@ proper position among the other output f
|
||||
"%{flto|flto=*:%<fcompare-debug*} \
|
||||
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
+ "-z relro -z now " \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
|
||||
@@ -1,40 +0,0 @@
|
||||
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
|
||||
# DP: if the optimization level is > 0
|
||||
|
||||
---
|
||||
gcc/doc/invoke.texi | 6 ++++++
|
||||
gcc/c-family/c-cppbuiltin.c | 3 +
|
||||
2 files changed, 9 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: b/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -7840,6 +7840,12 @@ also turns on the following optimization
|
||||
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
|
||||
Index: b/gcc/c-family/c-cppbuiltin.c
|
||||
===================================================================
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -1176,6 +1176,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__");
|
||||
@@ -1,244 +0,0 @@
|
||||
# DP: On linux targets pass --as-needed by default to the linker, but always
|
||||
# DP: link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -692,8 +692,11 @@ proper position among the other output f
|
||||
#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
|
||||
@@ -710,8 +713,11 @@ proper position among the other output f
|
||||
#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
|
||||
@@ -728,8 +734,11 @@ proper position among the other output f
|
||||
#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
|
||||
@@ -744,8 +753,11 @@ proper position among the other output f
|
||||
#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
|
||||
Index: b/gcc/config/gnu-user.h
|
||||
===================================================================
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -161,15 +161,15 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
|
||||
"%{static-libasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
|
||||
"%{static-libtsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
|
||||
"%{static-liblsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#endif
|
||||
Index: b/gcc/config/aarch64/aarch64-linux.h
|
||||
===================================================================
|
||||
--- 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} \
|
||||
Index: b/gcc/config/ia64/linux.h
|
||||
===================================================================
|
||||
--- 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: \
|
||||
Index: b/gcc/config/sparc/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/sparc/linux.h
|
||||
+++ b/gcc/config/sparc/linux.h
|
||||
@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu
|
||||
#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: \
|
||||
Index: b/gcc/config/s390/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
#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} \
|
||||
Index: b/gcc/config/rs6000/linux64.h
|
||||
===================================================================
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -490,13 +490,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 "}}} \
|
||||
Index: b/gcc/config/rs6000/sysv4.h
|
||||
===================================================================
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -811,7 +811,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
|
||||
MUSL_DYNAMIC_LINKER)
|
||||
|
||||
-#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 "}}"
|
||||
|
||||
Index: b/gcc/config/i386/gnu-user64.h
|
||||
===================================================================
|
||||
--- a/gcc/config/i386/gnu-user64.h
|
||||
+++ b/gcc/config/i386/gnu-user64.h
|
||||
@@ -56,6 +56,7 @@
|
||||
"%{" 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: \
|
||||
Index: b/gcc/config/i386/gnu-user.h
|
||||
===================================================================
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.
|
||||
{ "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: \
|
||||
Index: b/gcc/config/alpha/linux-elf.h
|
||||
===================================================================
|
||||
--- 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.
|
||||
|
||||
#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: \
|
||||
Index: b/gcc/config/arm/linux-elf.h
|
||||
===================================================================
|
||||
--- 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
|
||||
|
||||
Index: b/gcc/config/mips/gnu-user.h
|
||||
===================================================================
|
||||
--- 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.
|
||||
#undef GNU_USER_TARGET_LINK_SPEC
|
||||
#define GNU_USER_TARGET_LINK_SPEC "\
|
||||
%{G*} %{EB} %{EL} %{mips*} %{shared} \
|
||||
+ -as-needed \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
Index: b/gcc/config/riscv/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/riscv/linux.h
|
||||
+++ b/gcc/config/riscv/linux.h
|
||||
@@ -58,6 +58,7 @@
|
||||
"%{mabi=ilp32:_ilp32}"
|
||||
|
||||
#define LINK_SPEC "\
|
||||
+-as-needed \
|
||||
-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
|
||||
%{mno-relax:--no-relax} \
|
||||
%{shared} \
|
||||
@@ -1,22 +0,0 @@
|
||||
Enable -Wformat and -Wformat-security by default.
|
||||
|
||||
--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100
|
||||
+++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200
|
||||
@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit
|
||||
Warn about format strings that are not literals.
|
||||
|
||||
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
|
||||
@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
|
||||
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.
|
||||
|
||||
Wignored-qualifiers
|
||||
@@ -1,13 +0,0 @@
|
||||
Enable -Wtrampolines by default.
|
||||
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -712,7 +712,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
|
||||
@@ -1,38 +0,0 @@
|
||||
Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
|
||||
Change the buffer size.
|
||||
|
||||
--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
|
||||
+++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
|
||||
@@ -857,6 +857,12 @@ proper position among the other output f
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "%G %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" \
|
||||
@@ -1131,7 +1148,7 @@ static const char *cc1_options =
|
||||
%{-version:--version}\
|
||||
%{-help=*:--help=%*}\
|
||||
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
|
||||
- %{fsyntax-only:-o %j} %{-param*}\
|
||||
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
|
||||
%{coverage:-fprofile-arcs -ftest-coverage}\
|
||||
%{fprofile-arcs|fprofile-generate*|coverage:\
|
||||
%{!fprofile-update=singel:\
|
||||
--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200
|
||||
+++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200
|
||||
@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
|
||||
DEFPARAM (PARAM_SSP_BUFFER_SIZE,
|
||||
"ssp-buffer-size",
|
||||
"The lower bound for a buffer to be considered for stack smashing protection.",
|
||||
- 8, 1, 0)
|
||||
+ 4, 1, 0)
|
||||
|
||||
DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
|
||||
"min-size-for-stack-sharing",
|
||||
@@ -1,39 +0,0 @@
|
||||
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
|
||||
|
||||
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am
|
||||
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am
|
||||
@@ -39,6 +39,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)
|
||||
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in
|
||||
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in
|
||||
@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am
|
||||
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
@@ -1,18 +0,0 @@
|
||||
2008-07-25 Magnus Granberg <zorry@ume.nu>
|
||||
|
||||
* include/libiberty.h (asprintf): Don't declare if defined as a macro
|
||||
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if !HAVE_DECL_VASPRINTF
|
||||
/* Like vsprintf but provides a pointer to malloc'd storage, which
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
https://bugs.gentoo.org/508852
|
||||
https://gcc.gnu.org/PR61164
|
||||
|
||||
2014-04-27 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
#508852
|
||||
* libitm/configure.tgt: Disable FORTIFY
|
||||
|
||||
--- a/libitm/configure.tgt
|
||||
+++ b/libitm/configure.tgt
|
||||
@@ -43,6 +43,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
|
||||
@@ -1,18 +0,0 @@
|
||||
libatomic build failure if configured with --disable-dependency-tracking
|
||||
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
|
||||
|
||||
https://bugs.gentoo.org/463463
|
||||
http://gcc.gnu.org/PR55930
|
||||
|
||||
--- a/libatomic/Makefile.in
|
||||
+++ b/libatomic/Makefile.in
|
||||
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
|
||||
PAT_S = $(word 3,$(PAT_SPLIT))
|
||||
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
|
||||
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
|
||||
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
|
||||
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
|
||||
+@AMDEP_FALSE@M_DEPS =
|
||||
M_SIZE = -DN=$(PAT_N)
|
||||
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
|
||||
M_FILE = $(PAT_BASE)_n.c
|
||||
@@ -1,57 +0,0 @@
|
||||
From 9e3eab51e518018d9d99b3123598b1e2322a6af3 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 24 Oct 2015 20:09:53 +0000
|
||||
Subject: [PATCH 3/6] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386.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.c b/gcc/config/i386/i386.c
|
||||
index 3d044e8..82523e1 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -40269,10 +40269,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 8c2248d..6c82f15 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -485,7 +485,7 @@ __cpu_indicator_init (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if defined SHARED && defined USE_ELF_SYMVER
|
||||
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
|
||||
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
|
||||
+#ifndef SHARED
|
||||
+int __cpu_indicator_init_local (void)
|
||||
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
|
||||
#endif
|
||||
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
|
||||
index 11bb46e..4f47f7b 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.8.1
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
From b6015aca9c9cc83739fd0ed637a835119b2c4e34 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 7 Nov 2015 02:08:05 +0000
|
||||
Subject: [PATCH 5/6] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
gcc/configure.ac | 13 +++++++++++++
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 1c6e340..7e8b5d6 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -29390,6 +29390,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 6c1dcd9..0ca7647 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -6098,6 +6098,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.8.1
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/libffi/closures.c.orig b/libffi/closures.c
|
||||
index 721ff00..22a699c 100644
|
||||
--- a/libffi/src/closures.c.orig
|
||||
+++ 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
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,25 +0,0 @@
|
||||
--- a/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:05.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:08.000000000 +0900
|
||||
@@ -67,15 +67,21 @@ version (CRuntime_Glibc)
|
||||
}
|
||||
else version (CRuntime_Musl)
|
||||
{
|
||||
+ // off_t is always 64 bits on Musl
|
||||
enum _FILE_OFFSET_BITS = 64;
|
||||
|
||||
+ // Not present in Musl sources
|
||||
enum __REDIRECT = false;
|
||||
|
||||
+ // Those three are irrelevant for Musl as it always uses 64 bits off_t
|
||||
enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64;
|
||||
enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT;
|
||||
enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT;
|
||||
|
||||
- enum __WORDSIZE=64;
|
||||
+ version (D_LP64)
|
||||
+ enum __WORDSIZE = 64;
|
||||
+ else
|
||||
+ enum __WORDSIZE = 32;
|
||||
}
|
||||
else version (CRuntime_UClibc)
|
||||
{
|
||||
@@ -1,448 +0,0 @@
|
||||
diff -Nurp a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -779,7 +779,102 @@ else version (CRuntime_Bionic)
|
||||
}
|
||||
else version (CRuntime_Musl)
|
||||
{
|
||||
- enum {
|
||||
+ version (X86_64)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x010000, // octal 0200000
|
||||
+ O_NOFOLLOW = 0x020000, // octal 0400000
|
||||
+ O_DIRECT = 0x004000, // octal 040000
|
||||
+ O_LARGEFILE = 0,
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 5,
|
||||
+ F_SETLK = 6,
|
||||
+ F_SETLKW = 7,
|
||||
+ }
|
||||
+ }
|
||||
+ // Note: Definitions for i386 are in arch/generic/bits/fcntl.h
|
||||
+ else version (X86)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x010000, // octal 0200000
|
||||
+ O_NOFOLLOW = 0x020000, // octal 0400000
|
||||
+ O_DIRECT = 0x004000, // octal 040000
|
||||
+ O_LARGEFILE = 0x008000, // octal 0100000
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 12,
|
||||
+ F_SETLK = 13,
|
||||
+ F_SETLKW = 14,
|
||||
+ }
|
||||
+ }
|
||||
+ else version (ARM)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x004000, // octal 040000
|
||||
+ O_NOFOLLOW = 0x008000, // octal 0100000
|
||||
+ O_DIRECT = 0x010000, // octal 0200000
|
||||
+ O_LARGEFILE = 0x020000, // octal 0400000
|
||||
+ O_TMPFILE = 0x404000, // octal 020040000
|
||||
+
|
||||
+ F_GETLK = 12,
|
||||
+ F_SETLK = 13,
|
||||
+ F_SETLKW = 14,
|
||||
+ }
|
||||
+ }
|
||||
+ else version (AArch64)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x004000, // octal 040000
|
||||
+ O_NOFOLLOW = 0x008000, // octal 0100000
|
||||
+ O_DIRECT = 0x010000, // octal 0200000
|
||||
+ O_LARGEFILE = 0x020000, // octal 0400000
|
||||
+ O_TMPFILE = 0x404000, // octal 020040000
|
||||
+
|
||||
+ F_GETLK = 5,
|
||||
+ F_SETLK = 6,
|
||||
+ F_SETLKW = 7,
|
||||
+ }
|
||||
+ }
|
||||
+ else version (SystemZ)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x010000, // octal 0200000
|
||||
+ O_NOFOLLOW = 0x020000, // octal 0400000
|
||||
+ O_DIRECT = 0x004000, // octal 040000
|
||||
+ O_LARGEFILE = 0x008000, // octal 0100000
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 5,
|
||||
+ F_SETLK = 6,
|
||||
+ F_SETLKW = 7,
|
||||
+ }
|
||||
+ }
|
||||
+ else version (PPC64)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x004000, // octal 040000
|
||||
+ O_NOFOLLOW = 0x008000, // octal 0100000
|
||||
+ O_DIRECT = 0x020000, // octal 0400000
|
||||
+ O_LARGEFILE = 0x010000, // octal 0200000
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 5,
|
||||
+ F_SETLK = 6,
|
||||
+ F_SETLKW = 7,
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ static assert(0, "Platform not supported");
|
||||
+
|
||||
+ enum
|
||||
+ {
|
||||
O_CREAT = 0x40, // octal 0100
|
||||
O_EXCL = 0x80, // octal 0200
|
||||
O_NOCTTY = 0x100, // octal 0400
|
||||
@@ -790,16 +885,11 @@ else version (CRuntime_Musl)
|
||||
O_DSYNC = 0x1000, // octal 010000
|
||||
O_SYNC = 0x101000, // octal 04010000
|
||||
O_RSYNC = O_SYNC,
|
||||
- O_DIRECTORY = 0x10000,
|
||||
- O_NOFOLLOW = 0x20000,
|
||||
O_CLOEXEC = 0x80000,
|
||||
|
||||
O_ASYNC = 0x2000,
|
||||
- O_DIRECT = 0x4000,
|
||||
- O_LARGEFILE = 0,
|
||||
O_NOATIME = 0x40000,
|
||||
O_PATH = 0x200000,
|
||||
- O_TMPFILE = 0x410000,
|
||||
O_NDELAY = O_NONBLOCK,
|
||||
O_SEARCH = O_PATH,
|
||||
O_EXEC = O_PATH,
|
||||
@@ -809,19 +899,19 @@ else version (CRuntime_Musl)
|
||||
O_WRONLY = 01,
|
||||
O_RDWR = 02,
|
||||
}
|
||||
- enum {
|
||||
+ enum
|
||||
+ {
|
||||
F_DUPFD = 0,
|
||||
F_GETFD = 1,
|
||||
F_SETFD = 2,
|
||||
F_GETFL = 3,
|
||||
F_SETFL = 4,
|
||||
- F_GETLK = 5,
|
||||
- F_SETLK = 6,
|
||||
- F_SETLKW = 7,
|
||||
+ // F_GETLK, F_SETLK, F_SETLKW are arch-specific
|
||||
F_SETOWN = 8,
|
||||
F_GETOWN = 9,
|
||||
}
|
||||
- enum {
|
||||
+ enum
|
||||
+ {
|
||||
F_RDLCK = 0,
|
||||
F_WRLCK = 1,
|
||||
F_UNLCK = 2,
|
||||
diff -Nurp a/libphobos/libdruntime/core/sys/posix/semaphore.d b/libphobos/libdruntime/core/sys/posix/semaphore.d
|
||||
--- a/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -143,8 +143,10 @@ else version (CRuntime_Bionic)
|
||||
else version (CRuntime_Musl)
|
||||
{
|
||||
struct sem_t {
|
||||
- int[4*long.sizeof/int.sizeof] __val;
|
||||
+ int[4*c_long.sizeof/int.sizeof] __val;
|
||||
}
|
||||
+
|
||||
+ enum SEM_FAILED = (sem_t*).init;
|
||||
}
|
||||
else version (CRuntime_UClibc)
|
||||
{
|
||||
diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
|
||||
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -1587,31 +1587,225 @@ else version (CRuntime_Musl)
|
||||
S_ISGID = 0x400, // octal 02000
|
||||
S_ISVTX = 0x200, // octal 01000
|
||||
}
|
||||
- struct stat_t {
|
||||
- dev_t st_dev;
|
||||
- ino_t st_ino;
|
||||
- nlink_t st_nlink;
|
||||
-
|
||||
- mode_t st_mode;
|
||||
- uid_t st_uid;
|
||||
- gid_t st_gid;
|
||||
- uint __pad0;
|
||||
- dev_t st_rdev;
|
||||
- off_t st_size;
|
||||
- blksize_t st_blksize;
|
||||
- blkcnt_t st_blocks;
|
||||
-
|
||||
- timespec st_atim;
|
||||
- timespec st_mtim;
|
||||
- timespec st_ctim;
|
||||
- extern(D) @safe @property inout pure nothrow
|
||||
- {
|
||||
- ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
- ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
- ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ version (ARM)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ int __st_dev_padding;
|
||||
+ c_long __st_ino_truncated;
|
||||
+ mode_t st_mode;
|
||||
+ nlink_t st_nlink;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ int __st_rdev_padding;
|
||||
+ off_t st_size;
|
||||
+ blksize_t st_blksize;
|
||||
+ blkcnt_t st_blocks;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+ ino_t st_ino;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else version (AArch64)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ ino_t st_ino;
|
||||
+ mode_t st_mode;
|
||||
+ nlink_t st_nlink;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ c_ulong __pad;
|
||||
+ off_t st_size;
|
||||
+ blksize_t st_blksize;
|
||||
+ int __pad2;
|
||||
+ blkcnt_t st_blocks;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+ uint[2] __unused;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else version (X86_64)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ ino_t st_ino;
|
||||
+ nlink_t st_nlink;
|
||||
+
|
||||
+ mode_t st_mode;
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ uint __pad0;
|
||||
+ dev_t st_rdev;
|
||||
+ off_t st_size;
|
||||
+ blksize_t st_blksize;
|
||||
+ blkcnt_t st_blocks;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+
|
||||
+ c_long[3] __unused;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else version (X86)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ int __st_dev_padding;
|
||||
+ c_long __st_ino_truncated;
|
||||
+ mode_t st_mode;
|
||||
+ nlink_t st_nlink;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ int __st_rdev_padding;
|
||||
+ off_t st_size;
|
||||
+ blksize_t st_blksize;
|
||||
+ blkcnt_t st_blocks;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+ ino_t st_ino;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
}
|
||||
- long[3] __unused;
|
||||
}
|
||||
+ else version (MIPS64)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ int[3] __pad1;
|
||||
+ ino_t st_ino;
|
||||
+ mode_t st_mode;
|
||||
+ nlink_t st_nlink;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ uint[2] __pad2;
|
||||
+ off_t st_size;
|
||||
+ int __pad3;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+ blksize_t st_blksize;
|
||||
+ uint __pad4;
|
||||
+ blkcnt_t st_blocks;
|
||||
+ int[14] __pad5;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else version (PPC64)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ ino_t st_ino;
|
||||
+ nlink_t st_nlink;
|
||||
+ mode_t st_mode;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ off_t st_size;
|
||||
+ blksize_t st_blksize;
|
||||
+ blkcnt_t st_blocks;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+ c_ulong[3] __unused;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else version (SystemZ)
|
||||
+ {
|
||||
+ struct stat_t
|
||||
+ {
|
||||
+ dev_t st_dev;
|
||||
+ ino_t st_ino;
|
||||
+ nlink_t st_nlink;
|
||||
+ mode_t st_mode;
|
||||
+
|
||||
+ uid_t st_uid;
|
||||
+ gid_t st_gid;
|
||||
+ dev_t st_rdev;
|
||||
+ off_t st_size;
|
||||
+
|
||||
+ timespec st_atim;
|
||||
+ timespec st_mtim;
|
||||
+ timespec st_ctim;
|
||||
+
|
||||
+ blksize_t st_blksize;
|
||||
+ blkcnt_t st_blocks;
|
||||
+ c_ulong[3] __unused;
|
||||
+
|
||||
+ extern(D) @safe @property inout pure nothrow
|
||||
+ {
|
||||
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
|
||||
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
|
||||
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ static assert("Unsupported platform");
|
||||
+
|
||||
private
|
||||
{
|
||||
extern (D) bool S_ISTYPE( mode_t mode, uint mask )
|
||||
diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
|
||||
--- a/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
|
||||
@@ -112,8 +112,26 @@ version (CRuntime_Glibc)
|
||||
}
|
||||
else version (CRuntime_Musl)
|
||||
{
|
||||
- alias c_long blksize_t;
|
||||
- alias c_ulong nlink_t;
|
||||
+ version (AArch64)
|
||||
+ {
|
||||
+ alias int blksize_t;
|
||||
+ alias uint nlink_t;
|
||||
+ }
|
||||
+ else version (MIPS64)
|
||||
+ {
|
||||
+ alias c_long blksize_t;
|
||||
+ alias uint nlink_t;
|
||||
+ }
|
||||
+ else version (RISCV64)
|
||||
+ {
|
||||
+ alias int blksize_t;
|
||||
+ alias uint nlink_t;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ alias c_long blksize_t;
|
||||
+ alias c_ulong nlink_t;
|
||||
+ }
|
||||
alias long dev_t;
|
||||
alias long blkcnt_t;
|
||||
alias ulong ino_t;
|
||||
@@ -1,137 +0,0 @@
|
||||
diff -Nurp a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
|
||||
--- a/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -1084,7 +1084,9 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc
|
||||
|
||||
// base offset
|
||||
auto ti = tls_index(mod, 0);
|
||||
- version (IBMZ_Any)
|
||||
+ version (CRuntime_Musl)
|
||||
+ return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz];
|
||||
+ else version (IBMZ_Any)
|
||||
{
|
||||
auto idx = cast(void *)__tls_get_addr_internal(&ti)
|
||||
+ cast(ulong)__builtin_thread_pointer();
|
||||
diff -Nurp a/libphobos/configure.ac b/libphobos/configure.ac
|
||||
--- a/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -140,6 +140,14 @@ case ${host} in
|
||||
esac
|
||||
AC_MSG_RESULT($LIBPHOBOS_SUPPORTED)
|
||||
|
||||
+AC_MSG_CHECKING([if target needs to link in swapcontext])
|
||||
+AC_MSG_RESULT($LIBDRUNTIME_NEEDS_UCONTEXT)
|
||||
+AS_IF([test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes], [
|
||||
+ AC_SEARCH_LIBS([swapcontext], [c ucontext], [], [
|
||||
+ AC_MSG_ERROR([[can't find library providing swapcontext]])
|
||||
+ ])
|
||||
+])
|
||||
+
|
||||
# Decide if it's usable.
|
||||
case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
|
||||
*:no) use_libphobos=no ;;
|
||||
diff -Nurp a/libphobos/configure.tgt b/libphobos/configure.tgt
|
||||
--- a/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -22,6 +22,13 @@
|
||||
# Disable the libphobos or libdruntime components on untested or known
|
||||
# broken systems. More targets shall be added after testing.
|
||||
LIBPHOBOS_SUPPORTED=no
|
||||
+
|
||||
+# Check if we require 'ucontext' or if we have a custom solution.
|
||||
+# Most platform uses a custom assembly solution for context switches,
|
||||
+# see `core.thread` and grep for `AsmExternal`.
|
||||
+# Definitions are in config/ARCH/
|
||||
+LIBPHOBOS_NEEDS_UCONTEXT=no
|
||||
+
|
||||
case "${target}" in
|
||||
aarch64*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
@@ -37,6 +44,7 @@ case "${target}" in
|
||||
;;
|
||||
s390*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
|
||||
;;
|
||||
x86_64-*-kfreebsd*-gnu | i?86-*-kfreebsd*-gnu)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
diff -Nurp a/libphobos/configure b/libphobos/configure
|
||||
--- a/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -13955,6 +13955,76 @@ esac
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPHOBOS_SUPPORTED" >&5
|
||||
$as_echo "$LIBPHOBOS_SUPPORTED" >&6; }
|
||||
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if target needs to link in swapcontext" >&5
|
||||
+$as_echo_n "checking if target needs to link in swapcontext... " >&6; }
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBDRUNTIME_NEEDS_UCONTEXT" >&5
|
||||
+$as_echo "$LIBDRUNTIME_NEEDS_UCONTEXT" >&6; }
|
||||
+if test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes; then :
|
||||
+
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5
|
||||
+$as_echo_n "checking for library containing swapcontext... " >&6; }
|
||||
+if ${ac_cv_search_swapcontext+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_func_search_save_LIBS=$LIBS
|
||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char swapcontext ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return swapcontext ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+for ac_lib in '' c ucontext; do
|
||||
+ if test -z "$ac_lib"; then
|
||||
+ ac_res="none required"
|
||||
+ else
|
||||
+ ac_res=-l$ac_lib
|
||||
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
+ fi
|
||||
+ if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ ac_cv_search_swapcontext=$ac_res
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext
|
||||
+ if ${ac_cv_search_swapcontext+:} false; then :
|
||||
+ break
|
||||
+fi
|
||||
+done
|
||||
+if ${ac_cv_search_swapcontext+:} false; then :
|
||||
+
|
||||
+else
|
||||
+ ac_cv_search_swapcontext=no
|
||||
+fi
|
||||
+rm conftest.$ac_ext
|
||||
+LIBS=$ac_func_search_save_LIBS
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_swapcontext" >&5
|
||||
+$as_echo "$ac_cv_search_swapcontext" >&6; }
|
||||
+ac_res=$ac_cv_search_swapcontext
|
||||
+if test "$ac_res" != no; then :
|
||||
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
+
|
||||
+else
|
||||
+
|
||||
+ as_fn_error $? "can't find library providing swapcontext" "$LINENO" 5
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+
|
||||
# Decide if it's usable.
|
||||
case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
|
||||
*:no) use_libphobos=no ;;
|
||||
@@ -1,411 +0,0 @@
|
||||
diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
|
||||
--- a/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
|
||||
+++ b/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
|
||||
@@ -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)[] b
|
||||
* 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,
|
||||
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,48 +761,39 @@ 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");
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
--- gcc-9.3.0.orig/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
+++ gcc-9.3.0/libphobos/libdruntime/core/sys/posix/fcntl.d
|
||||
@@ -870,6 +870,21 @@
|
||||
F_SETLKW = 7,
|
||||
}
|
||||
}
|
||||
+ else version (MIPS_Any)
|
||||
+ {
|
||||
+ enum
|
||||
+ {
|
||||
+ O_DIRECTORY = 0x010000, // octal 0200000
|
||||
+ O_NOFOLLOW = 0x020000, // octal 0400000
|
||||
+ O_DIRECT = 0x008000, // octal 0100000
|
||||
+ O_LARGEFILE = 0x002000, // octal 0020000
|
||||
+ O_TMPFILE = 0x410000, // octal 020200000
|
||||
+
|
||||
+ F_GETLK = 33,
|
||||
+ F_SETLK = 34,
|
||||
+ F_SETLKW = 35,
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
static assert(0, "Platform not supported");
|
||||
|
||||
--- gcc-9.3.0.orig/libphobos/configure.tgt
|
||||
+++ gcc-9.3.0/libphobos/configure.tgt
|
||||
@@ -38,6 +38,7 @@
|
||||
;;
|
||||
mips*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
|
||||
;;
|
||||
riscv*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
@@ -1,663 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen gcc-armhf
|
||||
# Based on: main/gcc (from Alpine)
|
||||
|
||||
CTARGET_ARCH=armhf
|
||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||
LANG_D=false
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||
# when this variable matches "no*"
|
||||
BOOTSTRAP="nobuildbase"
|
||||
|
||||
# abuild will only cross compile when this variable is set, but it
|
||||
# needs to find a valid package database in there for dependency
|
||||
# resolving, so we set it to /.
|
||||
CBUILDROOT="/"
|
||||
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname="gcc-armhf"
|
||||
pkgver=9.3.0
|
||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname="gcc-armhf"
|
||||
pkgrel=1
|
||||
pkgdesc="Stage2 cross-compiler for armhf"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later LGPL-2.1-or-later"
|
||||
_gccrel=$pkgver-r$pkgrel
|
||||
depends="isl binutils-armhf mpc1"
|
||||
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
||||
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
|
||||
subpackages="g++-armhf:gpp"
|
||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
||||
replaces="libstdc++ binutils"
|
||||
|
||||
: "${LANG_CXX:=true}"
|
||||
: "${LANG_D:=true}"
|
||||
: "${LANG_OBJC:=true}"
|
||||
: "${LANG_GO:=true}"
|
||||
: "${LANG_FORTRAN:=true}"
|
||||
: "${LANG_ADA:=true}"
|
||||
|
||||
_libgomp=true
|
||||
_libgcc=true
|
||||
_libatomic=true
|
||||
_libitm=true
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||
LANG_CXX=false
|
||||
LANG_ADA=false
|
||||
_libgcc=false
|
||||
_builddir="$srcdir/build-cross-pass2"
|
||||
else
|
||||
_builddir="$srcdir/build-cross-final"
|
||||
fi
|
||||
LANG_OBJC=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_D=false
|
||||
_libgomp=false
|
||||
_libatomic=false
|
||||
_libitm=false
|
||||
|
||||
# reset target flags (should be set in crosscreate abuild)
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
STRIP_FOR_TARGET="$CTARGET-strip"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
|
||||
# reset flags and cc for build
|
||||
export CC_FOR_BUILD="gcc"
|
||||
export CXX_FOR_BUILD="g++"
|
||||
export CFLAGS_FOR_BUILD=" "
|
||||
export CXXFLAGS_FOR_BUILD=" "
|
||||
export LDFLAGS_FOR_BUILD=" "
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
# Languages that do not need bootstrapping
|
||||
LANG_OBJC=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_D=false
|
||||
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build-cross-native"
|
||||
else
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build"
|
||||
fi
|
||||
|
||||
# GDC hasn't been ported to PowerPC
|
||||
# See libphobos/configure.tgt in GCC sources for supported targets
|
||||
[ "$CARCH" = ppc64le ] && LANG_D=false
|
||||
|
||||
# Go needs {set,make,swap}context, unimplemented in musl
|
||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
||||
|
||||
# libitm has TEXTRELs in ARM build, so disable for now
|
||||
case "$CTARGET_ARCH" in
|
||||
arm*) _libitm=false ;;
|
||||
mips*) _libitm=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
# currently on x86, x86_64 and ia64
|
||||
_libquadmath=$LANG_FORTRAN
|
||||
case "$CTARGET_ARCH" in
|
||||
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
|
||||
*) _libquadmath=false ;;
|
||||
esac
|
||||
|
||||
# libatomic is a dependency for openvswitch
|
||||
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||
if $_libgomp; then
|
||||
depends="$depends libgomp=$_gccrel"
|
||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||
fi
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
fi
|
||||
if $LANG_D; then
|
||||
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
|
||||
_languages="$_languages,d"
|
||||
makedepends_build="$makedepends_build libucontext-dev"
|
||||
fi
|
||||
if $LANG_OBJC; then
|
||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||
_languages="$_languages,objc"
|
||||
fi
|
||||
if $LANG_GO; then
|
||||
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
||||
_languages="$_languages,go"
|
||||
fi
|
||||
if $LANG_FORTRAN; then
|
||||
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
||||
_languages="$_languages,fortran"
|
||||
fi
|
||||
if $LANG_ADA; then
|
||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
||||
_languages="$_languages,ada"
|
||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||
fi
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
|
||||
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
||||
002_all_default-relro.patch
|
||||
003_all_default-fortify-source.patch
|
||||
005_all_default-as-needed.patch
|
||||
gcc-as-needed-gold.patch
|
||||
011_all_default-warn-format-security.patch
|
||||
012_all_default-warn-trampolines.patch
|
||||
013_all_default-ssp-fix.patch
|
||||
020_all_msgfmt-libstdc++-link.patch
|
||||
050_all_libiberty-asprintf.patch
|
||||
051_all_libiberty-pic.patch
|
||||
053_all_libitm-no-fortify-source.patch
|
||||
090_all_pr55930-dependency-tracking.patch
|
||||
0003-gcc-poison-system-directories.patch
|
||||
|
||||
203-libgcc_s.patch
|
||||
205-nopie.patch
|
||||
0002-posix_memalign.patch
|
||||
0008-s390x-muslldso.patch
|
||||
0010-ldbl128-config.patch
|
||||
0012-static-pie.patch
|
||||
|
||||
libgcc-always-build-gcceh.a.patch
|
||||
gcc-4.9-musl-fortify.patch
|
||||
gcc-6.1-musl-libssp.patch
|
||||
gcc-pure64.patch
|
||||
|
||||
fix-cxxflags-passing.patch
|
||||
ada-shared.patch
|
||||
ada-musl.patch
|
||||
libgnarl-musl.patch
|
||||
|
||||
320-libffi-gnulinux.patch
|
||||
|
||||
gcc-pure64-mips.patch
|
||||
0016-invalid_tls_model.patch
|
||||
|
||||
400-dlang-phobos.patch
|
||||
401-dlang-32bits.patch
|
||||
402-dlang-stat.patch
|
||||
403-dlang-ibmz.patch
|
||||
404-dlang-zlib.patch
|
||||
405-dlang-mips.patch
|
||||
"
|
||||
|
||||
# gcc-4.8-build-args.patch
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
|
||||
_gcclibdir="/usr/lib/gcc/$CTARGET/$pkgver"
|
||||
_gcclibexec="/usr/libexec/gcc/$CTARGET/$pkgver"
|
||||
|
||||
prepare() {
|
||||
cd "$_gccdir"
|
||||
|
||||
_err=
|
||||
for i in $source; do
|
||||
case "$i" in
|
||||
*.patch)
|
||||
msg "Applying $i"
|
||||
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$_err" ]; then
|
||||
error "The following patches failed:"
|
||||
for i in $_err; do
|
||||
echo " $i"
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo ${pkgver} > gcc/BASE-VER
|
||||
}
|
||||
|
||||
build() {
|
||||
local _arch_configure=
|
||||
local _libc_configure=
|
||||
local _bootstrap_configure=
|
||||
local _symvers=
|
||||
|
||||
cd "$_gccdir"
|
||||
|
||||
case "$CTARGET" in
|
||||
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
||||
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
||||
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
||||
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
||||
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
||||
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_LIBC" in
|
||||
musl)
|
||||
# musl does not support mudflap, or libsanitizer
|
||||
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
||||
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
||||
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
||||
_symvers="--disable-symvers"
|
||||
export libat_cv_have_ifunc=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "$BOOTSTRAP" in
|
||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||
esac
|
||||
|
||||
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||
|
||||
msg "Building the following:"
|
||||
echo ""
|
||||
echo " CBUILD=$CBUILD"
|
||||
echo " CHOST=$CHOST"
|
||||
echo " CTARGET=$CTARGET"
|
||||
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
||||
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
||||
echo " languages=$_languages"
|
||||
echo " arch_configure=$_arch_configure"
|
||||
echo " libc_configure=$_libc_configure"
|
||||
echo " cross_configure=$_cross_configure"
|
||||
echo " bootstrap_configure=$_bootstrap_configure"
|
||||
echo " hash_style_configure=$_hash_style_configure"
|
||||
echo ""
|
||||
|
||||
mkdir -p "$_builddir"
|
||||
cd "$_builddir"
|
||||
"$_gccdir"/configure --prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--build=${CBUILD} \
|
||||
--host=${CHOST} \
|
||||
--target=${CTARGET} \
|
||||
--with-pkgversion="Alpine $pkgver" \
|
||||
--enable-checking=release \
|
||||
--disable-fixed-point \
|
||||
--disable-libstdcxx-pch \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
$_symvers \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-default-pie \
|
||||
--enable-default-ssp \
|
||||
--enable-cloog-backend \
|
||||
--enable-languages=$_languages \
|
||||
$_arch_configure \
|
||||
$_libc_configure \
|
||||
$_cross_configure \
|
||||
$_bootstrap_configure \
|
||||
--with-system-zlib \
|
||||
$_hash_style_configure
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make -j1 DESTDIR="$pkgdir" install
|
||||
|
||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||
|
||||
# we dont support gcj -static
|
||||
# and saving 35MB is not bad.
|
||||
find "$pkgdir" \( -name libgtkpeer.a \
|
||||
-o -name libgjsmalsa.a \
|
||||
-o -name libgij.a \) \
|
||||
-delete
|
||||
|
||||
# strip debug info from some static libs
|
||||
find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||
-o -name libgphobos.a -o -name libgdruntime.a \
|
||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||
-a -type f \
|
||||
-exec ${STRIP_FOR_TARGET} -g {} +
|
||||
|
||||
if $_libgomp; then
|
||||
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
if $_libitm; then
|
||||
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
|
||||
# remove ffi
|
||||
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
||||
find "$pkgdir" -name 'ffi*.h' -delete
|
||||
|
||||
local gdblib=${_target:+$CTARGET/}lib
|
||||
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
|
||||
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
|
||||
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
||||
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
||||
done
|
||||
fi
|
||||
|
||||
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
|
||||
|
||||
# move ada runtime libs
|
||||
if $LANG_ADA; then
|
||||
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
|
||||
mv "$i" "$pkgdir"/usr/lib/
|
||||
ln -s ../../../../${i##*/} $i
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# cross-gcc: remove any files that would conflict with the
|
||||
# native gcc package
|
||||
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
|
||||
# libcc1 does not depend on target, don't ship it
|
||||
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
||||
|
||||
# fixup gcc library symlinks to be linker scripts so
|
||||
# linker finds the libs from relocated sysroot
|
||||
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
|
||||
if [ -h "$so" ]; then
|
||||
local _real=$(basename "$(readlink "$so")")
|
||||
rm -f "$so"
|
||||
echo "GROUP ($_real)" > "$so"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# add c89/c99 wrapper scripts
|
||||
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
||||
#!/bin/sh
|
||||
_flavor="-std=c89"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
|
||||
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
||||
#!/bin/sh
|
||||
_flavor="-std=c99"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-std=c99|-std=iso9899:1999) _flavor="";;
|
||||
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||
fi
|
||||
}
|
||||
|
||||
libatomic() {
|
||||
pkgdesc="GCC Atomic library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libcxx() {
|
||||
pkgdesc="GNU C++ standard runtime library"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gpp() {
|
||||
pkgdesc="GNU C++ standard library and compiler"
|
||||
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||
"$subpkgdir"/usr/bin \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
||||
|
||||
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
||||
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
|
||||
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
||||
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
libobjc() {
|
||||
pkgdesc="GNU Objective-C runtime"
|
||||
replaces="objc"
|
||||
depends=
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
objc() {
|
||||
pkgdesc="GNU Objective-C"
|
||||
replaces="gcc"
|
||||
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibdir/include \
|
||||
"$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
||||
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgcc() {
|
||||
pkgdesc="GNU C compiler runtime libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgomp() {
|
||||
pkgdesc="GCC shared-memory parallel programming API library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgphobos() {
|
||||
pkgdesc="D programming language standard library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gdc() {
|
||||
pkgdesc="GCC-based D language compiler"
|
||||
depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev"
|
||||
depends="$depends libucontext-dev"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibdir/include/d/ \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
# Copy: The installed '.d' files, the static lib, the binary itself
|
||||
# The shared libs are part of 'libgphobos' so one can run program
|
||||
# without installing the compiler
|
||||
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
|
||||
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
|
||||
libgo() {
|
||||
pkgdesc="Go runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
go() {
|
||||
pkgdesc="Go support for GCC"
|
||||
depends="gcc=$_gccrel libgo=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/usr/lib/libgo.a \
|
||||
"$pkgdir"/usr/lib/libgo.so \
|
||||
"$pkgdir"/usr/lib/libgobegin.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgfortran() {
|
||||
pkgdesc="Fortran runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libquadmath() {
|
||||
replaces="gcc"
|
||||
pkgdesc="128-bit math library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gfortran() {
|
||||
pkgdesc="GNU Fortran Compiler"
|
||||
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
||||
$_libquadmath && depends="$depends libquadmath=$_gccrel"
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/usr/lib/libgfortran.a \
|
||||
"$pkgdir"/usr/lib/libgfortran.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
if $_libquadmath; then
|
||||
mv "$pkgdir"/usr/lib/libquadmath.a \
|
||||
"$pkgdir"/usr/lib/libquadmath.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
fi
|
||||
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
||||
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
||||
}
|
||||
|
||||
libgnat() {
|
||||
pkgdesc="GNU Ada runtime shared libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gnat() {
|
||||
pkgdesc="Ada support for GCC"
|
||||
depends="gcc=$_gccrel"
|
||||
provides="$pkgname-gnat-bootstrap"
|
||||
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
|
||||
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
sha512sums="4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de gcc-9.3.0.tar.xz
|
||||
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
|
||||
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
|
||||
5e4794d1caddb1050d8935ae5a53ba275b653ad2c9954df89a8c47ac694e6139011829f440eb7e5b24fd57ea25daf25ac83f317871841a78ffb74d167d6f8bf9 005_all_default-as-needed.patch
|
||||
6c9a5068f6eea8a85d297a3555b1d2333ffd4b9ddbfb7560a3e643f8577603871ca123373ef7f96e894225291d88f7bf575c7f8386bcfdd1dabcd7ba12598b65 gcc-as-needed-gold.patch
|
||||
e026bf9f73ee254528423c6cabdfd7794960c567161581b7d4b7c61c45027e12a6efef79662d4288b9cbaecb4798f01af6a5b4a13b766c2d501444ac1846fd43 011_all_default-warn-format-security.patch
|
||||
37de4cc9061bfe1963e6e6570e1a6bbfd58204bf90e0eef819882599a9a80ea28f3eb815c20c1f173dc25d4bd9971b7c7f7f9512d6f8f91f04de1e1175114d4d 012_all_default-warn-trampolines.patch
|
||||
38a0fedeac3eebe4a6a957792ba520225cf42663c96a171cd168fdb6c91ffa9a56b80351f8238c5d03b78d3ae2a6539a54481fe4848b4a395e2c87f2ff7adc08 013_all_default-ssp-fix.patch
|
||||
d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
|
||||
840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
|
||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
|
||||
e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
|
||||
4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
|
||||
707b30c141778fbcb1e37ebb42873cd7971de232a1298f78bbd834fa74d411b7b49cecfe4f247316d7c785da792f95f26ea6d824cd322a8f87b29537af3f77f3 0003-gcc-poison-system-directories.patch
|
||||
d1c2d7ff7f673375dc7cd84ae9d8515853b5af6390c70bb763412c012101344e4ee1ce155151ce3fb6ba2b80af7ed42d697dbe1bf6fd6e7b2b9087a378c47c37 203-libgcc_s.patch
|
||||
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
|
||||
6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch
|
||||
7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch
|
||||
66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
|
||||
d91c5eba37166cf34ca38e03808e3960c091b3627008a0c68c127cdf52e3827f8cfbe478ababe64c3cbb4d5eb8ed6230a21a74b6908549e05e08646de09df37c 0012-static-pie.patch
|
||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
||||
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
|
||||
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
|
||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
||||
cceeac95f47ea8664e1c16c5ebecb472b5aaa56040e943c1b97c7873b50e3a2bf972d9f743d342a2444a3bb711a0720d2446fded43892c5e05bdeefd478b0cd1 ada-musl.patch
|
||||
a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a15074b4cb58edd5d7e2868607c902dd003e8c464d5066fd4a575 libgnarl-musl.patch
|
||||
f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
|
||||
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
|
||||
17e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch
|
||||
38772c5b0905455a44c43d6ef7e5f140530006e2bde9f5ffd6b569c7cf9633992515f666b486d7a78c30ab8da99b92b2775c90fde47821ae542ef1c49dc405df 400-dlang-phobos.patch
|
||||
84bdbdfcb972161765b81220ea2e80e83c32f3ab27596b77eb451d8cac4bd6312210df468581c2b0e1363f5e3b31654e369c47ae84c907f3b54a1786d7c17830 401-dlang-32bits.patch
|
||||
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
|
||||
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
|
||||
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
|
||||
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
|
||||
@@ -1,204 +0,0 @@
|
||||
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
|
||||
index 3b0aea9..ee0bb69 100644
|
||||
--- a/gcc/ada/adaint.c
|
||||
+++ b/gcc/ada/adaint.c
|
||||
@@ -76,6 +76,11 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
#endif
|
||||
+
|
||||
+#if defined (linux)
|
||||
+#define _GNU_SOURCE 1
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
|
||||
#ifdef __PikeOS__
|
||||
#define __BSD_VISIBLE 1
|
||||
@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
|
||||
#endif
|
||||
|
||||
#if defined (__linux__)
|
||||
-#include <sched.h>
|
||||
|
||||
/* glibc versions earlier than 2.7 do not define the routines to handle
|
||||
dynamically allocated CPU sets. For these targets, we use the static
|
||||
@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
|
||||
|
||||
/* Dynamic cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count)
|
||||
{
|
||||
return CPU_ALLOC (count);
|
||||
@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
- CPU_FREE (set);
|
||||
+ CPU_FREE ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count, void *set)
|
||||
{
|
||||
- CPU_ZERO_S (count, set);
|
||||
+ CPU_ZERO_S (count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET_S (cpu - 1, count, set);
|
||||
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
#else /* !CPU_ALLOC */
|
||||
|
||||
/* Static cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
|
||||
+ return xmalloc (sizeof (cpu_set_t));
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
free (set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
- CPU_ZERO (set);
|
||||
+ CPU_ZERO ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET (cpu - 1, set);
|
||||
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
|
||||
}
|
||||
#endif /* !CPU_ALLOC */
|
||||
#endif /* __linux__ */
|
||||
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
|
||||
index 0d12f7e..a063b47 100644
|
||||
--- a/gcc/ada/adaint.h
|
||||
+++ b/gcc/ada/adaint.h
|
||||
@@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void);
|
||||
|
||||
/* Routines for interface to required CPU set primitives */
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
|
||||
+extern void * __gnat_cpu_alloc (size_t);
|
||||
extern size_t __gnat_cpu_alloc_size (size_t);
|
||||
-extern void __gnat_cpu_free (cpu_set_t *);
|
||||
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
|
||||
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
|
||||
+extern void __gnat_cpu_free (void *);
|
||||
+extern void __gnat_cpu_zero (size_t, void *);
|
||||
+extern void __gnat_cpu_set (int, size_t, void *);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
--- a/gcc/ada/Makefile.rtl 2019-05-14 21:18:45.217455681 +0200
|
||||
+++ b/gcc/ada/Makefile.rtl 2019-05-14 21:21:30.686464218 +0200
|
||||
@@ -1521,7 +1521,7 @@
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
g-sercom.adb<libgnat/g-sercom__linux.adb \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
a-exetim.adb<libgnarl/a-exetim__posix.adb \
|
||||
a-exetim.ads<libgnarl/a-exetim__default.ads \
|
||||
s-linux.ads<libgnarl/s-linux.ads \
|
||||
@@ -2073,7 +2073,7 @@
|
||||
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
|
||||
g-sercom.adb<libgnat/g-sercom__linux.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-ppc.ads
|
||||
@@ -2102,7 +2102,7 @@
|
||||
endif
|
||||
|
||||
# ARM linux, GNU eabi
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
|
||||
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<libgnarl/a-intnam__linux.ads \
|
||||
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
|
||||
@@ -2297,7 +2297,7 @@
|
||||
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
|
||||
g-sercom.adb<libgnat/g-sercom__linux.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-ia64.ads
|
||||
@@ -2394,7 +2394,7 @@
|
||||
s-taspri.ads<libgnarl/s-taspri__posix.ads \
|
||||
g-sercom.adb<libgnat/g-sercom__linux.adb \
|
||||
$(TRASYM_DWARF_UNIX_PAIRS) \
|
||||
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
|
||||
+ s-tsmona.adb<libgnat/s-tsmona.adb \
|
||||
$(ATOMICS_TARGET_PAIRS) \
|
||||
$(X86_64_TARGET_PAIRS) \
|
||||
system.ads<libgnat/system-linux-x86.ads
|
||||
--- a/gcc/ada/terminals.c 2019-01-08 10:54:04.000000000 +0100
|
||||
+++ b/gcc/ada/terminals.c 2019-05-15 13:14:09.935742526 +0200
|
||||
@@ -1136,7 +1136,7 @@
|
||||
/* POSIX does not specify how to open the master side of a terminal.Several
|
||||
methods are available (system specific):
|
||||
1- using a cloning device (USE_CLONE_DEVICE)
|
||||
- 2- getpt (USE_GETPT)
|
||||
+ 2- posix_openpt (USE_POSIX_OPENPT)
|
||||
3- openpty (USE_OPENPTY)
|
||||
|
||||
When using the cloning device method, the macro USE_CLONE_DEVICE should
|
||||
@@ -1150,7 +1150,7 @@
|
||||
#if defined (__APPLE__) || defined (BSD)
|
||||
#define USE_OPENPTY
|
||||
#elif defined (__linux__)
|
||||
-#define USE_GETPT
|
||||
+#define USE_POSIX_OPENPT
|
||||
#elif defined (__sun__)
|
||||
#define USE_CLONE_DEVICE "/dev/ptmx"
|
||||
#elif defined (_AIX)
|
||||
@@ -1199,8 +1199,8 @@
|
||||
int master_fd = -1;
|
||||
char *slave_name = NULL;
|
||||
|
||||
-#ifdef USE_GETPT
|
||||
- master_fd = getpt ();
|
||||
+#if defined(USE_POSIX_OPENPT)
|
||||
+ master_fd = posix_openpt(O_RDWR | O_NOCTTY);
|
||||
#elif defined (USE_OPENPTY)
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
@@ -1,30 +0,0 @@
|
||||
Index: b/gcc/ada/link.c
|
||||
===================================================================
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -105,9 +105,9 @@
|
||||
|
||||
#elif defined (__FreeBSD__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -127,9 +127,9 @@
|
||||
|
||||
#elif defined (linux) || defined(__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -1,10 +0,0 @@
|
||||
--- gcc-4.8.1/Makefile.in.orig
|
||||
+++ gcc-4.8.1/Makefile.in
|
||||
@@ -169,6 +169,7 @@
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
@@ -1,11 +0,0 @@
|
||||
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
|
||||
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
|
||||
@@ -146,6 +146,8 @@
|
||||
|
||||
#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
@@ -1,20 +0,0 @@
|
||||
Author: Timo Teräs <timo.teras@iki.fi>
|
||||
|
||||
Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
|
||||
as otherwise we get link failures if some objects are -fstack-protector built
|
||||
and final link happens with -fno-stack-protector. This seems to be the common
|
||||
case when bootstrapping gcc, the piepatches do not seem to fully fix the
|
||||
crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
|
||||
|
||||
--- gcc-6.1.0/gcc/gcc.c.orig
|
||||
+++ gcc-6.1.0/gcc/gcc.c
|
||||
@@ -870,8 +870,7 @@
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
- "|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
+#define LINK_SSP_SPEC "-lssp_nonshared"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
||||
@@ -1,58 +0,0 @@
|
||||
# DP: Use --push-state/--pop-state for gold as well when linking libtsan.
|
||||
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -693,10 +693,10 @@ proper position among the other output f
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libasan:--push-state --no-as-needed}" \
|
||||
" -lasan " \
|
||||
" %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libasan:--pop-state}" \
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -714,10 +714,10 @@ proper position among the other output f
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libtsan:--push-state --no-as-needed}" \
|
||||
" -ltsan " \
|
||||
" %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libtsan:--pop-state}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -735,10 +735,10 @@ proper position among the other output f
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-liblsan:--push-state --no-as-needed}" \
|
||||
" -llsan " \
|
||||
" %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-liblsan:--pop-state}" \
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -754,10 +754,10 @@ proper position among the other output f
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libubsan:--push-state --no-as-needed}" \
|
||||
" -lubsan " \
|
||||
" %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libubsan:--pop-state}" \
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
@@ -1,47 +0,0 @@
|
||||
From b8c4e45d052adc247341066f748421743704b481 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Andreas Svee <me@lochnair.net>
|
||||
Date: Thu, 21 Dec 2017 03:14:33 +0100
|
||||
Subject: [PATCH] Pure 64-bit MIPS
|
||||
|
||||
---
|
||||
gcc/config/mips/mips.h | 8 ++++----
|
||||
gcc/config/mips/t-linux64 | 6 +++---
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
|
||||
index 803ab98e7..afd74752f 100644
|
||||
--- a/gcc/config/mips/mips.h
|
||||
+++ b/gcc/config/mips/mips.h
|
||||
@@ -3330,11 +3330,11 @@ struct GTY(()) machine_function {
|
||||
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
|
||||
need to change these from /lib and /usr/lib. */
|
||||
#if MIPS_ABI_DEFAULT == ABI_N32
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#elif MIPS_ABI_DEFAULT == ABI_64
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#endif
|
||||
|
||||
/* Load store bonding is not supported by micromips and fix_24k. The
|
||||
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
|
||||
index 16c8adf85..bb46204db 100644
|
||||
--- a/gcc/config/mips/t-linux64
|
||||
+++ b/gcc/config/mips/t-linux64
|
||||
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
|
||||
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
|
||||
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
|
||||
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
|
||||
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
|
||||
+ ../lib \
|
||||
+ ../lib32 \
|
||||
+ ../lib
|
||||
--
|
||||
2.15.1
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
--- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
|
||||
+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
|
||||
@@ -34,6 +34,6 @@
|
||||
comma=,
|
||||
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
|
||||
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
|
||||
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
--- ./gcc/config/aarch64/t-aarch64-linux.orig
|
||||
+++ ./gcc/config/aarch64/t-aarch64-linux
|
||||
@@ -22,7 +22,7 @@
|
||||
LIB1ASMFUNCS = _aarch64_sync_cache_range
|
||||
|
||||
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
|
||||
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib
|
||||
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
|
||||
|
||||
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
|
||||
--- ./gcc/config/s390/t-linux64.orig
|
||||
+++ ./gcc/config/s390/t-linux64
|
||||
@@ -7,5 +7,5 @@
|
||||
MULTILIB_OPTIONS = m64/m31
|
||||
MULTILIB_DIRNAMES = 64 32
|
||||
-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
|
||||
--- ./gcc/config/rs6000/t-linux.orig
|
||||
+++ ./gcc/config/rs6000/t-linux
|
||||
@@ -2,7 +2,8 @@
|
||||
# or soft-float.
|
||||
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
|
||||
ifneq (,$(findstring powerpc64,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
else
|
||||
ifneq (,$(findstring spe,$(target)))
|
||||
MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
|
||||
@@ -14,7 +15,8 @@
|
||||
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
|
||||
endif
|
||||
ifneq (,$(findstring powerpc64le,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
endif
|
||||
endif
|
||||
|
||||
--- ./gcc/config/rs6000/t-linux64.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64
|
||||
@@ -28,8 +28,8 @@
|
||||
MULTILIB_OPTIONS := m64/m32
|
||||
MULTILIB_DIRNAMES := 64 32
|
||||
MULTILIB_EXTRA_OPTS :=
|
||||
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
|
||||
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
|
||||
$(COMPILE) $<
|
||||
--- ./gcc/config/rs6000/t-linux64bele.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64bele
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mlittle
|
||||
MULTILIB_DIRNAMES += le
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
--- ./gcc/config/rs6000/t-linux64lebe.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64lebe
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mbig
|
||||
MULTILIB_DIRNAMES += be
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
@@ -1,39 +0,0 @@
|
||||
Highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
|
||||
diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
|
||||
--- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
|
||||
+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
|
||||
@@ -772,8 +772,9 @@
|
||||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
|
||||
+all: libgcc_eh.a
|
||||
ifeq ($(enable_shared),yes)
|
||||
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
|
||||
+all: libgcc_s$(SHLIB_EXT)
|
||||
ifneq ($(LIBUNWIND),)
|
||||
all: libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
@@ -950,10 +951,6 @@
|
||||
install-shared:
|
||||
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
|
||||
|
||||
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
-
|
||||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
|
||||
@shlib_base_name@,libgcc_s,$(subst \
|
||||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
|
||||
@@ -968,6 +965,10 @@
|
||||
chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
|
||||
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+
|
||||
parts="$(INSTALL_PARTS)"; \
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
@@ -1,120 +0,0 @@
|
||||
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
--- gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800
|
||||
+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700
|
||||
@@ -394,12 +394,6 @@ package System.OS_Interface is
|
||||
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
|
||||
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
|
||||
|
||||
- function pthread_rwlockattr_setkind_np
|
||||
- (attr : access pthread_rwlockattr_t;
|
||||
- pref : int) return int;
|
||||
- pragma Import
|
||||
- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
|
||||
-
|
||||
function pthread_rwlock_init
|
||||
(mutex : access pthread_rwlock_t;
|
||||
attr : access pthread_rwlockattr_t) return int;
|
||||
@@ -464,11 +458,6 @@ package System.OS_Interface is
|
||||
protocol : int) return int;
|
||||
pragma Import (C, pthread_mutexattr_setprotocol);
|
||||
|
||||
- function pthread_mutexattr_setprioceiling
|
||||
- (attr : access pthread_mutexattr_t;
|
||||
- prioceiling : int) return int;
|
||||
- pragma Import (C, pthread_mutexattr_setprioceiling);
|
||||
-
|
||||
type struct_sched_param is record
|
||||
sched_priority : int; -- scheduling priority
|
||||
end record;
|
||||
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
--- gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800
|
||||
+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800
|
||||
@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
|
||||
pragma Import
|
||||
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
|
||||
|
||||
- function GNAT_has_cap_sys_nice return C.int;
|
||||
- pragma Import
|
||||
- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice");
|
||||
-- We do not have pragma Linker_Options ("-lcap"); here, because this
|
||||
-- library is not present on many Linux systems. 'libcap' is the Linux
|
||||
-- "capabilities" library, called by __gnat_has_cap_sys_nice.
|
||||
@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
|
||||
-- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
|
||||
-- GNU/Linux, so we map 0 .. 98 to 1 .. 99.
|
||||
|
||||
- function Get_Ceiling_Support return Boolean;
|
||||
- -- Get the value of the Ceiling_Support constant (see below).
|
||||
- -- Note well: If this function or related code is modified, it should be
|
||||
- -- tested by hand, because automated testing doesn't exercise it.
|
||||
-
|
||||
- -------------------------
|
||||
- -- Get_Ceiling_Support --
|
||||
- -------------------------
|
||||
-
|
||||
- function Get_Ceiling_Support return Boolean is
|
||||
- Ceiling_Support : Boolean := False;
|
||||
- begin
|
||||
- if Locking_Policy /= 'C' then
|
||||
- return False;
|
||||
- end if;
|
||||
-
|
||||
- declare
|
||||
- function geteuid return Integer;
|
||||
- pragma Import (C, geteuid, "geteuid");
|
||||
- Superuser : constant Boolean := geteuid = 0;
|
||||
- Has_Cap : constant C.int := GNAT_has_cap_sys_nice;
|
||||
- pragma Assert (Has_Cap in 0 | 1);
|
||||
- begin
|
||||
- Ceiling_Support := Superuser or else Has_Cap = 1;
|
||||
- end;
|
||||
-
|
||||
- return Ceiling_Support;
|
||||
- end Get_Ceiling_Support;
|
||||
-
|
||||
- pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
|
||||
- Ceiling_Support : constant Boolean := Get_Ceiling_Support;
|
||||
- pragma Warnings (On, "non-static call not allowed in preelaborated unit");
|
||||
-- True if the locking policy is Ceiling_Locking, and the current process
|
||||
-- has permission to use this policy. The process has permission if it is
|
||||
-- running as 'root', or if the capability was set by the setcap command,
|
||||
@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
|
||||
-- Init_Mutex --
|
||||
----------------
|
||||
|
||||
+ pragma Warnings (Off, "formal parameter * is not referenced");
|
||||
function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is
|
||||
+ pragma Warnings (On, "formal parameter * is not referenced");
|
||||
Mutex_Attr : aliased pthread_mutexattr_t;
|
||||
Result, Result_2 : C.int;
|
||||
|
||||
@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
|
||||
return Result;
|
||||
end if;
|
||||
|
||||
- if Ceiling_Support then
|
||||
- Result := pthread_mutexattr_setprotocol
|
||||
- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT);
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
- Result := pthread_mutexattr_setprioceiling
|
||||
- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio));
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
- elsif Locking_Policy = 'I' then
|
||||
+ if Locking_Policy = 'I' then
|
||||
Result := pthread_mutexattr_setprotocol
|
||||
(Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
|
||||
pragma Assert (Result = 0);
|
||||
@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
|
||||
Result := pthread_rwlockattr_init (RWlock_Attr'Access);
|
||||
pragma Assert (Result = 0);
|
||||
|
||||
- Result := pthread_rwlockattr_setkind_np
|
||||
- (RWlock_Attr'Access,
|
||||
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
|
||||
- pragma Assert (Result = 0);
|
||||
-
|
||||
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
|
||||
|
||||
pragma Assert (Result in 0 | ENOMEM);
|
||||
@@ -0,0 +1,22 @@
|
||||
Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
|
||||
Reason: GDC produced errors about duplicate symbols when the same interface
|
||||
was implemented by two classes in the same project.
|
||||
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
|
||||
index 3824060..7afb1aa 100644 (file)
|
||||
--- a/gcc/d/decl.cc
|
||||
+++ b/gcc/d/decl.cc
|
||||
@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
|
||||
|
||||
DECL_CONTEXT (thunk) = d_decl_context (decl);
|
||||
|
||||
- /* Thunks inherit the public access of the function they are targetting. */
|
||||
- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
|
||||
+ /* Thunks inherit the public access of the function they are targetting.
|
||||
+ When the function is outside the current compilation unit however, then the
|
||||
+ thunk must be kept private to not conflict. */
|
||||
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
|
||||
+
|
||||
DECL_EXTERNAL (thunk) = 0;
|
||||
|
||||
/* Thunks are always addressable. */
|
||||
@@ -30,7 +30,7 @@ pkgver=9.3.0
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname="gcc-armv7"
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for armv7"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
@@ -214,6 +214,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
|
||||
403-dlang-ibmz.patch
|
||||
404-dlang-zlib.patch
|
||||
405-dlang-mips.patch
|
||||
406-dlang-fix-interface-visibility.patch
|
||||
"
|
||||
|
||||
# gcc-4.8-build-args.patch
|
||||
@@ -438,6 +439,10 @@ done
|
||||
exec gcc $_flavor ${1+"$@"}
|
||||
EOF
|
||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||
|
||||
# install lto plugin so regular binutils may use it
|
||||
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
|
||||
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -660,4 +665,5 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
|
||||
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
|
||||
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
|
||||
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
|
||||
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
|
||||
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch
|
||||
c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch"
|
||||
@@ -1,156 +0,0 @@
|
||||
2013-12-30 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/configure.ac Add --enable-esp and define ENABLE_ESP.
|
||||
Check if we support crtbeginP and define ENABLE_CRTBEGINP.
|
||||
* gcc/configure Regenerated
|
||||
|
||||
|
||||
--- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100
|
||||
+++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200
|
||||
@@ -5130,6 +5237,55 @@ if test x"${LINKER_HASH_STYLE}" != x; th
|
||||
[The linker hash style])
|
||||
fi
|
||||
|
||||
+# --------------
|
||||
+# Esp checks
|
||||
+# --------------
|
||||
+
|
||||
+# Check whether --enable-esp was given and target have the support.
|
||||
+AC_ARG_ENABLE([esp],
|
||||
+[AS_HELP_STRING([--enable-esp],
|
||||
+ [Enable Stack protector and Position independent executable as
|
||||
+ default if we have suppot for it when compiling
|
||||
+ and link with -z now as default.
|
||||
+ Linux targets supported i*86, x86_64, x32,
|
||||
+ powerpc, powerpc64, ia64, arm and mips.])],
|
||||
+ enable_esp=$enableval,
|
||||
+ enable_esp=no)
|
||||
+if test $enable_esp = yes ; then
|
||||
+ AC_MSG_CHECKING(if $target support esp)
|
||||
+ case "$target" in
|
||||
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips-*-linux* | arm*-*-linux* | ia64-*-linux*)
|
||||
+ enable_esp=yes
|
||||
+ AC_DEFINE(ENABLE_ESP, 1,
|
||||
+ [Define if your target support esp and you have enable it.])
|
||||
+ ;;
|
||||
+ *)
|
||||
+ enable_esp=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+AC_MSG_RESULT($enable_esp)
|
||||
+fi
|
||||
+AC_SUBST([enable_esp])
|
||||
+if test $enable_esp = yes ; then
|
||||
+ AC_MSG_CHECKING(checking for crtbeginP.o support)
|
||||
+ if test x$enable_esp = xyes ; then
|
||||
+ case "$target" in
|
||||
+ ia64*-*-linux*)
|
||||
+ enable_crtbeginP=no ;;
|
||||
+ *-*-linux*)
|
||||
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
|
||||
+ enable_crtbeginP=yes
|
||||
+ AC_DEFINE(ENABLE_CRTBEGINP, 1,
|
||||
+ [Define if your compiler will support crtbeginP.])
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *) enable_crtbeginP=no ;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ AC_MSG_RESULT($enable_crtbeginP)
|
||||
+fi
|
||||
+AC_SUBST([enable_crtbeginP])
|
||||
+
|
||||
# Configure the subdirectories
|
||||
# AC_CONFIG_SUBDIRS($subdirs)
|
||||
|
||||
--- a/gcc/configure 2013-02-01 21:26:24.000000000 +0100
|
||||
+++ b/gcc/configure 2013-02-12 01:59:20.000000000 +0100
|
||||
@@ -600,6 +600,8 @@
|
||||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
PICFLAG
|
||||
+enable_crtbeginP
|
||||
+enable_esp
|
||||
enable_host_shared
|
||||
enable_plugin
|
||||
pluginlibs
|
||||
@@ -920,6 +922,7 @@
|
||||
enable_plugin
|
||||
enable_libquadmath_support
|
||||
with_linker_hash_style
|
||||
+enable_esp
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1633,6 +1636,11 @@
|
||||
--enable-plugin enable plugin support
|
||||
--disable-libquadmath-support
|
||||
disable libquadmath support for Fortran
|
||||
+ --enable-esp Enable Stack protector and Position independent
|
||||
+ executable as default if we have suppot for it when
|
||||
+ compiling and link with -z now as default.
|
||||
+ Linux targets supported i*86, x86_64, x32,
|
||||
+ powerpc, powerpc64, ia64, arm and mips.
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@@ -27419,6 +27427,59 @@
|
||||
|
||||
fi
|
||||
|
||||
+# --------------
|
||||
+# Esp checks
|
||||
+# --------------
|
||||
+
|
||||
+# Check whether --enable-esp was given and target have the support.
|
||||
+# Check whether --enable-esp was given.
|
||||
+if test "${enable_esp+set}" = set; then :
|
||||
+ enableval=$enable_esp; enable_esp=$enableval
|
||||
+else
|
||||
+ enable_esp=no
|
||||
+fi
|
||||
+
|
||||
+if test $enable_esp = yes ; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $target support esp" >&5
|
||||
+$as_echo_n "checking if $target support esp... " >&6; }
|
||||
+ case "$target" in
|
||||
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips*-*-linux* | arm*-*-linux* | ia64-*-linux*)
|
||||
+ enable_esp=yes
|
||||
+
|
||||
+$as_echo "#define ENABLE_ESP 1" >>confdefs.h
|
||||
+
|
||||
+ ;;
|
||||
+ *)
|
||||
+ enable_esp=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_esp" >&5
|
||||
+$as_echo "$enable_esp" >&6; }
|
||||
+fi
|
||||
+
|
||||
+if test $enable_esp = yes ; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for crtbeginP.o support" >&5
|
||||
+$as_echo_n "checking checking for crtbeginP.o support... " >&6; }
|
||||
+ if test x$enable_esp = xyes ; then
|
||||
+ case "$target" in
|
||||
+ ia64*-*-linux*)
|
||||
+ enable_crtbeginP=no ;;
|
||||
+ *-*-linux*)
|
||||
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
|
||||
+ enable_crtbeginP=yes
|
||||
+
|
||||
+$as_echo "#define ENABLE_CRTBEGINP 1" >>confdefs.h
|
||||
+
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *) enable_crtbeginP=no ;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crtbeginP" >&5
|
||||
+$as_echo "$enable_crtbeginP" >&6; }
|
||||
+fi
|
||||
+
|
||||
+
|
||||
# Configure the subdirectories
|
||||
# AC_CONFIG_SUBDIRS($subdirs)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
2013-02-13 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config.in Add ENABLE_CRTBEGINP, ENABLE_ESP
|
||||
|
||||
--- ./gcc/config.in 2009-04-21 11:08:08.000000000 +0200
|
||||
+++ ./gcc/config.in 2009-05-12 00:10:08.000000000 +0200
|
||||
@@ -46,6 +46,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to 1 to enable crtbeginP.o. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_CRTBEGINP
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define to 1 to specify that we are using the BID decimal floating point
|
||||
format instead of DPD */
|
||||
#ifndef USED_FOR_TARGET
|
||||
@@ -65,6 +65,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to 1 to enable esp. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_ESP
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define to 1 to enable fixed-point arithmetic extension to C. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef ENABLE_FIXED_POINT
|
||||
@@ -1,96 +0,0 @@
|
||||
2012-01-17 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
|
||||
ALL_CXXFLAGS if enable_esp yes.
|
||||
Echo enable_esp and enable_crtbeginP to tmp-libgcc.mvars.
|
||||
* libgcc/Makefile.in Add crtbeginP.o to EXTRA_PARTS if enable_crtbeginP yes
|
||||
We add new file crtbeginP.o if enable_crtbeginP yes
|
||||
Add -fno-PIE. to CRTSTUFF_CFLAGS.
|
||||
|
||||
--- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
|
||||
+++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
|
||||
@@ -247,6 +247,14 @@ LINKER_FLAGS = $(CFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
+# We don't want to compile the compiler with -fPIE, it make PCH fail.
|
||||
+enable_esp = @enable_esp@
|
||||
+ifeq ($(enable_esp),yes)
|
||||
+ESP_NOPIE_CFLAGS = -fno-PIE
|
||||
+else
|
||||
+ESP_NOPIE_CFLAGS=
|
||||
+endif
|
||||
+
|
||||
# -------------------------------------------
|
||||
# Programs which operate on the build machine
|
||||
# -------------------------------------------
|
||||
@@ -974,12 +982,13 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
|
||||
|
||||
# This is the variable actually used when we compile. If you change this,
|
||||
# you probably want to update BUILD_CFLAGS in configure.ac
|
||||
-ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
|
||||
+ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
|
||||
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
|
||||
|
||||
# The C++ version.
|
||||
-ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
|
||||
- $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
|
||||
+ALL_CXXFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \
|
||||
+ $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \
|
||||
+ $(WARN_CXXFLAGS) @DEFS@
|
||||
|
||||
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
|
||||
# puts -I options in CPPFLAGS, our include files in the srcdir will always
|
||||
@@ -1814,6 +1823,8 @@ libgcc.mvars: config.status Makefile spe
|
||||
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
|
||||
+ echo enable_esp = '$(enable_esp)' >> tmp-libgcc.mvars
|
||||
+ echo enable_crtbeginP = '@enable_crtbeginP@' >> tmp-libgcc.mvars
|
||||
|
||||
mv tmp-libgcc.mvars libgcc.mvars
|
||||
|
||||
--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
|
||||
+++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
|
||||
@@ -219,6 +219,17 @@ else
|
||||
DECNUMINC =
|
||||
endif
|
||||
|
||||
+ifeq ($(enable_esp),yes)
|
||||
+ESP_NOPIE_CFLAGS = -fno-PIE
|
||||
+else
|
||||
+ESP_NOPIE_CFLAGS=
|
||||
+endif
|
||||
+
|
||||
+# We add crtbeginP.o to the EXTRA_PARTS list if enable_crtbeginP = yes
|
||||
+ifeq ($(enable_crtbeginP),yes)
|
||||
+EXTRA_PARTS += crtbeginP.o
|
||||
+endif
|
||||
+
|
||||
# Options to use when compiling libgcc2.a.
|
||||
#
|
||||
LIBGCC2_DEBUG_CFLAGS = -g
|
||||
@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
|
||||
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
|
||||
-finhibit-size-directive -fno-inline -fno-exceptions \
|
||||
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
|
||||
- -fno-stack-protector \
|
||||
+ -fno-stack-protector $(ESP_NOPIE_CFLAGS) \
|
||||
$(INHIBIT_LIBC_CFLAGS)
|
||||
|
||||
# Extra flags to use when compiling crt{begin,end}.o.
|
||||
@@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
|
||||
# This is a version of crtbegin for -static links.
|
||||
crtbeginT$(objext): $(srcdir)/crtstuff.c
|
||||
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
|
||||
+
|
||||
+# This is a version of crtbegin for -static -fPIE links.
|
||||
+ifeq ($(enable_crtbeginP),yes)
|
||||
+crtbeginP$(objext): $(srcdir)/crtstuff.c
|
||||
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
|
||||
+ -c $< -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
|
||||
+endif
|
||||
|
||||
ifeq ($(enable_vtable_verify),yes)
|
||||
# These are used in vtable verification; see comments in source files for
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
2013-03-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/gcc.c include esp.h
|
||||
static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
|
||||
|
||||
--- ./gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
|
||||
+++ ./gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "opts.h"
|
||||
#include "params.h"
|
||||
#include "vec.h"
|
||||
+#include "config/esp.h" /* for --enable-esp support */
|
||||
#include "filenames.h"
|
||||
|
||||
/* By default there is no special suffix for target executables. */
|
||||
@@ -822,7 +823,9 @@
|
||||
|
||||
static const char *asm_debug;
|
||||
static const char *cpp_spec = CPP_SPEC;
|
||||
+#ifndef ENABLE_ESP
|
||||
static const char *cc1_spec = CC1_SPEC;
|
||||
+#endif
|
||||
static const char *cc1plus_spec = CC1PLUS_SPEC;
|
||||
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
|
||||
static const char *link_ssp_spec = LINK_SSP_SPEC;
|
||||
@@ -1,31 +0,0 @@
|
||||
Enable -D_FORTIFY_SOURCE=2 by default.
|
||||
|
||||
Original patch from:
|
||||
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
|
||||
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
+ /* Fortify Source enabled by default w/optimization. */
|
||||
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
|
||||
+
|
||||
/* Misc. */
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
--- a/gcc/doc/gcc.info
|
||||
+++ b/gcc/doc/gcc.info
|
||||
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
|
||||
Please note the warning under '-fgcse' about invoking '-O2' on
|
||||
programs that use computed gotos.
|
||||
|
||||
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
|
||||
+ activated when `-Os' or `-O1' or higher is used. This enables additional
|
||||
+ compile-time and run-time checks for several libc functions. To disable,
|
||||
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
|
||||
+
|
||||
'-O3'
|
||||
Optimize yet more. '-O3' turns on all optimizations specified by
|
||||
'-O2' and also turns on the '-finline-functions',
|
||||
@@ -1,24 +0,0 @@
|
||||
Enable -Wtrampolines by default.
|
||||
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -640,7 +640,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers
|
||||
|
||||
Wtrampolines
|
||||
-Common Var(warn_trampolines) Warning
|
||||
+Common Var(warn_trampolines) Init(1) Warning
|
||||
Warn whenever a trampoline is generated
|
||||
|
||||
Wtype-limits
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -4007,6 +4007,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
|
||||
for most targets, it is made up of code and thus requires the stack
|
||||
to be made executable in order for the program to work properly.
|
||||
|
||||
+ This warning is enabled by default in Gentoo.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
@@ -1,17 +0,0 @@
|
||||
libgfortran does not respect --disable-werror
|
||||
|
||||
https://bugs.gentoo.org/433435
|
||||
http://gcc.gnu.org/PR54724
|
||||
|
||||
|
||||
--- a/libgfortran/configure
|
||||
+++ b/libgfortran/configure
|
||||
@@ -5764,7 +5764,7 @@ fi
|
||||
|
||||
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
|
||||
if test "x$GCC" = "xyes"; then
|
||||
- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
|
||||
+ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
|
||||
## We like to use C99 routines when available. This makes sure that
|
||||
## __STDC_VERSION__ is set such that libc includes make them available.
|
||||
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
|
||||
@@ -1,16 +0,0 @@
|
||||
2012-01-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/common.opt Add -nopie
|
||||
|
||||
--- a/gcc/common.opt 2011-11-23 19:51:17.000000000 +0100
|
||||
+++ b//gcc/common.opt 2012-01-24 16:56:24.302224357 +0100
|
||||
@@ -2280,6 +2280,9 @@ Driver
|
||||
nodefaultlibs
|
||||
Driver
|
||||
|
||||
+nopie
|
||||
+Driver
|
||||
+
|
||||
nostartfiles
|
||||
Driver
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
libgomp does not respect --disable-werror
|
||||
|
||||
https://bugs.gentoo.org/229059
|
||||
http://gcc.gnu.org/PR38436
|
||||
|
||||
|
||||
--- a/libgomp/configure
|
||||
+++ b/libgomp/configure
|
||||
@@ -4282,7 +4282,7 @@ save_CFLAGS="$CFLAGS"
|
||||
|
||||
# Add -Wall -Werror if we are using GCC.
|
||||
if test "x$GCC" = "xyes"; then
|
||||
- XCFLAGS="$XCFLAGS -Wall -Werror"
|
||||
+ XCFLAGS="$XCFLAGS -Wall"
|
||||
fi
|
||||
|
||||
# Find other programs we need.
|
||||
@@ -1,40 +0,0 @@
|
||||
2014-04-23 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/gnu-user.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
|
||||
* gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
|
||||
|
||||
--- a/gcc/config/gnu-user.h 2014-01-02 23:23:26.000000000 +0100
|
||||
+++ b/gcc/config/gnu-user.h 2014-04-23 00:55:06.390265454 +0200
|
||||
@@ -40,7 +40,15 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
provides part of the support for getting C++ file-scope static
|
||||
object constructed before entering `main'. */
|
||||
|
||||
-#if defined HAVE_LD_PIE
|
||||
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
|
||||
+#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
+ crti.o%s %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}; \
|
||||
+ shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
+ %{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_start.o%s}"
|
||||
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
--- a/gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
|
||||
+++ b/gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
|
||||
@@ -883,7 +883,12 @@
|
||||
%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
|
||||
%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
|
||||
|
||||
-#ifdef HAVE_LD_PIE
|
||||
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
|
||||
+#define STARTFILE_LINUX_SPEC "\
|
||||
+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
+%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
+%{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
|
||||
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
|
||||
#define STARTFILE_LINUX_SPEC "\
|
||||
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
@@ -1,44 +0,0 @@
|
||||
2014-04-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
|
||||
-fPIE/-fpie when --enable-esp is enable, this options is on by default.
|
||||
|
||||
--- a/gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
|
||||
+++ b/gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
|
||||
@@ -9233,6 +9245,11 @@ If a guard check fails, an error message
|
||||
@opindex fstack-protector-all
|
||||
Like @option{-fstack-protector} except that all functions are protected.
|
||||
|
||||
+NOTE: NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector},
|
||||
+@option{-nostdlib}, @option{-ffreestanding}, @option{-fstack-protector},
|
||||
+@option{-fstack-protector-strong}or @option{-fstack-protector-all}are found.
|
||||
+
|
||||
@item -fstack-protector-strong
|
||||
@opindex fstack-protector-strong
|
||||
Like @option{-fstack-protector} but includes additional functions to
|
||||
@@ -7960,6 +7965,12 @@
|
||||
that were used to generate code (@option{-fpie}, @option{-fPIE},
|
||||
or model suboptions) when you specify this option.
|
||||
|
||||
+NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
|
||||
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
|
||||
+@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
|
||||
+are found.
|
||||
+
|
||||
@item -rdynamic
|
||||
@opindex rdynamic
|
||||
Pass the flag @option{-export-dynamic} to the ELF linker, on targets
|
||||
@@ -15889,6 +15910,11 @@
|
||||
@code{__pie__} and @code{__PIE__}. The macros have the value 1
|
||||
for @option{-fpie} and 2 for @option{-fPIE}.
|
||||
|
||||
+NOTE: When --enable-esp this option is enabled by default
|
||||
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
|
||||
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
|
||||
+@option{-nostartfiles} or @option{-shared} are found.
|
||||
+
|
||||
@item -fno-jump-tables
|
||||
@opindex fno-jump-tables
|
||||
Do not use jump tables for switch statements even where it would be
|
||||
@@ -1,56 +0,0 @@
|
||||
2013-03-24 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
|
||||
* gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
* gcc/config/i386/i386.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
|
||||
--- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100
|
||||
+++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100
|
||||
@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
/* Static stack checking is supported by means of probes. */
|
||||
#define STACK_CHECK_STATIC_BUILTIN 1
|
||||
+
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
|
||||
+#endif
|
||||
--- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
|
||||
+++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
|
||||
@@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
|
||||
"--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
|
||||
+ ESP_EXTRA_SPECS
|
||||
+#else
|
||||
+#define SUBTARGET_EXTRA_SPECS \
|
||||
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
+#endif
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
|
||||
--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
|
||||
+++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
|
||||
@@ -617,13 +617,16 @@ enum target_cpu_default
|
||||
Do not define this macro if it does not need to do anything. */
|
||||
|
||||
#ifndef SUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
|
||||
+#else
|
||||
#define SUBTARGET_EXTRA_SPECS
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define EXTRA_SPECS \
|
||||
{ "cc1_cpu", CC1_CPU_SPEC }, \
|
||||
SUBTARGET_EXTRA_SPECS
|
||||
-
|
||||
|
||||
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
|
||||
FPU, assume that the fpcw is set to extended precision; when using
|
||||
@@ -1,35 +0,0 @@
|
||||
2013-06-03 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
|
||||
* gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
|
||||
|
||||
--- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100
|
||||
+++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100
|
||||
@@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu
|
||||
# define MCPU_MTUNE_NATIVE_SPECS ""
|
||||
#endif
|
||||
|
||||
-#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
|
||||
-
|
||||
+#ifdef ENABLE_ESP
|
||||
+# define DRIVER_SELF_SPECS \
|
||||
+ MCPU_MTUNE_NATIVE_SPECS, \
|
||||
+ ESP_DRIVER_SELF_SPEC
|
||||
+#else
|
||||
+# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
|
||||
+#endif
|
||||
#endif /* ! GCC_ARM_H */
|
||||
--- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100
|
||||
+++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200
|
||||
@@ -49,7 +49,11 @@
|
||||
#endif
|
||||
|
||||
#undef SUBSUBTARGET_EXTRA_SPECS
|
||||
+#ifdef ENABLE_ESP
|
||||
+#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
|
||||
+#else
|
||||
#define SUBSUBTARGET_EXTRA_SPECS
|
||||
+#endif
|
||||
|
||||
#ifndef ASM_SPEC
|
||||
#define ASM_SPEC "\
|
||||
@@ -1,135 +0,0 @@
|
||||
2014-05-12 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
* gcc/esp.h New file to support --enable-esp
|
||||
Version 20140512.1
|
||||
|
||||
--- a/gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200
|
||||
+++ b/gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200
|
||||
@@ -0,0 +1,127 @@
|
||||
+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
|
||||
+ * Version 20140512.1
|
||||
+ * Magnus Granberg (Zorry) <zorry@gentoo.org> */
|
||||
+#ifndef GCC_ESP_H
|
||||
+#define GCC_ESP_H
|
||||
+
|
||||
+/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
|
||||
+ as default if the defines and the spec allow it.
|
||||
+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
|
||||
+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
|
||||
+ This will add some unsupported upstream commands options as -nopie and -nonow.
|
||||
+ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check when building kernels.
|
||||
+ ESP_CC1_SPEC is added to CC1_SPEC.
|
||||
+ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
|
||||
+ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
|
||||
+ ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
|
||||
+*/
|
||||
+#ifdef ENABLE_ESP
|
||||
+
|
||||
+ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
|
||||
+ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
|
||||
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
|
||||
+ #else
|
||||
+ #define ESP_CC1_SSP_SPEC ""
|
||||
+ #endif
|
||||
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_CC1_PIE_SPEC "%{!nopie: }"
|
||||
+ #else
|
||||
+ #define ESP_CC1_PIE_SPEC ""
|
||||
+ #endif
|
||||
+ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
|
||||
+
|
||||
+ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
|
||||
+ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
|
||||
+ Don't remove the specs in the end */
|
||||
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
|
||||
+ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
|
||||
+
|
||||
+ /* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
|
||||
+ #define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
|
||||
+ %(esp_link_pie)} %(esp_options_ssp) }"
|
||||
+
|
||||
+ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
+ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
|
||||
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
+ #define ESP_OPTIONS_SSP_SPEC \
|
||||
+ "%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
|
||||
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
|
||||
+ %{fstack-check|fstack-check=*:;: -fstack-check}"
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_SSP_SPEC ""
|
||||
+ #endif
|
||||
+
|
||||
+ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
|
||||
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
|
||||
+
|
||||
+ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
|
||||
+ -nostdlib -nostartfiles. */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_OPTIONS_PIE_SPEC \
|
||||
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
|
||||
+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_PIE_SPEC \
|
||||
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
|
||||
+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
|
||||
+ -nostartfiles */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static
|
||||
+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_LINK_PIE_SPEC \
|
||||
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
|
||||
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
|
||||
+ #else
|
||||
+ #define ESP_LINK_PIE_SPEC \
|
||||
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
|
||||
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
|
||||
+ "-pie and (static)|pg|p|profile are incompatible when linking" */
|
||||
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC \
|
||||
+ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
|
||||
+ #else
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC \
|
||||
+ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
|
||||
+ #endif
|
||||
+
|
||||
+ /* We don't pass -pie to the linker when -static. */
|
||||
+ #ifdef ENABLE_CRTBEGINP
|
||||
+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
|
||||
+ #else
|
||||
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
|
||||
+ #endif
|
||||
+
|
||||
+ #else
|
||||
+ #define ESP_OPTIONS_PIE_SPEC ""
|
||||
+ #define ESP_LINK_PIE_CHECK_SPEC ""
|
||||
+ #define ESP_LINK_PIE_SPEC ""
|
||||
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
|
||||
+ #endif
|
||||
+
|
||||
+ /* We add extra spec name's to the EXTRA_SPECS list */
|
||||
+ #define ESP_EXTRA_SPECS \
|
||||
+ { "esp_cc1", ESP_CC1_SPEC }, \
|
||||
+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
|
||||
+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
|
||||
+ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
|
||||
+ { "esp_link", ESP_LINK_SPEC }, \
|
||||
+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \
|
||||
+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
|
||||
+ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
|
||||
+ { "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
|
||||
+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
|
||||
+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
|
||||
+
|
||||
+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
|
||||
+
|
||||
+#endif
|
||||
+#endif /* End GCC_ESP_H */
|
||||
@@ -1,67 +0,0 @@
|
||||
Apply Alpine Linux specific differences to Gentoo ESP configuration:
|
||||
- default PIE and SSP by default without additional CFLAGS (to clean up APKBUILD)
|
||||
- do not enable -fstack-check by default (caused failures in programs that setup
|
||||
small stack in musl)
|
||||
- enable -z relro by default
|
||||
- enable -fstack-protector-strong instead of -fstack-protector-all by default
|
||||
|
||||
--- gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:54:19.925060848 +0000
|
||||
+++ gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:59:16.793850060 +0000
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef GCC_ESP_H
|
||||
#define GCC_ESP_H
|
||||
|
||||
-/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
|
||||
+/* This file will add -fstack-protector-strong, -fPIE, -pie, -z relro and -z now
|
||||
as default if the defines and the spec allow it.
|
||||
Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
|
||||
to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
|
||||
@@ -16,11 +16,14 @@
|
||||
ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
|
||||
*/
|
||||
#ifdef ENABLE_ESP
|
||||
+
|
||||
+ /* Enable by default on Alpine */
|
||||
+ #define EFAULT_PIE_SSP
|
||||
|
||||
/* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
|
||||
#define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
|
||||
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
- #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
|
||||
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
|
||||
#else
|
||||
#define ESP_CC1_SSP_SPEC ""
|
||||
#endif
|
||||
@@ -34,20 +37,20 @@
|
||||
/* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
|
||||
-z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
|
||||
Don't remove the specs in the end */
|
||||
- #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
|
||||
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_relro) %(esp_link_pie_check) "
|
||||
#define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
|
||||
+ #define ESP_LINK_RELRO_SPEC "%{!norelro:-z relro}"
|
||||
|
||||
/* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
|
||||
#define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
|
||||
%(esp_link_pie)} %(esp_options_ssp) }"
|
||||
|
||||
- /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
+ /* This will add -fstack-protector-strong if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
|
||||
-fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
|
||||
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
|
||||
#define ESP_OPTIONS_SSP_SPEC \
|
||||
"%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
|
||||
- fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
|
||||
- %{fstack-check|fstack-check=*:;: -fstack-check}"
|
||||
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-strong}"
|
||||
#else
|
||||
#define ESP_OPTIONS_SSP_SPEC ""
|
||||
#endif
|
||||
@@ -115,6 +118,7 @@
|
||||
{ "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
|
||||
{ "esp_link", ESP_LINK_SPEC }, \
|
||||
{ "esp_link_now", ESP_LINK_NOW_SPEC }, \
|
||||
+ { "esp_link_relro", ESP_LINK_RELRO_SPEC }, \
|
||||
{ "esp_link_pie", ESP_LINK_PIE_SPEC }, \
|
||||
{ "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
|
||||
{ "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
|
||||
@@ -1,28 +0,0 @@
|
||||
libitm checks for AVX support in the assembler and adds -mavx to x86_avx.cc
|
||||
which defines the needed typedefs. User CFLAGS can override -mavx however,
|
||||
so also use the fallback typedef if __AVX__ isn't defined.
|
||||
|
||||
https://bugs.gentoo.org/417271
|
||||
http://gcc.gnu.org/PR53113
|
||||
|
||||
|
||||
--- a/libitm/config/x86/x86_avx.cc
|
||||
+++ b/libitm/config/x86/x86_avx.cc
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
-#ifndef HAVE_AS_AVX
|
||||
+#if !defined (HAVE_AS_AVX) || !defined(__AVX__)
|
||||
// If we don't have an AVX capable assembler, we didn't set -mavx on the
|
||||
// command-line either, which means that libitm.h defined neither this type
|
||||
// nor the functions in this file. Define the type and unconditionally
|
||||
@@ -40,7 +40,7 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias));
|
||||
// Re-define the memcpy implementations so that we can frob the
|
||||
// interface to deal with possibly missing AVX instruction set support.
|
||||
|
||||
-#ifdef HAVE_AS_AVX
|
||||
+#if defined(HAVE_AS_AVX) && defined(__AVX__)
|
||||
#define RETURN(X) return X
|
||||
#define STORE(X,Y) X = Y
|
||||
#define OUTPUT(T) _ITM_TYPE_##T
|
||||
@@ -1,18 +0,0 @@
|
||||
2008-07-25 Magnus Granberg <zorry@ume.nu>
|
||||
|
||||
* include/libiberty.h (asprintf): Don't declare if defined as a macro
|
||||
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if !HAVE_DECL_VASPRINTF
|
||||
/* Like vsprintf but provides a pointer to malloc'd storage, which
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 29 Mar 2013 08:59:00 +0400
|
||||
Subject: [PATCH 16/35] gcc: poison-system-directories
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Inappropriate [distribution: codesourcery]
|
||||
---
|
||||
gcc/Makefile.in | 2 +-
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/configure | 20 ++++++++++++++++++--
|
||||
gcc/configure.ac | 10 ++++++++++
|
||||
gcc/doc/invoke.texi | 9 +++++++++
|
||||
gcc/gcc.c | 2 ++
|
||||
gcc/incpath.c | 19 +++++++++++++++++++
|
||||
8 files changed, 69 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: gcc-4.9-20140316/gcc/common.opt
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/common.opt
|
||||
+++ gcc-4.9-20140316/gcc/common.opt
|
||||
@@ -603,6 +603,10 @@ Wpedantic
|
||||
Common Var(pedantic) Warning
|
||||
Issue warnings needed for strict compliance to the standard
|
||||
|
||||
+Wpoison-system-directories
|
||||
+Common Var(flag_poison_system_directories) Init(1) Warning
|
||||
+Warn for -I and -L options using system directories if cross compiling
|
||||
+
|
||||
Wshadow
|
||||
Common Var(warn_shadow) Warning
|
||||
Warn when one local variable shadows another
|
||||
Index: gcc-4.9-20140316/gcc/config.in
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/config.in
|
||||
+++ gcc-4.9-20140316/gcc/config.in
|
||||
@@ -138,6 +138,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to warn for use of native system header directories */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if you want all operations on RTL (the basic data structure of the
|
||||
optimizer and back end) to be checked for dynamic type safety at runtime.
|
||||
This is quite expensive. */
|
||||
Index: gcc-4.9-20140316/gcc/configure
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/configure
|
||||
+++ gcc-4.9-20140316/gcc/configure
|
||||
@@ -928,6 +928,7 @@ with_system_zlib
|
||||
enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1648,6 +1649,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
+ --enable-poison-system-directories
|
||||
+ warn for use of native system header directories
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-poison-system-directories was given.
|
||||
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||
+ enableval=$enable_poison_system_directories;
|
||||
+else
|
||||
+ enable_poison_system_directories=no
|
||||
+fi
|
||||
+
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
|
||||
|
||||
Index: gcc-4.9-20140316/gcc/configure.ac
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/configure.ac
|
||||
+++ gcc-4.9-20140316/gcc/configure.ac
|
||||
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
+AC_ARG_ENABLE([poison-system-directories],
|
||||
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||
+ [warn for use of native system header directories]),,
|
||||
+ [enable_poison_system_directories=no])
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||
+ [1],
|
||||
+ [Define to warn for use of native system header directories])
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
Index: gcc-4.9-20140316/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
|
||||
+++ gcc-4.9-20140316/gcc/doc/invoke.texi
|
||||
@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
|
||||
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
|
||||
-Wpointer-arith -Wno-pointer-to-int-cast @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wredundant-decls -Wno-return-local-addr @gol
|
||||
-Wreturn-type -Wsequence-point -Wshadow @gol
|
||||
-Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
|
||||
@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
|
||||
for most targets, it is made up of code and thus requires the stack
|
||||
to be made executable in order for the program to work properly.
|
||||
|
||||
+@item -Wno-poison-system-directories
|
||||
+@opindex Wno-poison-system-directories
|
||||
+Do not warn for @option{-I} or @option{-L} options using system
|
||||
+directories such as @file{/usr/include} when cross compiling. This
|
||||
+option is intended for use in chroot environments when such
|
||||
+directories contain the correct headers and libraries for the target
|
||||
+system rather than the host.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
Index: gcc-4.9-20140316/gcc/gcc.c
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/gcc.c
|
||||
+++ gcc-4.9-20140316/gcc/gcc.c
|
||||
@@ -764,6 +764,8 @@ proper position among the other output f
|
||||
"%{fuse-ld=*:-fuse-ld=%*}\
|
||||
%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories}\
|
||||
+ %{Werror=poison-system-directories:--error-poison-system-directories}\
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
|
||||
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
|
||||
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
|
||||
Index: gcc-4.9-20140316/gcc/incpath.c
|
||||
===================================================================
|
||||
--- gcc-4.9-20140316.orig/gcc/incpath.c
|
||||
+++ gcc-4.9-20140316/gcc/incpath.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
@@ -1,483 +0,0 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen gcc4-armhf
|
||||
# Based on: main/gcc4 (from postmarketOS)
|
||||
|
||||
CTARGET_ARCH=armhf
|
||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||
# when this variable matches "no*"
|
||||
BOOTSTRAP="nobuildbase"
|
||||
|
||||
# abuild will only cross compile when this variable is set, but it
|
||||
# needs to find a valid package database in there for dependency
|
||||
# resolving, so we set it to /.
|
||||
CBUILDROOT="/"
|
||||
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname="gcc4-armhf"
|
||||
pkgver=9999
|
||||
_pkgver=4.9.2
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for armhf"
|
||||
url="http://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
license="GPL LGPL"
|
||||
_gccrel=$_pkgver-r$pkgrel
|
||||
depends="isl binutils-armhf mpc1"
|
||||
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
||||
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
|
||||
subpackages=""
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# We only care about C, so we can compile old Linux kernels
|
||||
LANG_CXX=false
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
|
||||
LIBGOMP="false"
|
||||
LIBGCC="false"
|
||||
LIBATOMIC="false"
|
||||
LIBITM="false"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||
LANG_CXX=false
|
||||
LANG_ADA=false
|
||||
LIBGCC=false
|
||||
_builddir="$srcdir/build-cross-pass2"
|
||||
else
|
||||
_builddir="$srcdir/build-cross-final"
|
||||
fi
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LIBGOMP=false
|
||||
LIBATOMIC=false
|
||||
LIBITM=false
|
||||
|
||||
# reset target flags (should be set in crosscreate abuild)
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
STRIP_FOR_TARGET="$CTARGET-strip"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
|
||||
# reset flags and cc for build
|
||||
export CC_FOR_BUILD="gcc"
|
||||
export CXX_FOR_BUILD="g++"
|
||||
export CFLAGS_FOR_BUILD=" "
|
||||
export CXXFLAGS_FOR_BUILD=" "
|
||||
export LDFLAGS_FOR_BUILD=" "
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
# Languages that do not need bootstrapping
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build-cross-native"
|
||||
else
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build"
|
||||
fi
|
||||
|
||||
# Go needs {set,make,swap}context, unimplemented in musl
|
||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
||||
|
||||
# libitm has TEXTRELs in ARM build, so disable for now
|
||||
case "$CTARGET_ARCH" in
|
||||
arm*) LIBITM=false ;;
|
||||
mips*) LIBITM=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
# currently on x86, x86_64 and ia64
|
||||
LIBQUADMATH=$LANG_FORTRAN
|
||||
case "$CTARGET_ARCH" in
|
||||
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
|
||||
*) LIBQUADMATH=false ;;
|
||||
esac
|
||||
|
||||
# libatomic is a dependency for openvswitch
|
||||
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||
if $LIBGOMP; then
|
||||
depends="$depends libgomp=$_gccrel"
|
||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||
fi
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
fi
|
||||
if $LANG_OBJC; then
|
||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||
_languages="$_languages,objc"
|
||||
fi
|
||||
if $LANG_JAVA; then
|
||||
subpackages="$subpackages libgcj::$CTARGET_ARCH gcc-java$_target:java"
|
||||
_languages="$_languages,java"
|
||||
fi
|
||||
if $LANG_GO; then
|
||||
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
||||
_languages="$_languages,go"
|
||||
fi
|
||||
if $LANG_FORTRAN; then
|
||||
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
||||
_languages="$_languages,fortran"
|
||||
fi
|
||||
if $LANG_ADA; then
|
||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
||||
_languages="$_languages,ada"
|
||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||
fi
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
|
||||
source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkgbase:-$_pkgver}.tar.gz
|
||||
http://sourceware.org/pub/java/ecj-4.9.jar
|
||||
|
||||
01_all_gcc49_configure.patch
|
||||
02_all_gcc48_config.in.patch
|
||||
03_all_gcc49_Makefile.in.patch
|
||||
05_all_gcc48_gcc.c.patch
|
||||
16_all_gcc47_nopie_option.patch
|
||||
20_all_gcc49_config_crtbeginp.patch
|
||||
24_all_gcc49_invoke.texi.patch
|
||||
34_all_gcc48_config_i386.patch
|
||||
35_all_gcc48_config_arm.patch
|
||||
40_all_gcc49_config_esp.patch
|
||||
41_all_gcc49_config_esp_alpine.patch
|
||||
|
||||
10_all_default-fortify-source.patch
|
||||
12_all_default-warn-trampolines.patch
|
||||
15_all_libgfortran-Werror.patch
|
||||
16_all_libgomp-Werror.patch
|
||||
48_all_x86_pr53113_libitm-avx.patch
|
||||
50_all_libiberty-asprintf.patch
|
||||
51_all_libiberty-pic.patch
|
||||
67_all_gcc-poison-system-directories.patch
|
||||
|
||||
gcc49-cloog-dl.patch
|
||||
gcc-ice-hack.patch
|
||||
gcc-spec-env.patch
|
||||
libgcc-always-build-gcceh.a.patch
|
||||
gcc-4.6-pr32219.patch
|
||||
gcc-4.9-musl.patch
|
||||
gcc-4.8-musl-fix-iteratephdr.patch
|
||||
gcc-4.8-musl-libssp.patch
|
||||
gcc-4.9-musl-fortify.patch
|
||||
boehm-gc-uclibc.patch
|
||||
boehm-gc-musl.patch
|
||||
gcc-pure64.patch
|
||||
fix-gcj-musl.patch
|
||||
fix-gcj-iconv-musl.patch
|
||||
musl-posix_memalign-c++.patch
|
||||
pr63740.patch
|
||||
pr64037.patch
|
||||
|
||||
gcc-4.8-build-args.patch
|
||||
fix-cxxflags-passing.patch
|
||||
fix-cxxflags-for-target.patch
|
||||
ada-no-pie.patch
|
||||
ada-fixes.patch
|
||||
ada-shared.patch
|
||||
ada-musl.patch
|
||||
|
||||
vanilla.specs
|
||||
hardenednossp.specs
|
||||
hardenednopie.specs
|
||||
hardenednopiessp.specs
|
||||
"
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$_pkgver}
|
||||
_gcclibdir=/usr/lib/gcc/${CTARGET}/$_pkgver
|
||||
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$_pkgver
|
||||
|
||||
prepare() {
|
||||
cd "$_gccdir"
|
||||
|
||||
_err=
|
||||
for i in $source; do
|
||||
case "$i" in
|
||||
*.patch)
|
||||
msg "Applying $i"
|
||||
patch -p1 -F3 -i "$srcdir"/$i || _err="$_err $i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$_err" ]; then
|
||||
error "The following patches failed:"
|
||||
for i in $_err; do
|
||||
echo " $i"
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
# see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
|
||||
mv "$srcdir"/ecj-*.jar ecj.jar
|
||||
|
||||
echo ${_pkgver} > gcc/BASE-VER
|
||||
}
|
||||
|
||||
build() {
|
||||
local _arch_configure=
|
||||
local _libc_configure=
|
||||
local _bootstrap_configure=
|
||||
local _symvers=
|
||||
|
||||
cd "$_gccdir"
|
||||
|
||||
case "$CTARGET" in
|
||||
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
||||
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
||||
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
||||
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
||||
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
||||
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_LIBC" in
|
||||
musl)
|
||||
# musl does not support mudflap, or libsanitizer
|
||||
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
||||
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
||||
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
||||
_symvers="--disable-symvers"
|
||||
export libat_cv_have_ifunc=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "$BOOTSTRAP" in
|
||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||
esac
|
||||
|
||||
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||
|
||||
msg "Building the following:"
|
||||
echo ""
|
||||
echo " CBUILD=$CBUILD"
|
||||
echo " CHOST=$CHOST"
|
||||
echo " CTARGET=$CTARGET"
|
||||
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
||||
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
||||
echo " languages=$_languages"
|
||||
echo " arch_configure=$_arch_configure"
|
||||
echo " libc_configure=$_libc_configure"
|
||||
echo " cross_configure=$_cross_configure"
|
||||
echo " bootstrap_configure=$_bootstrap_configure"
|
||||
echo " hash_style_configure=$_hash_style_configure"
|
||||
echo ""
|
||||
|
||||
mkdir -p "$_builddir"
|
||||
cd "$_builddir"
|
||||
"$_gccdir"/configure --prefix=/usr/gcc4 \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--build=${CBUILD} \
|
||||
--host=${CHOST} \
|
||||
--target=${CTARGET} \
|
||||
--with-pkgversion="postmarketOS ${_pkgver}" \
|
||||
--enable-checking=release \
|
||||
--disable-fixed-point \
|
||||
--disable-libstdcxx-pch \
|
||||
\
|
||||
--disable-bootstrap \
|
||||
--disable-libstdcxx \
|
||||
\
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
$_symvers \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-default-pie \
|
||||
--enable-cloog-backend \
|
||||
--enable-languages=$_languages \
|
||||
$_arch_configure \
|
||||
$_libc_configure \
|
||||
$_cross_configure \
|
||||
$_bootstrap_configure \
|
||||
--with-system-zlib \
|
||||
$_hash_style_configure
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make -j1 DESTDIR="${pkgdir}" install
|
||||
|
||||
local prefix=/usr/gcc4
|
||||
if [ "$CHOST" = "$CTARGET" ]; then
|
||||
# gcc symlinks
|
||||
ln -s gcc "$pkgdir$prefix"/bin/cc
|
||||
ln -s gcc "$pkgdir$prefix"/bin/gcc4
|
||||
fi
|
||||
|
||||
# remove docs
|
||||
rm -r "$pkgdir/usr/share/"
|
||||
|
||||
# we don't support gcj -static
|
||||
# and saving 35MB is not bad.
|
||||
find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
|
||||
-o -name libgjsmalsa.a -o -name libgcj-tools.a \
|
||||
-o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
|
||||
-o -name libjavamath.a \
|
||||
| xargs rm -f
|
||||
|
||||
# strip debug info from some static libs
|
||||
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||
-a -type f`
|
||||
|
||||
if $LANG_JAVA; then
|
||||
sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
|
||||
"$pkgdir"/usr/lib/libgcj.spec
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# cross-gcc: remove any files that would conflict with the
|
||||
# native gcc package
|
||||
rm -rf "$pkgdir$prefix"/bin/cc \
|
||||
"$pkgdir$prefix"/include \
|
||||
"$pkgdir$prefix"/share
|
||||
# libcc1 does not depend on target, don't ship it
|
||||
rm -rf "$pkgdir$prefix"/lib/libcc1.so*
|
||||
|
||||
# fixup gcc library symlinks to be linker scripts so
|
||||
# linker finds the libs from relocated sysroot
|
||||
for so in "$pkgdir$prefix"/$CTARGET/lib/*.so; do
|
||||
if [ -h "$so" ]; then
|
||||
local _real=$(basename $(readlink "$so"))
|
||||
rm -f "$so"
|
||||
echo "GROUP ($_real)" > "$so"
|
||||
fi
|
||||
done
|
||||
|
||||
# Link binutils binaries to /usr/gcc4
|
||||
# This is the path GCC4 will look for them, if we don't create these
|
||||
# symlinks, it will use the native binutils instead (which is of course
|
||||
# failing and causes many headaches). See also: '-B' in 'man gcc'.
|
||||
echo "Link binutils binaries to /usr/gcc4"
|
||||
mkdir -p "$pkgdir$prefix/$CTARGET/bin"
|
||||
for i in "as" "ld"; do
|
||||
ln -sv "/usr/$CTARGET/bin/$i" \
|
||||
"$pkgdir$prefix/$CTARGET/bin/$i"
|
||||
done
|
||||
|
||||
# Link binutils to gcc4-* (so 'CROSS_COMPILE=gcc4-...' works)
|
||||
echo "Link binutils to gcc4-*"
|
||||
mkdir -p "$pkgdir/usr/bin"
|
||||
for i in "elfedit" "gprof" "addr2line" "strings" "as" "ld" "size" "ld.bfd" \
|
||||
"readelf" "nm" "ar" "strip" "dwp" "objdump" "objcopy" "c++filt" "ranlib"; do
|
||||
ln -sv "/usr/bin/$CTARGET-$i" \
|
||||
"$pkgdir/usr/bin/gcc4-$CTARGET-$i"
|
||||
done
|
||||
fi
|
||||
|
||||
# Link all binaries from /usr/gcc4/bin/* to /usr/bin/gcc4-*
|
||||
echo "Link all gcc binaries to /usr/bin/gcc4-*"
|
||||
mkdir -p "$pkgdir"/usr/bin
|
||||
cd "$pkgdir$prefix/bin/"
|
||||
for i in *; do
|
||||
ln -sv "$prefix/bin/$i" "$pkgdir/usr/bin/gcc4-$i"
|
||||
done
|
||||
}
|
||||
|
||||
sha512sums="35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
|
||||
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
|
||||
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
|
||||
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
|
||||
3afe2cc407b5440333d9517daca3257e08a7318695d20645a9186cafac53afa6d0c075af67398ff7abd06250567cc6c751e6dabb65a310eef9a5d981e910aa25 03_all_gcc49_Makefile.in.patch
|
||||
e98cc321d71e5bb62c6116b30ed6f11044bda440e238026a83dec63f04a0587440bdae50ec211b07976fcd9deb329f9dd1dac1317dae5003088a8a8bddbb97c1 05_all_gcc48_gcc.c.patch
|
||||
98a4da3137177c5cad7dd7d35ad39cd416aa36f07867714e09ab8c0d8b759d2659063aa87b16ac1b708a283afd2ac54e20b327a32d1147720996d7bc11dcbd63 16_all_gcc47_nopie_option.patch
|
||||
8fc6f2fd921c560fb1d7ba17b5cef4ea8071ee6909d372e41201667c011f948560fa543b1246cf55c0009622abf0dbc0bd79f718a853f2f0b59290e3df2c2968 20_all_gcc49_config_crtbeginp.patch
|
||||
32bfe9c1f6f566de72c93388622001ff4b95086ea6f476bdfc08403ea474f98212f7396bc75d88a79a053159f78dca922ec6f641f83d9959ad419b0d8901b504 24_all_gcc49_invoke.texi.patch
|
||||
dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec88aae5463763f5f64454b8a627ebd1d0a5c92984017025ad 34_all_gcc48_config_i386.patch
|
||||
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
|
||||
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
|
||||
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
|
||||
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
|
||||
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
|
||||
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
|
||||
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
|
||||
ff16f259fff8d78230593eee8641eab5a72c5c517c6ac5f09597edbc624d964b33f185a0dd5772d6029f757a5edb66431b3eab77dac71e76a0ef155bb7443d2c 48_all_x86_pr53113_libitm-avx.patch
|
||||
c6c314a2d24531b4286436dec7189f83e443c4cfa9b88339a4c324c2d40812d766ed44dcfd4a0c3b67695bb76969a4d8a9784ff95876ceba23def305ef8a48f8 50_all_libiberty-asprintf.patch
|
||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 51_all_libiberty-pic.patch
|
||||
9b623a0b00254326596a56fff23dacc97e560823ebdf35698799fc7ab5e98984c71b7ddfceeb1589bbbdd1ba89a742cd7becf8f70f0081dfc26bcef4198b1b5d 67_all_gcc-poison-system-directories.patch
|
||||
9c6aa6d7f096c3aaebbe21d52967872195aea130b51d60a1934255b00bf1b23d24ec598c7763152f987f7999da9e56f512d169958666a3133641de3780a75d3f gcc49-cloog-dl.patch
|
||||
7242876e4bba34235f6f3ea960d72439638bd31547284ca96cb94c97a2d46dd7b38a3709fd159cf86efa1e8a44e3e9125fe82bc3a1cc71153591755827d6c9fd gcc-ice-hack.patch
|
||||
ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 gcc-spec-env.patch
|
||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
||||
9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch
|
||||
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
|
||||
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
|
||||
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
|
||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
||||
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
|
||||
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
|
||||
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
|
||||
f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch
|
||||
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
|
||||
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
|
||||
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
|
||||
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
|
||||
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
|
||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
||||
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
|
||||
e80a08de4b43fb71f7699bcce360cd99bc525dab20b9109e7152bd211def5d8e728f88771ed59f15ed520cbf069364debc4f822c10a1abf7e2c7badd67e1c83c ada-no-pie.patch
|
||||
b37195a126476775e2ef16e0adc9173664c514339fb319f628debd8a4133fa53e022278387c68fc260cf813e58602617e9e629ea8177133bfdf5972398fe1c55 ada-fixes.patch
|
||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
||||
76d7d35066534c332956a88da84a95c8c54c6e0742c3c46e6b256395bf67f7c167b5ecd47fbed697fb1c9d7a41016c99e7dcd06465516a0e963707a0eab8f8b6 ada-musl.patch
|
||||
83a0996a48096032bcc674a6d28524f1cd2d81837621ebe4c15b5aedbd551c77ce5576b6307adb673ef0e4ac0431d935ad6a427edca2af5c21b6be9176bfaddb vanilla.specs
|
||||
e4d38905527c500c61c421d782a8ac6ef2b034b15fd81d868486ac330a70922937d3c47e0684e9f3250744569b56a8df199499a4a5c107a6d544dca84458dc12 hardenednossp.specs
|
||||
b56f7c308c5aefd0cfc647abd75939508a6640c53fce7c19da7c7d8ef4405d29b0d88800117fc7ff8d0022b035d511fb6d478e745bb2ed12a1b63f9f8cf3e168 hardenednopie.specs
|
||||
f5ac7282201006548ed2bd835234af64d6f79f13f0b9a3410f5c794537e0ea91601361ae72180f49870b6b0f9af5f16002c86660feb94df346b9b1d9602e9d3a hardenednopiessp.specs"
|
||||
@@ -1,44 +0,0 @@
|
||||
--- gcc-4.8.1/gcc/ada/terminals.c.orig
|
||||
+++ gcc-4.8.1/gcc/ada/terminals.c
|
||||
@@ -984,13 +984,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
-/* On some system termio is either absent or including it will disable termios
|
||||
- (HP-UX) */
|
||||
-#if ! defined (__hpux__) && ! defined (FREEBSD) && \
|
||||
- ! defined (__APPLE__) && ! defined(__rtems__)
|
||||
-# include <termio.h>
|
||||
-#endif
|
||||
-
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
@@ -1078,7 +1078,7 @@
|
||||
char *slave_name = NULL;
|
||||
|
||||
#ifdef USE_GETPT
|
||||
- master_fd = getpt ();
|
||||
+ master_fd = posix_openpt (O_RDWR);
|
||||
#elif defined (USE_OPENPTY)
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
@@ -1179,7 +1170,7 @@
|
||||
int status;
|
||||
|
||||
/* ensure that s is filled with 0 */
|
||||
- bzero (&s, sizeof (&s));
|
||||
+ bzero (&s, sizeof (s));
|
||||
|
||||
/* Get the current terminal settings */
|
||||
status = tcgetattr (fd, &s);
|
||||
--- gcc-4.8.1/gcc/ada/cal.c.orig
|
||||
+++ gcc-4.8.1/gcc/ada/cal.c
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
+#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
@@ -1,136 +0,0 @@
|
||||
diff -ru gcc-4.9.2/gcc/ada/adaint.c gcc-4.9.2/gcc/ada/adaint.c
|
||||
--- gcc-4.9.2/gcc/ada/adaint.c 2014-02-24 18:51:58.000000000 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/adaint.c 2014-12-10 12:05:44.621173474 -0200
|
||||
@@ -67,6 +67,11 @@
|
||||
#include <sys/pstat.h>
|
||||
#endif
|
||||
|
||||
+#if defined (linux)
|
||||
+#define _GNU_SOURCE 1
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
+
|
||||
#ifdef VMS
|
||||
#define _POSIX_EXIT 1
|
||||
#define HOST_EXECUTABLE_SUFFIX ".exe"
|
||||
@@ -3891,8 +3896,6 @@
|
||||
return (void *) syscall (__NR_gettid);
|
||||
}
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
/* glibc versions earlier than 2.7 do not define the routines to handle
|
||||
dynamically allocated CPU sets. For these targets, we use the static
|
||||
versions. */
|
||||
@@ -3901,7 +3904,7 @@
|
||||
|
||||
/* Dynamic cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count)
|
||||
{
|
||||
return CPU_ALLOC (count);
|
||||
@@ -3914,33 +3917,33 @@
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
- CPU_FREE (set);
|
||||
+ CPU_FREE ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count, void *set)
|
||||
{
|
||||
- CPU_ZERO_S (count, set);
|
||||
+ CPU_ZERO_S (count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET_S (cpu - 1, count, set);
|
||||
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
#else /* !CPU_ALLOC */
|
||||
|
||||
/* Static cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
|
||||
+ return xmalloc (sizeof (cpu_set_t));
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -3950,23 +3953,23 @@
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
free (set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
- CPU_ZERO (set);
|
||||
+ CPU_ZERO ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET (cpu - 1, set);
|
||||
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
|
||||
}
|
||||
#endif /* !CPU_ALLOC */
|
||||
#endif /* linux */
|
||||
diff -ru gcc-4.9.2/gcc/ada/adaint.h gcc-4.9.2/gcc/ada/adaint.h
|
||||
--- gcc-4.9.2/gcc/ada/adaint.h 2014-02-24 18:51:58.000000000 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/adaint.h 2014-12-10 12:03:48.377834174 -0200
|
||||
@@ -266,13 +266,11 @@
|
||||
|
||||
/* Routines for interface to required CPU set primitives */
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
|
||||
+extern void * __gnat_cpu_alloc (size_t);
|
||||
extern size_t __gnat_cpu_alloc_size (size_t);
|
||||
-extern void __gnat_cpu_free (cpu_set_t *);
|
||||
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
|
||||
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
|
||||
+extern void __gnat_cpu_free (void *);
|
||||
+extern void __gnat_cpu_zero (size_t, void *);
|
||||
+extern void __gnat_cpu_set (int, size_t, void *);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-12-11 08:16:33.364902456 -0200
|
||||
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-11 08:16:51.998236755 -0200
|
||||
@@ -1948,7 +1948,7 @@
|
||||
endif
|
||||
|
||||
# ARM linux, GNU eabi
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
|
||||
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
@@ -1,66 +0,0 @@
|
||||
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-05-17 13:13:12.000000000 -0300
|
||||
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-10 12:01:32.304493855 -0200
|
||||
@@ -2570,23 +2570,23 @@
|
||||
gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
|
||||
gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
|
||||
$(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
|
||||
../../gnatsym$(exeext): ../stamp-tools
|
||||
$(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
@@ -2608,7 +2608,7 @@
|
||||
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
|
||||
$(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
|
||||
# Note the use of the "mv" command in order to allow gnatlink to be linked with
|
||||
# with the former version of gnatlink itself which cannot override itself.
|
||||
@@ -2618,7 +2618,7 @@
|
||||
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
|
||||
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
|
||||
$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
|
||||
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
|
||||
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
|
||||
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
|
||||
|
||||
# Needs to be built with CC=gcc
|
||||
@@ -2627,10 +2627,10 @@
|
||||
|
||||
# Likewise for the tools
|
||||
../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
|
||||
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
|
||||
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
|
||||
|
||||
../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
|
||||
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
|
||||
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
|
||||
|
||||
../stamp-gnatlib-$(RTSDIR):
|
||||
@if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
|
||||
@@ -1,30 +0,0 @@
|
||||
Index: b/gcc/ada/link.c
|
||||
===================================================================
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -105,9 +105,9 @@
|
||||
|
||||
#elif defined (__FreeBSD__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -127,9 +127,9 @@
|
||||
|
||||
#elif defined (linux) || defined(__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -1,62 +0,0 @@
|
||||
--- gcc-4.8.1/boehm-gc/os_dep.c.orig 2013-09-17 07:46:00.969884340 +0000
|
||||
+++ gcc-4.8.1/boehm-gc/os_dep.c 2013-09-17 06:53:53.629884946 +0000
|
||||
@@ -26,7 +26,7 @@
|
||||
# define __KERNEL__
|
||||
# include <asm/signal.h>
|
||||
# undef __KERNEL__
|
||||
-# else
|
||||
+# elif defined(__GLIBC__)
|
||||
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
|
||||
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
|
||||
/* prototypes, so we have to include the top-level sigcontext.h to */
|
||||
--- gcc-4.8.2/boehm-gc/dyn_load.c.orig 2014-02-17 14:13:09.519850231 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/dyn_load.c 2014-02-17 14:14:27.906093514 +0200
|
||||
@@ -459,9 +459,7 @@
|
||||
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
|
||||
/* versions. Thanks to Jakub Jelinek for most of the code. */
|
||||
|
||||
-# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
+# if (defined(LINUX) || defined (__GLIBC__))
|
||||
|
||||
/* We have the header files for a glibc that includes dl_iterate_phdr. */
|
||||
/* It may still not be available in the library on the target system. */
|
||||
--- gcc-4.8.2/boehm-gc/include/private/gcconfig.h.orig 2014-02-17 14:14:36.026049422 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/include/private/gcconfig.h 2014-02-17 14:17:11.345207887 +0200
|
||||
@@ -684,7 +684,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__)&& __GLIBC__>=2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else /* !GLIBC2 */
|
||||
extern char **__environ;
|
||||
@@ -1147,7 +1147,7 @@
|
||||
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
|
||||
# endif
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -1367,7 +1367,7 @@
|
||||
# define HBLKSIZE 4096
|
||||
# endif
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
|
||||
+# if 1
|
||||
# define LINUX_STACKBOTTOM
|
||||
# else
|
||||
# define STACKBOTTOM 0x80000000
|
||||
@@ -1858,7 +1858,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ./boehm-gc/include/gc.h.orig
|
||||
+++ ./boehm-gc/include/gc.h
|
||||
@@ -503,7 +503,7 @@
|
||||
#if defined(__linux__) || defined(__GLIBC__)
|
||||
# include <features.h>
|
||||
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
|
||||
- && !defined(__ia64__)
|
||||
+ && !defined(__ia64__) && !defined(__UCLIBC__)
|
||||
# ifndef GC_HAVE_BUILTIN_BACKTRACE
|
||||
# define GC_HAVE_BUILTIN_BACKTRACE
|
||||
# endif
|
||||
@@ -1,5 +0,0 @@
|
||||
--- gcc-4.8.1/config/mt-gnu.orig
|
||||
+++ gcc-4.8.1/config/mt-gnu
|
||||
@@ -1 +1 @@
|
||||
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
|
||||
+CXXFLAGS_FOR_TARGET := $(CXXFLAGS_FOR_TARGET) -D_GNU_SOURCE
|
||||
@@ -1,10 +0,0 @@
|
||||
--- gcc-4.8.1/Makefile.in.orig
|
||||
+++ gcc-4.8.1/Makefile.in
|
||||
@@ -169,6 +169,7 @@
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
@@ -1,120 +0,0 @@
|
||||
--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig 2014-02-18 18:46:14.897880526 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc 2014-02-18 18:50:08.766613550 +0200
|
||||
@@ -24,6 +24,13 @@
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
+#include <endian.h>
|
||||
+
|
||||
+#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
+#define UCS2_CHARSET "UCS-2BE"
|
||||
+#else
|
||||
+#define UCS2_CHARSET "UCS-2LE"
|
||||
+#endif
|
||||
|
||||
template<typename T>
|
||||
static inline size_t
|
||||
@@ -45,7 +52,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open ("UCS-2", buffer);
|
||||
+ iconv_t h = iconv_open (UCS2_CHARSET, buffer);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -99,18 +106,6 @@
|
||||
throw new ::java::io::CharConversionException ();
|
||||
}
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- size_t max = (old_out - outavail) / sizeof (jchar);
|
||||
- for (size_t i = 0; i < max; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((out[outpos + i] & 0xff) << 8)
|
||||
- | ((out[outpos + i] >> 8) & 0xff));
|
||||
- outbuf[i] = c;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
inpos += old_in - inavail;
|
||||
return (old_out - outavail) / sizeof (jchar);
|
||||
#else /* HAVE_ICONV */
|
||||
@@ -145,7 +140,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open (buffer, "UCS-2");
|
||||
+ iconv_t h = iconv_open (buffer, UCS2_CHARSET);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -187,20 +182,6 @@
|
||||
char *inbuf = (char *) &chars[inpos];
|
||||
char *outbuf = (char *) &out[count];
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- // Ugly performance penalty -- don't use losing systems!
|
||||
- temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
|
||||
- for (int i = 0; i < inlength; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((chars[inpos + i] & 0xff) << 8)
|
||||
- | ((chars[inpos + i] >> 8) & 0xff));
|
||||
- temp_buffer[i] = c;
|
||||
- }
|
||||
- inbuf = (char *) temp_buffer;
|
||||
- }
|
||||
-
|
||||
size_t loop_old_in = old_in;
|
||||
while (1)
|
||||
{
|
||||
@@ -252,44 +233,7 @@
|
||||
jboolean
|
||||
gnu::gcj::convert::IOConverter::iconv_init (void)
|
||||
{
|
||||
- // Some versions of iconv() always return their UCS-2 results in
|
||||
- // big-endian order, and they also require UCS-2 inputs to be in
|
||||
- // big-endian order. For instance, glibc 2.1.3 does this. If the
|
||||
- // UTF-8=>UCS-2 iconv converter has this feature, then we assume
|
||||
- // that all UCS-2 converters do. (This might not be the best
|
||||
- // heuristic, but is is all we've got.)
|
||||
- jboolean result = false;
|
||||
-#ifdef HAVE_ICONV
|
||||
- iconv_t handle = iconv_open ("UCS-2", "UTF-8");
|
||||
- if (handle != (iconv_t) -1)
|
||||
- {
|
||||
- jchar c;
|
||||
- unsigned char in[4];
|
||||
- char *inp, *outp;
|
||||
- size_t inc, outc, r;
|
||||
-
|
||||
- // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
|
||||
- // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
|
||||
- in[0] = 0xef;
|
||||
- in[1] = 0xbb;
|
||||
- in[2] = 0xbf;
|
||||
- in[3] = 0x00;
|
||||
-
|
||||
- inp = (char *) in;
|
||||
- inc = 4;
|
||||
- outp = (char *) &c;
|
||||
- outc = 2;
|
||||
-
|
||||
- r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
|
||||
- // Conversion must be complete for us to use the result.
|
||||
- if (r != (size_t) -1 && inc == 0 && outc == 0)
|
||||
- result = (c != 0xfeff);
|
||||
-
|
||||
- // Release iconv handle.
|
||||
- iconv_close (handle);
|
||||
- }
|
||||
-#endif /* HAVE_ICONV */
|
||||
- return result;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1,49 +0,0 @@
|
||||
--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig 2014-02-18 10:55:08.617678779 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc 2014-02-18 10:56:31.927227453 +0200
|
||||
@@ -289,7 +289,7 @@
|
||||
// just default to `en_US'.
|
||||
setlocale (LC_ALL, "");
|
||||
char *locale = setlocale (LC_MESSAGES, "");
|
||||
- if (locale && strlen (locale) >= 2)
|
||||
+ if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
|
||||
{
|
||||
char buf[3];
|
||||
buf[2] = '\0';
|
||||
--- gcc-4.8.2/libjava/posix-threads.cc.orig 2014-02-18 13:22:01.789933726 +0200
|
||||
+++ gcc-4.8.2/libjava/posix-threads.cc 2014-02-18 13:29:50.924058875 +0200
|
||||
@@ -657,6 +657,7 @@
|
||||
struct sched_param param;
|
||||
pthread_attr_t attr;
|
||||
struct starter *info;
|
||||
+ size_t ss;
|
||||
|
||||
if (data->flags & FLAG_START)
|
||||
return;
|
||||
@@ -675,8 +676,25 @@
|
||||
// Set stack size if -Xss option was given.
|
||||
if (gcj::stack_size > 0)
|
||||
{
|
||||
- int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
|
||||
+ ss = gcj::stack_size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ int e = pthread_attr_getstacksize (&attr, &ss);
|
||||
+ if (e != 0)
|
||||
+ JvFail (strerror (e));
|
||||
+
|
||||
+ // Request at least 1meg of stack
|
||||
+ if (ss >= 1024 * 1024)
|
||||
+ ss = 0;
|
||||
+ else
|
||||
+ ss = 1024 * 1024;
|
||||
+ }
|
||||
+
|
||||
+ if (ss)
|
||||
+ {
|
||||
+ int e = pthread_attr_setstacksize (&attr, ss);
|
||||
if (e != 0)
|
||||
JvFail (strerror (e));
|
||||
}
|
||||
|
||||
info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));
|
||||
Loaded 100 of 2317 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user