Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2efa07fd3 | ||
|
|
f359a329b9 | ||
|
|
0d2b8df155 |
No files matched your search
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: run apkbuild-lint on modified APKBUILDs
|
||||
# Options: native
|
||||
# Use 'native' because it requires git commit history.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
sh ./install_pmbootstrap.sh
|
||||
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
# Wrap pmbootstrap to use this repository for --aports
|
||||
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
|
||||
_pmbootstrap="$(command -v pmbootstrap)"
|
||||
pmbootstrap() {
|
||||
"$_pmbootstrap" --aports="$pmaports" "$@"
|
||||
}
|
||||
|
||||
.ci/lib/apkbuild_linting.py
|
||||
|
||||
File renamed without changes.
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
@@ -1 +0,0 @@
|
||||
lib/build_changed_aports.sh
|
||||
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 ".ci/build_changed_aports.py $JOB_ARCH"
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
import common
|
||||
|
||||
# pmbootstrap
|
||||
import add_pmbootstrap_to_import_path
|
||||
import testcases.add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
import pmb.helpers.pmaports
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if grep -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb'; then
|
||||
echo 'Please do not install dtbs to /usr/share/dtb!'
|
||||
echo 'Unless you have a good reason not to, please put them in /boot/dtbs'
|
||||
exit 1
|
||||
fi
|
||||
@@ -11,7 +11,7 @@ import subprocess
|
||||
import common
|
||||
|
||||
# pmbootstrap
|
||||
import add_pmbootstrap_to_import_path # noqa
|
||||
import testcases.add_pmbootstrap_to_import_path # noqa
|
||||
import pmb.parse
|
||||
import pmb.parse.version
|
||||
import pmb.helpers.logging
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import argparse
|
||||
@@ -13,7 +13,7 @@ def get_devices():
|
||||
""":returns: list of all devices"""
|
||||
ret = []
|
||||
pmaports = (os.path.realpath(os.path.join(os.path.dirname(__file__) +
|
||||
"/../..")))
|
||||
"/..")))
|
||||
for path in glob.glob(pmaports + "/device/*/device-*/"):
|
||||
device = os.path.dirname(path).split("device-", 1)[1]
|
||||
|
||||
@@ -110,7 +110,7 @@ def main():
|
||||
print("")
|
||||
print("Now it's time to add some documentation:")
|
||||
print("1) Create a device specific wiki page as described here:")
|
||||
print(" https://wiki.postmarketos.org/wiki/Help:Device_Page")
|
||||
print(" <https://wiki.postmarketos.org/wiki/Help:Device_Page>")
|
||||
print("2) Set 'booting = yes' in the infobox of your device page.")
|
||||
print("3) Run these tests again with an empty commit in your MR:")
|
||||
print(" $ git commit --allow-empty -m 'run tests again'")
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2023 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Description: check pkgver/pkgrel bumps, amount of changed pkgs etc
|
||||
# Options: native
|
||||
# Use 'native' because it requires git commit history.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
# In .gitlab-ci.yml currently .ci/pytest.sh runs before this and
|
||||
# already downloads and runs install_pmbootstrap.sh.
|
||||
if ! [ -e install_pmbootstrap.sh ]; then
|
||||
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
sh ./install_pmbootstrap.sh
|
||||
fi
|
||||
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
.ci/lib/check_changed_aports_versions.py
|
||||
@@ -17,7 +17,7 @@ def get_pmaports_dir():
|
||||
global cache
|
||||
if "pmaports_dir" in cache:
|
||||
return cache["pmaports_dir"]
|
||||
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
|
||||
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
cache["pmaports_dir"] = ret
|
||||
return ret
|
||||
|
||||
@@ -134,7 +134,7 @@ def get_changed_packages_sanity_check(count):
|
||||
print("ERROR: Too many packages have changed!")
|
||||
print()
|
||||
print("This is a sanity check, so we don't end up building packages that")
|
||||
print("have not been modified. CI won't run for more than three hours")
|
||||
print("have not been modified. CI won't run for more than one hour")
|
||||
print("anyway.")
|
||||
print()
|
||||
print("Your options:")
|
||||
@@ -190,11 +190,3 @@ def get_changed_packages():
|
||||
ret.add(os.path.basename(dirname))
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def get_changed_kernels():
|
||||
ret = []
|
||||
for pkgname in get_changed_packages():
|
||||
if pkgname.startswith("linux-"):
|
||||
ret += [pkgname]
|
||||
return ret
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: editorconfig-checker: lint for trailing whitespaces etc.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add \
|
||||
editorconfig-checker
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
set -x
|
||||
ec
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: lint CI related python scripts/tests
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add py3-flake8
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
flake8 --ignore E501,F401,E722,W504,W605 $(find .ci -name '*.py')
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: check various bad patterns with grep
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add grep
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
# Find CHANGEMEs in APKBUILDs
|
||||
if grep -qr '(CHANGEME!)' -- *; then
|
||||
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
||||
grep --color=always -r '(CHANGEME!)' -- *
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# DTBs installed to /usr/share/db
|
||||
# shellcheck disable=SC2016
|
||||
if grep -qr 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/; then
|
||||
echo 'ERROR: Please do not install dtbs to /usr/share/dtb!'
|
||||
echo 'ERROR: Unless you have a good reason not to, please put them in /boot/dtbs'
|
||||
echo 'ERROR: Files that need fixing:'
|
||||
# shellcheck disable=SC2016
|
||||
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Find old mkinitfs paths (pre mkinitfs 2.0)
|
||||
if grep -qr '/etc/postmarketos-mkinitfs' -- *; then
|
||||
echo "ERROR: Please replace '/etc/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
||||
grep --color=always -r '/etc/postmarketos-mkinitfs' -- *
|
||||
exit 1
|
||||
fi
|
||||
if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
|
||||
echo "ERROR: Please replace '/usr/share/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
||||
grep --color=always -r '/usr/share/postmarketos-mkinitfs' -- *
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Direct sourcing of deviceinfo
|
||||
if grep --exclude='source_deviceinfo' -qEr 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *; then
|
||||
echo 'ERROR: Please source the source_deviceinfo script instead of sourcing deviceinfo directly!'
|
||||
grep --color=always --exclude='rootfs-usr-share-misc-source_deviceinfo' -Er 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: check modified kernel configs
|
||||
# Options: native
|
||||
# Use 'native' because it requires running pmbootstrap.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
sh ./install_pmbootstrap.sh
|
||||
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
.ci/lib/check_changed_kernels.py
|
||||
@@ -1 +0,0 @@
|
||||
../testcases/add_pmbootstrap_to_import_path
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: build modified packages for this architecture
|
||||
# Options: native slow
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
sh ./install_pmbootstrap.sh
|
||||
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
# Get the architecture from the symlink we are running
|
||||
arch="$(echo "$0" | cut -d '-' -f 2 | cut -d '.' -f 1)"
|
||||
|
||||
set -x
|
||||
.ci/lib/build_changed_aports.py "$arch"
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import tempfile
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
# Same dir
|
||||
import common
|
||||
|
||||
# pmbootstrap
|
||||
import add_pmbootstrap_to_import_path # noqa
|
||||
import pmb.parse
|
||||
import pmb.helpers.logging
|
||||
|
||||
|
||||
def check_kconfig(args, pkgnames):
|
||||
last_failed = None
|
||||
for i in range(len(pkgnames)):
|
||||
pkgname = pkgnames[i]
|
||||
print(f" ({i+1}/{len(pkgnames)}) {pkgname}")
|
||||
|
||||
apkbuild_path = pmb.helpers.pmaports.find(args, pkgname)
|
||||
apkbuild = pmb.parse._apkbuild.apkbuild(f"{apkbuild_path}/APKBUILD")
|
||||
|
||||
options = []
|
||||
|
||||
for opt in apkbuild["options"]:
|
||||
if "pmb:kconfigcheck" in opt:
|
||||
options += [opt]
|
||||
|
||||
if len(options):
|
||||
options.sort()
|
||||
print(f'options="{" ".join(options)}"')
|
||||
|
||||
if "!pmb:kconfigcheck" in apkbuild["options"]:
|
||||
print("skipped (!pmb:kconfigcheck)")
|
||||
continue
|
||||
|
||||
if not pmb.parse.kconfig.check(args, pkgname, details=True):
|
||||
last_failed = pkgname
|
||||
|
||||
return last_failed
|
||||
|
||||
|
||||
def show_error(last_failed):
|
||||
print("")
|
||||
print("Please adjust your kernel config. This is required for getting your"
|
||||
" patch merged.")
|
||||
print("")
|
||||
print("Edit your kernel config:")
|
||||
print(f" pmbootstrap kconfig edit {last_failed}")
|
||||
print("")
|
||||
print("Test this kernel config again:")
|
||||
print(f" pmbootstrap kconfig check {last_failed}")
|
||||
print("")
|
||||
print("Run this check again (on all kernels you modified):")
|
||||
print(" pmbootstrap ci kconfig")
|
||||
print("")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
common.add_upstream_git_remote()
|
||||
pkgnames = common.get_changed_kernels()
|
||||
print(f"Changed kernels: {pkgnames}")
|
||||
|
||||
if len(pkgnames) == 0:
|
||||
print("No kernels changed in this branch")
|
||||
exit(0)
|
||||
|
||||
# Initialize args (so we can use pmbootstrap's kconfig parsing)
|
||||
sys.argv = ["pmbootstrap", "kconfig", "check"]
|
||||
args = pmb.parse.arguments()
|
||||
pmb.helpers.logging.init(args)
|
||||
|
||||
print("Running kconfig check on changed kernels...")
|
||||
last_failed = check_kconfig(args, pkgnames)
|
||||
|
||||
if last_failed:
|
||||
show_error(last_failed)
|
||||
exit(1)
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2023 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if ! mount | grep -q /proc/sys/fs/binfmt_misc; then
|
||||
echo "Mounting binfmt_misc"
|
||||
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
fi
|
||||
|
||||
if id "build" > /dev/null 2>&1; then
|
||||
echo "User 'build' exists already"
|
||||
else
|
||||
echo "Creating build user"
|
||||
adduser -D build
|
||||
chown -R build:build .
|
||||
echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
fi
|
||||
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $(basename "$0") \$CI_PROJECT_DIR"
|
||||
echo "usage: $(basename $0) \$CI_PROJECT_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2023 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Description: lint with various python tests
|
||||
# Options: native
|
||||
# Use 'native' because it requires pmbootstrap.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
sh ./install_pmbootstrap.sh pytest
|
||||
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
# Require pytest to be installed on the host system
|
||||
if [ -z "$(command -v pytest)" ]; then
|
||||
echo "ERROR: pytest command not found, make sure it is in your PATH."
|
||||
# Require pmbootstrap
|
||||
if ! command -v pmbootstrap > /dev/null; then
|
||||
echo "ERROR: pmbootstrap needs to be installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wrap pmbootstrap to use this repository for --aports
|
||||
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
|
||||
pmaports="$(cd $(dirname $0)/..; pwd -P)"
|
||||
_pmbootstrap="$(command -v pmbootstrap)"
|
||||
pmbootstrap() {
|
||||
"$_pmbootstrap" --aports="$pmaports" "$@"
|
||||
@@ -34,7 +23,6 @@ pmbootstrap -q shutdown
|
||||
# Make sure we have a valid device (pmbootstrap#1128)
|
||||
device="$(pmbootstrap config device)"
|
||||
deviceinfo="$pmaports/device/*/device-$device/deviceinfo"
|
||||
# shellcheck disable=SC2086
|
||||
if ! [ -e $deviceinfo ]; then
|
||||
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
|
||||
echo "Expected path: $deviceinfo"
|
||||
+15
-16
@@ -1,15 +1,16 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2023 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Description: lint all shell scripts
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
set -e
|
||||
DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
cd "$DIR/.."
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add shellcheck
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
# Find CHANGEMEs in APKBUILDs
|
||||
if grep -qr '(CHANGEME!)' *; then
|
||||
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
||||
grep --color=always -r '(CHANGEME!)' *
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Shell: shellcheck
|
||||
@@ -17,18 +18,17 @@ sh_files="
|
||||
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
|
||||
./main/osk-sdl/unlock.sh
|
||||
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
|
||||
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
|
||||
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
|
||||
./main/postmarketos-installkernel/installkernel-pmos
|
||||
./main/postmarketos-initramfs/init.sh
|
||||
./main/postmarketos-initramfs/init_functions.sh
|
||||
./main/postmarketos-mkinitfs/init.sh
|
||||
./main/postmarketos-mkinitfs/init_functions.sh
|
||||
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
|
||||
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
|
||||
./main/postmarketos-update-kernel/update-kernel.sh
|
||||
./main/swclock-offset/swclock-offset-boot.sh
|
||||
./main/swclock-offset/swclock-offset-shutdown.sh
|
||||
./main/ttyescape/*.post-install
|
||||
./main/unl0kr/unlock.sh
|
||||
./main/msm-firmware-loader/*.post-install
|
||||
./device/community/soc-qcom-sdm845/call_audio_idle_suspend_workaround.sh
|
||||
|
||||
$(find . -path './main/postmarketos-ui-*/*.sh')
|
||||
$(find . -path './main/postmarketos-ui-*/*.pre-install')
|
||||
@@ -42,11 +42,10 @@ sh_files="
|
||||
$(find . -path './main/devicepkg-dev/*.sh')
|
||||
$(find . -path './main/postmarketos-mvcfg/*.sh')
|
||||
|
||||
$(find . -path './.ci/**.sh')
|
||||
$(find . -path '.ci/*.sh')
|
||||
"
|
||||
|
||||
for file in $sh_files; do
|
||||
echo "Test with shellcheck: $file"
|
||||
cd "$DIR/$(dirname "$file")"
|
||||
cd "$DIR/../$(dirname "$file")"
|
||||
shellcheck -e SC1008 -x "$(basename "$file")"
|
||||
done
|
||||
@@ -15,10 +15,8 @@ def path_pmbootstrap():
|
||||
code from there.
|
||||
returns: pmbootstrap installation folder
|
||||
"""
|
||||
# This variable is set by pmbootstrap 1.52 and later
|
||||
# If it's undefined, try to find 'pmbootstrap' in path
|
||||
bin = os.environ.get("PMBOOTSTRAP_CMD") or shutil.which("pmbootstrap")
|
||||
|
||||
# Find 'pmbootstrap' executable
|
||||
bin = shutil.which("pmbootstrap")
|
||||
if not bin:
|
||||
print("ERROR: 'pmbootstrap' not found in $PATH")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -38,11 +38,7 @@ def test_aports_device(args):
|
||||
apkbuild = pmb.parse.apkbuild(path)
|
||||
|
||||
# Depends: Require "postmarketos-base"
|
||||
depend_flag = False
|
||||
for dependency in apkbuild["depends"]:
|
||||
if "postmarketos-base" == dependency or "postmarketos-base>" in dependency:
|
||||
depend_flag = True
|
||||
if not depend_flag:
|
||||
if "postmarketos-base" not in apkbuild["depends"]:
|
||||
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
|
||||
path)
|
||||
|
||||
|
||||
@@ -17,15 +17,12 @@ def deviceinfo_obsolete(info):
|
||||
Test for obsolete options used in the deviceinfo file. They must still be
|
||||
defined in pmbootstrap's config/__init__.py.
|
||||
"""
|
||||
obsolete_options = [
|
||||
"usb_rndis_function",
|
||||
"weston_pixman_type",
|
||||
]
|
||||
obsolete_options = ["weston_pixman_type"]
|
||||
for option in obsolete_options:
|
||||
if option in info and info[option]:
|
||||
raise RuntimeError(f"option {option} is obsolete, please rename"
|
||||
" or remove it (see reasons for removal of at"
|
||||
" https://postmarketos.org/deviceinfo)")
|
||||
if info[option]:
|
||||
raise RuntimeError("option '" + option + "' is obsolete, please"
|
||||
" remove it (reasons for removal are at"
|
||||
" <https://postmarketos.org/deviceinfo>)")
|
||||
|
||||
|
||||
def test_deviceinfo(args):
|
||||
|
||||
@@ -15,10 +15,8 @@ def test_aports_firmware(args):
|
||||
"""
|
||||
|
||||
excluded = [
|
||||
"firmware-motorola-ali", # Depends on firmware-qcom-adreno-a530
|
||||
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
|
||||
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-xiaomi-sagit", # Depends on soc-qcom-sdm845-nonfree-firmware
|
||||
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
|
||||
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
|
||||
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan
|
||||
@@ -43,8 +41,3 @@ def test_aports_firmware(args):
|
||||
raise RuntimeError(f"{aport_name}: \"!tracedeps\" missing in"
|
||||
" options= line. The tracedeps option is superfluous"
|
||||
" for firmware packages.")
|
||||
|
||||
if "noarch" in apkbuild["arch"]:
|
||||
raise RuntimeError(f"{aport_name}: \"arch\" must not be \"noarch\"!"
|
||||
" Please limit this firmware package to the"
|
||||
" required architectures only!")
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
|
||||
|
||||
def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
|
||||
"""
|
||||
Verify that a package or subpackage is using provides correctly.
|
||||
|
||||
:param path: to the APKBUILD for the error message
|
||||
:param apkbuild: either the full return of pmb.parse.apkbuild() or a
|
||||
subpackage of it (apkbuild["subpackages"][$subpkgname])
|
||||
:param version: like 1.0.0-r3 so we can check against it
|
||||
:param pkgname: package name
|
||||
:param subpkgname: subpackage name, if we are looking at a subpackage
|
||||
:returns: list of error strings
|
||||
"""
|
||||
name = pkgname
|
||||
if subpkgname:
|
||||
name = f"{pkgname}:{subpkgname}"
|
||||
|
||||
logging.info(f"{name}: checking provides")
|
||||
ret = []
|
||||
|
||||
if not apkbuild["provides"]:
|
||||
return ret
|
||||
|
||||
for provide in apkbuild["provides"]:
|
||||
# Having provides entries without version is valid if the
|
||||
# provider_priorty is also set (pma#1766)
|
||||
if apkbuild["provider_priority"]:
|
||||
continue
|
||||
# Otherwise the version =$pkgver-r$pkgrel needs to be set. pmbootstrap
|
||||
# already replaces the variables, so we check against the inserted
|
||||
# values here.
|
||||
if not provide.endswith(f"={version}"):
|
||||
provide_no_ver = provide.split("=", 1)[0]
|
||||
|
||||
error = f"error in {path}:\n"
|
||||
if subpkgname:
|
||||
error += f"in subpackage:\n {subpkgname}\n"
|
||||
else:
|
||||
error += f"in package:\n {pkgname}\n"
|
||||
error += f"broken provides entry:\n {provide_no_ver}\n"
|
||||
error += "\n"
|
||||
error += "This provides entry needs to be changed to"
|
||||
error += f" '{provide_no_ver}=$pkgver-r$pkgrel'"
|
||||
error += " (do not replace the variables, without '').\n"
|
||||
error += "\n"
|
||||
error += "If you know what you are doing and didn't add the"
|
||||
error += " version on purpose, you also need to set a"
|
||||
error += " provider_priority (pma#1766).\n"
|
||||
error += "Reference:"
|
||||
error += " https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#provides"
|
||||
ret += [error]
|
||||
return ret
|
||||
|
||||
|
||||
def test_provides(args):
|
||||
errors = []
|
||||
for path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
|
||||
apkbuild = pmb.parse.apkbuild(path)
|
||||
pkgname = apkbuild["pkgname"]
|
||||
version = f"{apkbuild['pkgver']}-r{apkbuild['pkgrel']}"
|
||||
path_rel = os.path.relpath(path, args.aports)
|
||||
errors += apkbuild_check_provides(path_rel, apkbuild, version, pkgname)
|
||||
|
||||
for subpkg, subpkg_data in apkbuild["subpackages"].items():
|
||||
if not subpkg_data:
|
||||
# default packaging function like -doc
|
||||
continue
|
||||
errors += apkbuild_check_provides(path_rel, subpkg_data, version,
|
||||
pkgname, subpkg)
|
||||
|
||||
if errors:
|
||||
for error in errors:
|
||||
logging.error(error)
|
||||
raise RuntimeError(f"test_provides failed with {len(errors)} errors")
|
||||
@@ -1,13 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Various checks on source= in the APKBUILDs
|
||||
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
@@ -23,13 +21,12 @@ def parse_source_from_checksums(args, apkbuild_path):
|
||||
to parse shell code (like in postmarketos-base).
|
||||
|
||||
:param apkbuild_path: full path to the APKBUILD
|
||||
:returns: dict of parsed "source" filenames and checksums, e.g.:
|
||||
{"first.patch": "b4dc4f3…",
|
||||
"second.patch": "b4dc4f3…"}
|
||||
:returns: list of parsed "source" files, e.g.:
|
||||
["first.patch", "second.patch"]
|
||||
"""
|
||||
start = 'sha512sums="'
|
||||
in_block = False
|
||||
ret = {}
|
||||
ret = []
|
||||
|
||||
with open(apkbuild_path, encoding="utf-8") as handle:
|
||||
for line in handle.readlines():
|
||||
@@ -46,21 +43,18 @@ def parse_source_from_checksums(args, apkbuild_path):
|
||||
continue
|
||||
|
||||
try:
|
||||
checksum, filename = line.rstrip().split(" ", 2)
|
||||
_, filename = line.rstrip().split(" ", 2)
|
||||
except ValueError:
|
||||
raise ValueError("Failed to parse checksums. Try to delete the"
|
||||
" checksums and generate them again with"
|
||||
f" 'pmbootstrap checksum': {apkbuild_path}")
|
||||
|
||||
# Cut off 'sha512sums="' if the first checksum is in that line
|
||||
if checksum.startswith(start):
|
||||
checksum = checksum[len(start):]
|
||||
|
||||
# Find end
|
||||
if filename.endswith('"'):
|
||||
filename = filename[:-1]
|
||||
ret += [filename[:-1]]
|
||||
break
|
||||
|
||||
ret[filename] = checksum
|
||||
ret += [filename]
|
||||
return ret
|
||||
|
||||
|
||||
@@ -69,10 +63,6 @@ def test_aports_unreferenced_files(args):
|
||||
Raise an error if an unreferenced file is found
|
||||
"""
|
||||
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
|
||||
# pmbootstrap parser has some issues with complicated APKBUILDs, skip those.
|
||||
if apkbuild_path.startswith(args.aports + "/cross/"):
|
||||
continue
|
||||
|
||||
apkbuild = pmb.parse.apkbuild(apkbuild_path)
|
||||
sources_chk = parse_source_from_checksums(args, apkbuild_path)
|
||||
|
||||
@@ -85,6 +75,9 @@ def test_aports_unreferenced_files(args):
|
||||
continue
|
||||
subpackage_installs += subpackage.get("install", [])
|
||||
subpackage_triggers += subpackage.get("triggers", [])
|
||||
print(subpackage_installs)
|
||||
if "device-nokia-n900-nonfree-firmware.post-install" in subpackage_installs:
|
||||
print(subpackage)
|
||||
|
||||
# Collect trigger files
|
||||
trigger_sources = []
|
||||
@@ -103,50 +96,3 @@ def test_aports_unreferenced_files(args):
|
||||
and rel_file_path not in subpackage_installs \
|
||||
and rel_file_path not in trigger_sources:
|
||||
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
|
||||
|
||||
|
||||
def test_distfiles_conflict(args):
|
||||
"""
|
||||
Make sure that each filename mentioned in any source= of any APKBUILD
|
||||
always has the same checksum. This is important because apk caches
|
||||
downloaded source files in a flat distfiles directory. So if two APKBUILDs
|
||||
both download a file with the same filename but different checksum, and the
|
||||
user builds both after each other, abuild will fail on the second build
|
||||
with a checksum error.
|
||||
"""
|
||||
source_all = {}
|
||||
for apkbuild_path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
|
||||
source = parse_source_from_checksums(args, apkbuild_path)
|
||||
dir_path = os.path.dirname(apkbuild_path)
|
||||
apkbuild_rel = os.path.relpath(apkbuild_path, args.aports)
|
||||
for filename, checksum in source.items():
|
||||
# Files bundled with the APKBUILD don't get copied to the distfiles
|
||||
# cache, so not relevant for this check. Use glob.glob here and not
|
||||
# iglob, because we don't want an iterator.
|
||||
if glob.glob(f"{dir_path}/**/{filename}", recursive=True):
|
||||
continue
|
||||
|
||||
# First time seeing this file
|
||||
if filename not in source_all:
|
||||
source_all[filename] = {"checksum": checksum,
|
||||
"apkbuild_rel": apkbuild_rel}
|
||||
continue
|
||||
|
||||
# Saw this file already with same checksum
|
||||
if checksum == source_all[filename]["checksum"]:
|
||||
continue
|
||||
|
||||
# Saw this file already with different checksum
|
||||
logging.error("")
|
||||
logging.error(f"ERROR: the source file '{filename}' has different"
|
||||
" checksums in the following files:")
|
||||
logging.error(f"- {source_all[filename]['apkbuild_rel']}:")
|
||||
logging.error(f" {source_all[filename]['checksum']}")
|
||||
logging.error(f"- {apkbuild_rel}:")
|
||||
logging.error(f" {checksum}")
|
||||
logging.error("")
|
||||
logging.error("Fix this by setting a different target filename in"
|
||||
" the package you modified:")
|
||||
logging.error("https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#source")
|
||||
logging.error("")
|
||||
raise RuntimeError(f"Conflict with source file '{filename}'")
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: verify devices are documented in the wiki
|
||||
# Options: native
|
||||
# Run natively so we don't need to set up a chroot, python3 is the only dep.
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add \
|
||||
python3
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
set -x
|
||||
.ci/lib/check_devices_in_wiki.py --booting
|
||||
+2
-2
@@ -7,8 +7,8 @@
|
||||
# Top-most EditorConfig file.
|
||||
root = true
|
||||
|
||||
[{**.{md,ini,sh,rules,nft},**/APKBUILD}]
|
||||
[**/APKBUILD]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
@@ -1,119 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This hook checks that all local sources specified in the staged APKBUILDs
|
||||
# are staged too or already committed and that checksums are correct.
|
||||
#
|
||||
set -eu
|
||||
|
||||
# Maximal allowed size (in bytes) of a file.
|
||||
FILE_SIZE_LIMIT=262144 # 256 kiB
|
||||
|
||||
|
||||
if ! command -v sha512sum >/dev/null; then
|
||||
# macOS / BSDs (?) don't have sha512sum, but shasum.
|
||||
alias sha512sum='shasum -a 512'
|
||||
fi
|
||||
|
||||
error() {
|
||||
printf '\033[0;31mpre-commit:\033[0m %s\n' "$1" >&2 # red
|
||||
}
|
||||
|
||||
# Prints paths of created or modified files being committed.
|
||||
changed_files() {
|
||||
git diff-index \
|
||||
--name-only \
|
||||
--cached \
|
||||
--diff-filter=ACMR HEAD \
|
||||
-- "$@"
|
||||
}
|
||||
|
||||
# Prints file names and checksums (in format <SHA-512>:<filename>) of local
|
||||
# sources specified in the APKBUILD ($1).
|
||||
apkbuild_local_sources() {
|
||||
apkbuild="$1"
|
||||
|
||||
set +eu
|
||||
. "$apkbuild" || {
|
||||
error "$apkbuild is invalid"
|
||||
return 1
|
||||
}
|
||||
set -eu
|
||||
|
||||
status=0
|
||||
: ${source:=""}
|
||||
for src in $source; do
|
||||
# Skip remote sources.
|
||||
case "$src" in */*) continue;; esac
|
||||
|
||||
echo "$sha512sums" | awk -v src="$src" '
|
||||
{ if ($2 == src) { ok=1; print($2 ":" $1) } }
|
||||
END { if (ok != 1) exit 1 }' || {
|
||||
status=1
|
||||
error "${apkbuild%/*}: file \"$src\" is missing in \$sha512sums (hint: run pmbootstrap checksum)"
|
||||
}
|
||||
done
|
||||
|
||||
return $status
|
||||
}
|
||||
|
||||
# check if given object is a symlink
|
||||
is_symlink() {
|
||||
test "$(git ls-files --stage "$1" | awk '{print $1}')" = "120000"
|
||||
}
|
||||
|
||||
# Checks that all local sources specified in the APKBUILD file ($1) are
|
||||
# available in git tree and checksums are correct.
|
||||
check_local_sources() {
|
||||
local apkbuild="$1"
|
||||
local startdir="${apkbuild%/*}"
|
||||
local status=0
|
||||
local checksum_act checksum_exp content filename line sources
|
||||
|
||||
sources=$(apkbuild_local_sources "$apkbuild")
|
||||
for line in $sources; do
|
||||
filename=${line%%:*}
|
||||
checksum_exp=${line#*:}
|
||||
|
||||
if ! git cat-file -e ":$startdir/$filename" 2>/dev/null; then
|
||||
error "$startdir: missing file \"$filename\""
|
||||
status=1
|
||||
continue
|
||||
fi
|
||||
|
||||
if is_symlink ":$startdir/$filename"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
checksum_act=$(git show ":$startdir/$filename" | sha512sum)
|
||||
if [ "$checksum_act" != "$checksum_exp -" ]; then
|
||||
local cmd="pmbootstrap checksum $(basename "$startdir")"
|
||||
error "$startdir: bad checksum for file \"$filename\" (hint: run $cmd)"
|
||||
status=1
|
||||
fi
|
||||
done
|
||||
|
||||
return $status
|
||||
}
|
||||
|
||||
# Checks if the file ($1) being committed is not bigger than FILE_SIZE_LIMIT.
|
||||
check_file_size() {
|
||||
local path="$1"
|
||||
local size
|
||||
|
||||
size=$(git cat-file -s ":$path")
|
||||
if [ $size -gt $FILE_SIZE_LIMIT ]; then
|
||||
local size_kb=$(( size / 1024 ))
|
||||
|
||||
error "file \"$path\" is quite big ($(( size / 1024 )) kiB), better put a remote url in source="
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
for apkbuild in $(changed_files '**/APKBUILD'); do
|
||||
check_local_sources "$apkbuild"
|
||||
done
|
||||
|
||||
for path in $(changed_files); do
|
||||
check_file_size "$path"
|
||||
done
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This hook adds prefix "<repo>/<pkgname>: " to the commit message when
|
||||
# committing changes of a single package.
|
||||
#
|
||||
MSG_FILE="$1"
|
||||
SOURCE="$2"
|
||||
|
||||
longest_common_prefix() {
|
||||
awk -F/ '
|
||||
(NR == 1) { split($0, prefix); prefix_len = NF }
|
||||
(NR > 1) {
|
||||
for (i = 1; i <= prefix_len; i++) {
|
||||
if (prefix[i] != $i) {
|
||||
prefix_len = i - 1; break
|
||||
}
|
||||
}
|
||||
}
|
||||
(prefix_len == 0) { exit }
|
||||
END {
|
||||
res = prefix[1]
|
||||
for (i = 2; i <= prefix_len; i++) {
|
||||
res = res FS prefix[i]
|
||||
}
|
||||
print(res)
|
||||
}'
|
||||
}
|
||||
|
||||
prepend_msg() {
|
||||
local prefix="$1"
|
||||
|
||||
printf '%s\n%s\n' "$prefix" "$(cat "$MSG_FILE")" > "$MSG_FILE"
|
||||
}
|
||||
|
||||
|
||||
# Do nothing if message has been given using -m, template, merge etc.
|
||||
[ -z "$SOURCE" ] || exit 0
|
||||
|
||||
lcp=$(git diff-index --name-only --cached HEAD | longest_common_prefix)
|
||||
|
||||
case "$lcp" in
|
||||
device/*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f3): ";;
|
||||
# Multiple packages touched for same device category
|
||||
# More logic could be added to detect if they all belong to same device
|
||||
device/*) ;;
|
||||
[^.]*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f1-2): ";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -20,6 +20,7 @@ dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
|
||||
+51
-43
@@ -3,7 +3,7 @@
|
||||
# global settings
|
||||
image: alpine:latest
|
||||
after_script:
|
||||
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
|
||||
- .ci/move_logs.sh $CI_PROJECT_DIR
|
||||
stages:
|
||||
- lint
|
||||
- build
|
||||
@@ -31,12 +31,13 @@ wiki:
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/device-*/*
|
||||
before_script:
|
||||
- apk -q add python3
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/wiki.sh
|
||||
- .ci/check_devices_in_wiki.py --booting
|
||||
|
||||
# testcases linting
|
||||
flake8:
|
||||
testcases-linting:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
only:
|
||||
@@ -48,35 +49,29 @@ flake8:
|
||||
before_script:
|
||||
- apk -q add py-flake8
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/flake8.sh
|
||||
- flake8 --ignore E501,F401,E722,W504,W605
|
||||
|
||||
# shellcheck and various grep checks
|
||||
shellcheck-grep:
|
||||
# shellcheck
|
||||
shellcheck:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
image: alpine:edge
|
||||
before_script:
|
||||
- apk -q add shellcheck
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/shellcheck.sh
|
||||
- .ci/grep.sh
|
||||
|
||||
editor-config:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
image: alpine:edge
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/ec.sh
|
||||
|
||||
# aports checks (generic)
|
||||
pytest-commits:
|
||||
aports-static:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/pytest.sh
|
||||
- .ci/commits.sh
|
||||
- su pmos -c ".ci/run_testcases.sh"
|
||||
- su pmos -c ".ci/check_changed_aports_versions.py"
|
||||
- su pmos -c ".ci/check-dtb-install-location.sh"
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
@@ -85,16 +80,40 @@ pytest-commits:
|
||||
- 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: lint
|
||||
before_script:
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/apkbuild-lint.sh
|
||||
- su pmos -c ".ci/apkbuild-linting.py"
|
||||
only:
|
||||
- merge_requests
|
||||
allow_failure: true
|
||||
|
||||
# check if nftable configs are valid
|
||||
nftables-check:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- apk -q add nftables
|
||||
script:
|
||||
- find -iname "*.nft" -type f -exec mv {} /etc/nftables.d \;
|
||||
- nft -c -f "/etc/nftables.nft"
|
||||
|
||||
# kernel kconfig check
|
||||
kernel-kconfig:
|
||||
stage: lint
|
||||
@@ -105,9 +124,11 @@ kernel-kconfig:
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
- main/linux-*/config-*
|
||||
before_script:
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/kconfig.sh
|
||||
- su pmos -c "pmbootstrap kconfig check"
|
||||
|
||||
# MR settings
|
||||
# (Checks for "Allow commits from members who can merge to the target branch")
|
||||
@@ -126,8 +147,10 @@ mr-settings:
|
||||
stage: build
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
after_script:
|
||||
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
- sh ./install_pmbootstrap.sh
|
||||
script:
|
||||
- .ci/build.sh
|
||||
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
@@ -137,30 +160,15 @@ mr-settings:
|
||||
|
||||
build-x86_64:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-x86_64.sh
|
||||
|
||||
build-x86:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-x86.sh
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-aarch64.sh
|
||||
|
||||
build-armv7:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-armv7.sh
|
||||
|
||||
build-armhf:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-armhf.sh
|
||||
|
||||
build-riscv64:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-riscv64.sh
|
||||
@@ -1,48 +0,0 @@
|
||||
<!--
|
||||
Thank you for using postmarketOS! In order to speed up process of resolving your issue,
|
||||
we would like you to fill in the following :
|
||||
-->
|
||||
### Describe your issue
|
||||
#### What's the expected behaviour?
|
||||
|
||||
#### What's the current behaviour?
|
||||
|
||||
#### How to reproduce your issue?
|
||||
|
||||
### What device are you using?
|
||||
<!--
|
||||
Leave name of your device in vendor-codename format.
|
||||
If unsure, check name in the device package or leave full name of device
|
||||
PinePhone: which revision exactly? See https://wiki.pine64.org/index.php/PinePhone#Hardware_revisions
|
||||
-->
|
||||
|
||||
### On what postmarketOS version did you encounter the issue?
|
||||
<!--
|
||||
Replace space inside `[ ]` with `x` to fill the checkbox
|
||||
-->
|
||||
* [ ] edge (`master` branch)
|
||||
* [ ] `v23.06`
|
||||
* [ ] `v22.12` (Supported until 2023-07-06)
|
||||
|
||||
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
|
||||
|
||||
### On what environment did you encounter the issue?
|
||||
#### Environments
|
||||
* [ ] GNOME Shell on Mobile
|
||||
* [ ] Phosh
|
||||
* [ ] Plasma Mobile
|
||||
* [ ] Sxmo (Wayland/Sway) **Please post the output of `sxmo_version.sh`**
|
||||
* [ ] Other: **Please fill out**
|
||||
### How did you get postmarketOS image?
|
||||
* [ ] from https://images.postmarketos.org
|
||||
* [ ] I built it using pmbootstrap
|
||||
* [ ] It was preinstalled on my device
|
||||
### What's the build date of the image? (in yyyy-mm-dd format)
|
||||
<!--
|
||||
Notes:
|
||||
can be left empty if unsure
|
||||
If you downloaded image from images.postmarketos.org, date will be in yyyymmdd format
|
||||
-->
|
||||
|
||||
### Additional information
|
||||
<!-- logs, etc. -- make use <details> for long listings -->
|
||||
+6
-1
@@ -1,7 +1,12 @@
|
||||
{
|
||||
"subject_format": {
|
||||
"pass": [
|
||||
"^(([a-z]+\\/[a-z\\-0-9*{}]+),?)+: [A-Za-z\\/\\-0-9*{}\\(\\)\\.,_&:=' ]+( \\(MR \\d+\\)|)$",
|
||||
"^[a-z]+/[a-z-0-9*{}]+: new aport(s|)( \\(MR \\d+\\)|)$",
|
||||
"^[a-z]+/[a-z-0-9*{}]+: pkgrel bump( \\(MR \\d+\\)|)$",
|
||||
"^[a-z-0-9*{}]+: new device \\([^\\)]+\\)( \\(MR \\d+\\)|)",
|
||||
"^[a-z]+/[a-z-0-9*{}]+: upgrade to [0-9\\.a-z\\-_]+( \\(MR \\d+\\)|)$",
|
||||
"^[a-z]+/[a-z-0-9*{}]+: remove( \\(MR \\d+\\)|)$",
|
||||
"^[a-z]+/[a-z-0-9*{}]+: remove, upstreamed( \\(MR \\d+\\)|)$",
|
||||
"^CI: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
|
||||
"^mrhlpr.json: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
|
||||
"^pmaports.cfg: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$"
|
||||
|
||||
+18
-85
@@ -1,88 +1,21 @@
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html
|
||||
|
||||
device/*/*-htc-golfu/ @Newbyte
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
|
||||
device/*/*-htc-m8qlul/ @Newbyte
|
||||
device/*/*-purism-librem5/ @craftyguy @bshah
|
||||
device/*/device-lg-judyln/ @Newbyte
|
||||
device/*/device-samsung-m0/ @Newbyte
|
||||
device/*/linux-postmarketos-exynos4/ @Newbyte
|
||||
device/*/linux-postmarketos-msm8939/ @Newbyte
|
||||
device/*/linux-postmarketos-stericsson/ @Newbyte
|
||||
device/*/*-qcom-sdm845/ @sdm845-mainline
|
||||
device/*/*-xiaomi-berrylium/ @joelselvaraj
|
||||
device/*/device-oneplus-enchilada/ @calebccff
|
||||
device/*/device-oneplus-fajita/ @calebccff
|
||||
device/*/firmware-oneplus-sdm845/ @calebccff
|
||||
device/*/device-shift-axolotl/ @amartinz @calebccff @dylanvanassche
|
||||
device/*/*-lenovo-a6010/ @jenneron
|
||||
device/*/*-lenovo-a6000/ @jenneron
|
||||
device/*/device-microsoft-surface-rt/ @jenneron
|
||||
device/*/device-google-fennel/ @jenneron
|
||||
device/*/device-google-veyron-minnie/ @jenneron
|
||||
device/*/device-google-burnet/ @jenneron
|
||||
device/*/device-google-elm/ @jenneron
|
||||
device/*/device-google-nyan-big/ @jenneron
|
||||
device/*/device-google-peach-pi/ @jenneron
|
||||
device/*/device-google-veyron-speedy/ @jenneron
|
||||
device/*/linux-google-veyron/ @jenneron
|
||||
device/*/u-boot-peach-pi/ @jenneron
|
||||
device/*/device-google-cozmo/ @jenneron
|
||||
device/*/u-boot-veyron-speedy/ @jenneron
|
||||
device/*/device-google-juniper/ @jenneron @binarycraft
|
||||
device/*/u-boot-peach-pit/ @jenneron
|
||||
device/*/device-google-damu/ @jenneron
|
||||
device/*/u-boot-nyan-4gb/ @jenneron
|
||||
device/*/device-google-kenzo/ @jenneron
|
||||
device/*/device-google-kodama/ @jenneron
|
||||
device/*/u-boot-snow/ @jenneron
|
||||
device/*/device-google-kevin/ @jenneron
|
||||
device/*/linux-postmarketos-exynos5/ @jenneron @Grimler
|
||||
device/*/device-google-krane/ @jenneron
|
||||
device/*/soc-mediatek-mt8183/ @jenneron
|
||||
device/*/u-boot-veyron-minnie/ @jenneron
|
||||
device/*/device-google-fennel14/ @jenneron
|
||||
device/*/linux-google-nyan/ @jenneron
|
||||
device/*/device-google-willow/ @jenneron
|
||||
device/*/linux-postmarketos-mediatek-mt8173/ @jenneron
|
||||
device/*/linux-postmarketos-mediatek-mt8183/ @jenneron @binarycraft
|
||||
device/*/device-google-nyan-blaze/ @jenneron
|
||||
device/*/firmware-powervr-gx6250/ @jenneron
|
||||
device/*/device-google-hana/ @jenneron
|
||||
device/*/device-google-snow/ @jenneron
|
||||
device/*/device-google-kappa/ @jenneron
|
||||
device/*/u-boot-nyan-2gb/ @jenneron
|
||||
device/*/device-google-veyron-jerry/ @jenneron
|
||||
device/*/device-google-kakadu/ @jenneron
|
||||
device/*/firmware-google-veyron-brcm/ @jenneron
|
||||
device/*/device-google-peach-pit/ @jenneron
|
||||
device/*/device-lg-judyp/ @jenneron
|
||||
device/*/device-asus-tf201/ @clamor95
|
||||
device/*/device-asus-tf300t/ @clamor95
|
||||
device/*/device-asus-tf300tg/ @clamor95
|
||||
device/*/device-asus-tf700t/ @clamor95
|
||||
device/*/device-lg-p895/ @clamor95
|
||||
device/*/firmware-asus-transformer/ @clamor95 @jenneron
|
||||
device/*/firmware-lg-x3/ @clamor95
|
||||
device/*/linux-postmarketos-grate/ @clamor95 @jenneron
|
||||
device/*/device-samsung-chagallwifi @Grimler
|
||||
device/*/device-odroid-xu4 @Grimler
|
||||
device/*/device-samsung-klimtlte @Grimler
|
||||
device/*/linux-samsung-klimtlte @Grimler
|
||||
device/*/firmware-odroid-xu4 @Grimler
|
||||
device/*/linux-samsung-chagallwifi @Grimler
|
||||
device/*/device-huawei-plank @gtrxAC
|
||||
device/*/linux-huawei-plank @gtrxAC
|
||||
device/*/*-htc-golfu/ @Newbyte
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
|
||||
device/*/*-htc-m8qlul/ @Newbyte
|
||||
device/*/*-purism-librem5/ @craftyguy @bshah
|
||||
device/*/device-lg-judyln/ @Newbyte
|
||||
device/*/device-samsung-m0/ @Newbyte
|
||||
device/*/linux-postmarketos-exynos4/ @Newbyte
|
||||
device/*/linux-postmarketos-msm8939/ @Newbyte
|
||||
device/*/linux-postmarketos-stericsson/ @Newbyte
|
||||
device/community/*-qcom-sdm845 @calebccff @joelselvaraj
|
||||
device/community/*-xiaomi-berrylium @joelselvaraj
|
||||
device/community/device-oneplus-enchilada @calebccff
|
||||
device/community/device-oneplus-fajita @calebccff
|
||||
main/osk-sdl/ @craftyguy
|
||||
main/postmarketos-ui-plasma-mobile/ @bshah
|
||||
main/ttyescape @calebccff
|
||||
temp/u-boot-librem5/ @craftyguy @bshah
|
||||
|
||||
main/postmarketos-update-depthcharge-kernel/ @jenneron
|
||||
main/osk-sdl/ @craftyguy
|
||||
main/postmarketos-ui-plasma-mobile/ @bshah
|
||||
main/ttyescape @calebccff
|
||||
temp/u-boot-librem5/ @craftyguy @bshah
|
||||
temp/alsa-ucm-conf-google-kukui/ @jenneron @binarycraft
|
||||
temp/alsa-ucm-conf-google-gru/ @jenneron
|
||||
device/*/*-videostrong-kii-pro/ @vitali64yt
|
||||
device/*/*-amlogic-s905* @vitali64yt
|
||||
device/*/linux-postmarketos-amlogic/ @vitali64yt @exkc
|
||||
|
||||
# vim: ts=8 sw=4 et
|
||||
# vim: ts=4 sw=4 et
|
||||
@@ -1,89 +0,0 @@
|
||||
# Policy for commits in pmaports
|
||||
|
||||
This document defines policy for organising and titling commits for
|
||||
inclusion in pmaports.
|
||||
|
||||
## Definitions
|
||||
|
||||
### Device-specific package
|
||||
|
||||
A device-specific package is used to apply configuration and
|
||||
functionality specifically for device support in postmarketOS.
|
||||
This is in contrast to other packages
|
||||
(e.g. main/postmarketos-ui-phosh) in postmarketOS that are used
|
||||
for configuring the distribution without consideration of the
|
||||
target device.
|
||||
|
||||
## General policy
|
||||
|
||||
We follow Alpine's aports commit style with some minor exceptions
|
||||
and additions. Alpine's commit style can be found here:
|
||||
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md
|
||||
|
||||
## Exceptions
|
||||
|
||||
### Changes to packages inside of the device directory
|
||||
|
||||
While Alpine has the policy of always prefixing package names with
|
||||
the name of the repository they are in, in the case of pmaports
|
||||
this can lead to excessively long commit titles due to the nested
|
||||
subfolders of the device directory. As such, commits changing
|
||||
packages inside of the device directory should omit the directory
|
||||
prefix, for example:
|
||||
|
||||
device-pine64-pinephone: description of change
|
||||
|
||||
Or:
|
||||
|
||||
soc-qcom-msm8996: description of change
|
||||
|
||||
If the commit only makes device-specific changes, the
|
||||
commit title can opt to use the following format:
|
||||
|
||||
manufacturer-codename: description of change
|
||||
|
||||
### Moving devices between categories
|
||||
|
||||
As we do not include directory prefixes in device-related commits,
|
||||
Alpine's commit style for moving packages does not apply. Instead,
|
||||
we do the following:
|
||||
|
||||
manufacturer-codename: move from category to category
|
||||
|
||||
For example:
|
||||
|
||||
samsung-m0: move from testing to community
|
||||
|
||||
## Additions
|
||||
|
||||
### Forking packages from Alpine
|
||||
|
||||
Run `pmbootstrap aportgen --fork-alpine package` and modify it.
|
||||
|
||||
#### Template
|
||||
|
||||
- temp/package-name: fork from Alpine
|
||||
|
||||
Example: temp/pulseaudio: fork from Alpine
|
||||
|
||||
#### Rules
|
||||
|
||||
One commit per forked package.
|
||||
|
||||
### Adding new devices
|
||||
|
||||
Adding a new device package and optionally also a device-specific
|
||||
Linux and firmware package.
|
||||
|
||||
#### Template
|
||||
|
||||
- manufacturer-codename: new device
|
||||
|
||||
Example: htc-m8qlul: new device
|
||||
|
||||
#### Rules
|
||||
|
||||
If the device has the option of making use of a device-specific
|
||||
kernel and/or firmware package, those packages should be included
|
||||
in the same commit that adds the device package. One device per
|
||||
commit.
|
||||
@@ -5,5 +5,4 @@ Helpful resources:
|
||||
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
|
||||
* [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/)
|
||||
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
|
||||
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
|
||||
* [postmarketOS commit style](./COMMITSTYLE.md)
|
||||
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
|
||||
+1
-13
@@ -8,20 +8,8 @@ branch_pmaports=master
|
||||
branch_aports=master
|
||||
mirrordir_alpine=edge
|
||||
|
||||
[v23.06]
|
||||
description=Latest release / Recommended for best stability
|
||||
branch_pmaports=v23.06
|
||||
branch_aports=3.18-stable
|
||||
mirrordir_alpine=v3.18
|
||||
|
||||
[v22.12]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v22.12
|
||||
branch_aports=3.17-stable
|
||||
mirrordir_alpine=v3.17
|
||||
|
||||
[v22.06]
|
||||
description=Old release (unsupported)
|
||||
description=Latest release / Recommended for best stability
|
||||
branch_pmaports=v22.06
|
||||
branch_aports=3.16-stable
|
||||
mirrordir_alpine=v3.16
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Tue, 21 Sep 2021 14:53:13 +0000
|
||||
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
|
||||
libraries"
|
||||
|
||||
This revert is needed to avoid wrongly tagging objects with the incompatible
|
||||
IBM long double ABI, which is not supported by musl and will result in
|
||||
linking errors if used.
|
||||
|
||||
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
|
||||
---
|
||||
bfd/elf32-tic6x.c | 3 ---
|
||||
ld/ldlang.c | 10 ++++------
|
||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
|
||||
index 5754f3cb860..3ad1d612749 100644
|
||||
--- a/bfd/elf32-tic6x.c
|
||||
+++ b/bfd/elf32-tic6x.c
|
||||
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|
||||
|
||||
case Tag_ABI_PIC:
|
||||
case Tag_ABI_PID:
|
||||
- /* Don't transfer these tags from dynamic objects. */
|
||||
- if ((ibfd->flags & DYNAMIC) != 0)
|
||||
- continue;
|
||||
if (out_attr[i].i > in_attr[i].i)
|
||||
out_attr[i].i = in_attr[i].i;
|
||||
break;
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..f13beaef9d9 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -7071,13 +7071,11 @@ lang_check (void)
|
||||
bfd_printable_name (input_bfd), input_bfd,
|
||||
bfd_printable_name (link_info.output_bfd));
|
||||
}
|
||||
-
|
||||
- /* If the input bfd has no contents, it shouldn't set the
|
||||
- private data of the output bfd. */
|
||||
- else if (!file->flags.just_syms
|
||||
- && ((input_bfd->flags & DYNAMIC) != 0
|
||||
- || bfd_count_sections (input_bfd) != 0))
|
||||
+ else if (bfd_count_sections (input_bfd))
|
||||
{
|
||||
+ /* If the input bfd has no contents, it shouldn't set the
|
||||
+ private data of the output bfd. */
|
||||
+
|
||||
bfd_error_handler_type pfn = NULL;
|
||||
|
||||
/* If we aren't supposed to warn about mismatched input
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-aarch64
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
CTARGET_ARCH=aarch64
|
||||
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||
|
||||
pkgname=binutils-aarch64
|
||||
pkgver=2.39
|
||||
pkgrel=2
|
||||
pkgdesc="Tools necessary to build programs for aarch64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build="bison flex texinfo"
|
||||
makedepends_host="zlib-dev"
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
binutils-mips-disable-assert.patch
|
||||
CVE-2022-38533.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
subpackages="$subpackages binutils-gold"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.39-r2:
|
||||
# - CVE-2022-38533
|
||||
# 2.39-r0:
|
||||
# - CVE-2022-38126
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
local _sysroot=/
|
||||
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||
local _arch_configure=""
|
||||
local _gold_configure="--disable-gold"
|
||||
local _plugin_configure="--enable-plugins"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
_sysroot="$CBUILDROOT"
|
||||
_cross_configure="--disable-install-libiberty"
|
||||
_plugin_configure="--disable-plugins"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
_gold_configure="--enable-gold"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "x86_64" ]; then
|
||||
_arch_configure="--enable-targets=x86_64-pep"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "riscv64" ]; then
|
||||
_gold_configure="--disable-gold"
|
||||
fi
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--enable-default-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--enable-default-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--disable-multilib \
|
||||
--disable-gprofng \
|
||||
--enable-ld=default \
|
||||
$_gold_configure \
|
||||
--enable-64-bit-bfd \
|
||||
$_plugin_configure \
|
||||
--enable-relro \
|
||||
--enable-deterministic-archives \
|
||||
--enable-default-execstack=no \
|
||||
$_cross_configure \
|
||||
$_arch_configure \
|
||||
$_hash_style_configure \
|
||||
--with-pic \
|
||||
--disable-werror \
|
||||
--disable-nls \
|
||||
--with-mmap \
|
||||
--with-system-zlib
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
make install DESTDIR="$pkgdir"
|
||||
if [ -d "$pkgdir"/usr/lib64 ]; then
|
||||
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
|
||||
rmdir "$pkgdir"/usr/lib64
|
||||
fi
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# creating cross tools: remove any files that would conflict
|
||||
# with the native tools, or other cross tools
|
||||
rm -r "${pkgdir:?}"/usr/share
|
||||
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||
fi
|
||||
}
|
||||
|
||||
libs() {
|
||||
pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
mkdir -p "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin
|
||||
fi
|
||||
mkdir -p "$subpkgdir"/usr/$CTARGET/bin
|
||||
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
631726e557524633ace39c597acbc5ac39bfd25f7b292eee1f0b2a80a503f4ff799f027757d12d5a24b2fa3c07c7e14602d8a86d96e19876d6d0d5d1a02817e7 CVE-2022-38533.patch
|
||||
"
|
||||
@@ -0,0 +1,22 @@
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff_plain;f=bfd%2Fcoffcode.h;h=52027981c3f052d98e043cd0c877f0bb5da97c7f;hp=67aaf158ca1829fe63f0065f31a0b1009b227b36;hb=ef186fe54aa6d281a3ff8a9528417e5cc614c797;hpb=80075150727d653c39e9d037e15c6b87dcef08cd
|
||||
|
||||
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
|
||||
index 67aaf158ca1..52027981c3f 100644
|
||||
--- a/bfd/coffcode.h
|
||||
+++ b/bfd/coffcode.h
|
||||
@@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd,
|
||||
|
||||
rec = (bfd_byte *) location;
|
||||
recend = rec + count;
|
||||
- while (rec < recend)
|
||||
+ while (recend - rec >= 4)
|
||||
{
|
||||
+ size_t len = bfd_get_32 (abfd, rec);
|
||||
+ if (len == 0 || len > (size_t) (recend - rec) / 4)
|
||||
+ break;
|
||||
+ rec += len * 4;
|
||||
++section->lma;
|
||||
- rec += bfd_get_32 (abfd, rec) * 4;
|
||||
}
|
||||
|
||||
BFD_ASSERT (rec == recend);
|
||||
@@ -0,0 +1,46 @@
|
||||
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}}
|
||||
@@ -0,0 +1,14 @@
|
||||
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
|
||||
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
|
||||
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
|
||||
@@ -6744,8 +6744,10 @@
|
||||
in the relocation. */
|
||||
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
|
||||
{
|
||||
+#if 0
|
||||
BFD_ASSERT (htab->root.target_os == is_vxworks
|
||||
|| h->global_got_area != GGA_NONE);
|
||||
+#endif
|
||||
indx = h->root.dynindx;
|
||||
if (SGI_COMPAT (output_bfd))
|
||||
defined_p = h->root.def_regular;
|
||||
@@ -0,0 +1,39 @@
|
||||
# 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
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ./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
|
||||
@@ -0,0 +1,55 @@
|
||||
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Tue, 21 Sep 2021 14:53:13 +0000
|
||||
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
|
||||
libraries"
|
||||
|
||||
This revert is needed to avoid wrongly tagging objects with the incompatible
|
||||
IBM long double ABI, which is not supported by musl and will result in
|
||||
linking errors if used.
|
||||
|
||||
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
|
||||
---
|
||||
bfd/elf32-tic6x.c | 3 ---
|
||||
ld/ldlang.c | 10 ++++------
|
||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
|
||||
index 5754f3cb860..3ad1d612749 100644
|
||||
--- a/bfd/elf32-tic6x.c
|
||||
+++ b/bfd/elf32-tic6x.c
|
||||
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|
||||
|
||||
case Tag_ABI_PIC:
|
||||
case Tag_ABI_PID:
|
||||
- /* Don't transfer these tags from dynamic objects. */
|
||||
- if ((ibfd->flags & DYNAMIC) != 0)
|
||||
- continue;
|
||||
if (out_attr[i].i > in_attr[i].i)
|
||||
out_attr[i].i = in_attr[i].i;
|
||||
break;
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..f13beaef9d9 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -7071,13 +7071,11 @@ lang_check (void)
|
||||
bfd_printable_name (input_bfd), input_bfd,
|
||||
bfd_printable_name (link_info.output_bfd));
|
||||
}
|
||||
-
|
||||
- /* If the input bfd has no contents, it shouldn't set the
|
||||
- private data of the output bfd. */
|
||||
- else if (!file->flags.just_syms
|
||||
- && ((input_bfd->flags & DYNAMIC) != 0
|
||||
- || bfd_count_sections (input_bfd) != 0))
|
||||
+ else if (bfd_count_sections (input_bfd))
|
||||
{
|
||||
+ /* If the input bfd has no contents, it shouldn't set the
|
||||
+ private data of the output bfd. */
|
||||
+
|
||||
bfd_error_handler_type pfn = NULL;
|
||||
|
||||
/* If we aren't supposed to warn about mismatched input
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armhf
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
CTARGET_ARCH=armhf
|
||||
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||
|
||||
pkgname=binutils-armhf
|
||||
pkgver=2.39
|
||||
pkgrel=2
|
||||
pkgdesc="Tools necessary to build programs for armhf targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build="bison flex texinfo"
|
||||
makedepends_host="zlib-dev"
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
binutils-mips-disable-assert.patch
|
||||
CVE-2022-38533.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
subpackages="$subpackages binutils-gold"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.39-r2:
|
||||
# - CVE-2022-38533
|
||||
# 2.39-r0:
|
||||
# - CVE-2022-38126
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
local _sysroot=/
|
||||
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||
local _arch_configure=""
|
||||
local _gold_configure="--disable-gold"
|
||||
local _plugin_configure="--enable-plugins"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
_sysroot="$CBUILDROOT"
|
||||
_cross_configure="--disable-install-libiberty"
|
||||
_plugin_configure="--disable-plugins"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
_gold_configure="--enable-gold"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "x86_64" ]; then
|
||||
_arch_configure="--enable-targets=x86_64-pep"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "riscv64" ]; then
|
||||
_gold_configure="--disable-gold"
|
||||
fi
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--enable-default-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--enable-default-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--disable-multilib \
|
||||
--disable-gprofng \
|
||||
--enable-ld=default \
|
||||
$_gold_configure \
|
||||
--enable-64-bit-bfd \
|
||||
$_plugin_configure \
|
||||
--enable-relro \
|
||||
--enable-deterministic-archives \
|
||||
--enable-default-execstack=no \
|
||||
$_cross_configure \
|
||||
$_arch_configure \
|
||||
$_hash_style_configure \
|
||||
--with-pic \
|
||||
--disable-werror \
|
||||
--disable-nls \
|
||||
--with-mmap \
|
||||
--with-system-zlib
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
make install DESTDIR="$pkgdir"
|
||||
if [ -d "$pkgdir"/usr/lib64 ]; then
|
||||
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
|
||||
rmdir "$pkgdir"/usr/lib64
|
||||
fi
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# creating cross tools: remove any files that would conflict
|
||||
# with the native tools, or other cross tools
|
||||
rm -r "${pkgdir:?}"/usr/share
|
||||
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||
fi
|
||||
}
|
||||
|
||||
libs() {
|
||||
pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
mkdir -p "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin
|
||||
fi
|
||||
mkdir -p "$subpkgdir"/usr/$CTARGET/bin
|
||||
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
631726e557524633ace39c597acbc5ac39bfd25f7b292eee1f0b2a80a503f4ff799f027757d12d5a24b2fa3c07c7e14602d8a86d96e19876d6d0d5d1a02817e7 CVE-2022-38533.patch
|
||||
"
|
||||
@@ -0,0 +1,22 @@
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff_plain;f=bfd%2Fcoffcode.h;h=52027981c3f052d98e043cd0c877f0bb5da97c7f;hp=67aaf158ca1829fe63f0065f31a0b1009b227b36;hb=ef186fe54aa6d281a3ff8a9528417e5cc614c797;hpb=80075150727d653c39e9d037e15c6b87dcef08cd
|
||||
|
||||
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
|
||||
index 67aaf158ca1..52027981c3f 100644
|
||||
--- a/bfd/coffcode.h
|
||||
+++ b/bfd/coffcode.h
|
||||
@@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd,
|
||||
|
||||
rec = (bfd_byte *) location;
|
||||
recend = rec + count;
|
||||
- while (rec < recend)
|
||||
+ while (recend - rec >= 4)
|
||||
{
|
||||
+ size_t len = bfd_get_32 (abfd, rec);
|
||||
+ if (len == 0 || len > (size_t) (recend - rec) / 4)
|
||||
+ break;
|
||||
+ rec += len * 4;
|
||||
++section->lma;
|
||||
- rec += bfd_get_32 (abfd, rec) * 4;
|
||||
}
|
||||
|
||||
BFD_ASSERT (rec == recend);
|
||||
@@ -0,0 +1,46 @@
|
||||
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}}
|
||||
@@ -0,0 +1,14 @@
|
||||
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
|
||||
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
|
||||
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
|
||||
@@ -6744,8 +6744,10 @@
|
||||
in the relocation. */
|
||||
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
|
||||
{
|
||||
+#if 0
|
||||
BFD_ASSERT (htab->root.target_os == is_vxworks
|
||||
|| h->global_got_area != GGA_NONE);
|
||||
+#endif
|
||||
indx = h->root.dynindx;
|
||||
if (SGI_COMPAT (output_bfd))
|
||||
defined_p = h->root.def_regular;
|
||||
@@ -0,0 +1,39 @@
|
||||
# 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
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ./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
|
||||
@@ -0,0 +1,55 @@
|
||||
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Tue, 21 Sep 2021 14:53:13 +0000
|
||||
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
|
||||
libraries"
|
||||
|
||||
This revert is needed to avoid wrongly tagging objects with the incompatible
|
||||
IBM long double ABI, which is not supported by musl and will result in
|
||||
linking errors if used.
|
||||
|
||||
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
|
||||
---
|
||||
bfd/elf32-tic6x.c | 3 ---
|
||||
ld/ldlang.c | 10 ++++------
|
||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
|
||||
index 5754f3cb860..3ad1d612749 100644
|
||||
--- a/bfd/elf32-tic6x.c
|
||||
+++ b/bfd/elf32-tic6x.c
|
||||
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|
||||
|
||||
case Tag_ABI_PIC:
|
||||
case Tag_ABI_PID:
|
||||
- /* Don't transfer these tags from dynamic objects. */
|
||||
- if ((ibfd->flags & DYNAMIC) != 0)
|
||||
- continue;
|
||||
if (out_attr[i].i > in_attr[i].i)
|
||||
out_attr[i].i = in_attr[i].i;
|
||||
break;
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..f13beaef9d9 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -7071,13 +7071,11 @@ lang_check (void)
|
||||
bfd_printable_name (input_bfd), input_bfd,
|
||||
bfd_printable_name (link_info.output_bfd));
|
||||
}
|
||||
-
|
||||
- /* If the input bfd has no contents, it shouldn't set the
|
||||
- private data of the output bfd. */
|
||||
- else if (!file->flags.just_syms
|
||||
- && ((input_bfd->flags & DYNAMIC) != 0
|
||||
- || bfd_count_sections (input_bfd) != 0))
|
||||
+ else if (bfd_count_sections (input_bfd))
|
||||
{
|
||||
+ /* If the input bfd has no contents, it shouldn't set the
|
||||
+ private data of the output bfd. */
|
||||
+
|
||||
bfd_error_handler_type pfn = NULL;
|
||||
|
||||
/* If we aren't supposed to warn about mismatched input
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armv7
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
CTARGET_ARCH=armv7
|
||||
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||
|
||||
pkgname=binutils-armv7
|
||||
pkgver=2.39
|
||||
pkgrel=2
|
||||
pkgdesc="Tools necessary to build programs for armv7 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build="bison flex texinfo"
|
||||
makedepends_host="zlib-dev"
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
ld-bfd-mips.patch
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
binutils-mips-disable-assert.patch
|
||||
CVE-2022-38533.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
subpackages="$subpackages binutils-gold"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.39-r2:
|
||||
# - CVE-2022-38533
|
||||
# 2.39-r0:
|
||||
# - CVE-2022-38126
|
||||
# 2.35.2-r1:
|
||||
# - CVE-2021-3487
|
||||
# 2.32-r0:
|
||||
# - CVE-2018-19931
|
||||
# - CVE-2018-19932
|
||||
# - CVE-2018-20002
|
||||
# - CVE-2018-20712
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
local _sysroot=/
|
||||
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||
local _arch_configure=""
|
||||
local _gold_configure="--disable-gold"
|
||||
local _plugin_configure="--enable-plugins"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
_sysroot="$CBUILDROOT"
|
||||
_cross_configure="--disable-install-libiberty"
|
||||
_plugin_configure="--disable-plugins"
|
||||
fi
|
||||
|
||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||
_gold_configure="--enable-gold"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "x86_64" ]; then
|
||||
_arch_configure="--enable-targets=x86_64-pep"
|
||||
fi
|
||||
|
||||
if [ "$CTARGET_ARCH" = "riscv64" ]; then
|
||||
_gold_configure="--disable-gold"
|
||||
fi
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--enable-default-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--enable-default-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--disable-multilib \
|
||||
--disable-gprofng \
|
||||
--enable-ld=default \
|
||||
$_gold_configure \
|
||||
--enable-64-bit-bfd \
|
||||
$_plugin_configure \
|
||||
--enable-relro \
|
||||
--enable-deterministic-archives \
|
||||
--enable-default-execstack=no \
|
||||
$_cross_configure \
|
||||
$_arch_configure \
|
||||
$_hash_style_configure \
|
||||
--with-pic \
|
||||
--disable-werror \
|
||||
--disable-nls \
|
||||
--with-mmap \
|
||||
--with-system-zlib
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
make install DESTDIR="$pkgdir"
|
||||
if [ -d "$pkgdir"/usr/lib64 ]; then
|
||||
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
|
||||
rmdir "$pkgdir"/usr/lib64
|
||||
fi
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# creating cross tools: remove any files that would conflict
|
||||
# with the native tools, or other cross tools
|
||||
rm -r "${pkgdir:?}"/usr/share
|
||||
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||
fi
|
||||
}
|
||||
|
||||
libs() {
|
||||
pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
mkdir -p "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin
|
||||
fi
|
||||
mkdir -p "$subpkgdir"/usr/$CTARGET/bin
|
||||
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||
631726e557524633ace39c597acbc5ac39bfd25f7b292eee1f0b2a80a503f4ff799f027757d12d5a24b2fa3c07c7e14602d8a86d96e19876d6d0d5d1a02817e7 CVE-2022-38533.patch
|
||||
"
|
||||
@@ -0,0 +1,22 @@
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff_plain;f=bfd%2Fcoffcode.h;h=52027981c3f052d98e043cd0c877f0bb5da97c7f;hp=67aaf158ca1829fe63f0065f31a0b1009b227b36;hb=ef186fe54aa6d281a3ff8a9528417e5cc614c797;hpb=80075150727d653c39e9d037e15c6b87dcef08cd
|
||||
|
||||
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
|
||||
index 67aaf158ca1..52027981c3f 100644
|
||||
--- a/bfd/coffcode.h
|
||||
+++ b/bfd/coffcode.h
|
||||
@@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd,
|
||||
|
||||
rec = (bfd_byte *) location;
|
||||
recend = rec + count;
|
||||
- while (rec < recend)
|
||||
+ while (recend - rec >= 4)
|
||||
{
|
||||
+ size_t len = bfd_get_32 (abfd, rec);
|
||||
+ if (len == 0 || len > (size_t) (recend - rec) / 4)
|
||||
+ break;
|
||||
+ rec += len * 4;
|
||||
++section->lma;
|
||||
- rec += bfd_get_32 (abfd, rec) * 4;
|
||||
}
|
||||
|
||||
BFD_ASSERT (rec == recend);
|
||||
@@ -0,0 +1,46 @@
|
||||
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}}
|
||||
@@ -0,0 +1,14 @@
|
||||
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
|
||||
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
|
||||
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
|
||||
@@ -6744,8 +6744,10 @@
|
||||
in the relocation. */
|
||||
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
|
||||
{
|
||||
+#if 0
|
||||
BFD_ASSERT (htab->root.target_os == is_vxworks
|
||||
|| h->global_got_area != GGA_NONE);
|
||||
+#endif
|
||||
indx = h->root.dynindx;
|
||||
if (SGI_COMPAT (output_bfd))
|
||||
defined_p = h->root.def_regular;
|
||||
@@ -0,0 +1,39 @@
|
||||
# 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
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ./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
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.36.1
|
||||
pkgrel=4
|
||||
pkgver=1.35.0
|
||||
pkgrel=27
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -32,5 +32,5 @@ package() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
c0ea71bcec70e35de3dcb919c22c02afe7e35b3168845209e93bcd15ff380d62dc807848e36e1e5fef22c16adbbdfc1dc3a3559015d0c4a3b2978e0e303d4413 busybox-static-1.36.1-r4-aarch64-edge.apk
|
||||
1df3f1400461a3b9c951be9bf4ade500af9b83b4a11025bb244224cee197753d95471a8373a2f5f45d343599f632629c005dc7eba2c3d558dfbcfa56063ed110 busybox-static-1.35.0-r27-aarch64-edge.apk
|
||||
"
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armhf
|
||||
pkgver=1.36.1
|
||||
pkgrel=4
|
||||
pkgver=1.35.0
|
||||
pkgrel=27
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -32,5 +32,5 @@ package() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
701ee52541aee37a075563c430b891860afd205e4446379a4686b3eac57ce8443c1203b06fb90f146c88064e00d99101c86d0d8b3a91377e465d46958c942366 busybox-static-1.36.1-r4-armhf-edge.apk
|
||||
cdc8cfb4e013ad0761d2417fba91f75221d97074705bcd4f8ae7a64d0badadff2340595b5d03ff0e5ca608f543ce85f4ba82820a4fd501ecb758d77432afcf90 busybox-static-1.35.0-r27-armhf-edge.apk
|
||||
"
|
||||
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.36.1
|
||||
pkgrel=4
|
||||
pkgver=1.35.0
|
||||
pkgrel=27
|
||||
|
||||
_arch="armv7"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -32,5 +32,5 @@ package() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
e01fdc7edfe06b9b8c30acb0df90f026c49982d378724c8afd4e545f5ab7e9d317a9fd8e1e7ae06d3f89e3ddf5e572ad3f7d2d033225f195d5bc7530e6e4bcd2 busybox-static-1.36.1-r4-armv7-edge.apk
|
||||
65678aa673f8fb11d0a68b7d22203ab9ce2795fb6b3d47c117f8cbecf61305316bb0b0de12812df5d7fe2febe0630fd6ca3961434ffe8051da6a0e194c133cb4 busybox-static-1.35.0-r27-armv7-edge.apk
|
||||
"
|
||||
@@ -1,14 +1,14 @@
|
||||
From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001
|
||||
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Fri, 26 Jan 2018 20:32:50 +0000
|
||||
Subject: [PATCH 01/34] posix_memalign
|
||||
Subject: [PATCH] posix_memalign
|
||||
|
||||
---
|
||||
gcc/config/i386/pmm_malloc.h | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
|
||||
index 3527283693b..c4071b64b53 100644
|
||||
index 3b2e4f47915..20f790904a2 100644
|
||||
--- a/gcc/config/i386/pmm_malloc.h
|
||||
+++ b/gcc/config/i386/pmm_malloc.h
|
||||
@@ -27,12 +27,13 @@
|
||||
@@ -37,6 +37,3 @@ index 3527283693b..c4071b64b53 100644
|
||||
return __ptr;
|
||||
else
|
||||
return NULL;
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001
|
||||
From dd1e75ff4ecda96957465b34681f245e818928bd 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 02/34] gcc: poison-system-directories
|
||||
Subject: [PATCH] gcc: poison-system-directories
|
||||
|
||||
Add /sw/include and /opt/include based on the original
|
||||
zecke-no-host-includes.patch patch. The original patch checked for
|
||||
@@ -26,10 +26,10 @@ Upstream-Status: Pending
|
||||
7 files changed, 68 insertions(+)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 862c474d3c8..64c4277c991 100644
|
||||
index 8a0dafc522d..0357868e22c 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -711,6 +711,10 @@ Wreturn-local-addr
|
||||
@@ -710,6 +710,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.
|
||||
|
||||
@@ -41,10 +41,10 @@ index 862c474d3c8..64c4277c991 100644
|
||||
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 4cad077bfbe..0679fbbf4c6 100644
|
||||
index 64c27c9cfac..f0fbf123aa8 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -236,6 +236,12 @@
|
||||
@@ -230,6 +230,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@ index 4cad077bfbe..0679fbbf4c6 100644
|
||||
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 c7b26d1927d..8c46369f73f 100755
|
||||
index 5ce0557719a..e9060112384 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
|
||||
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_link_serialization
|
||||
enable_version_specific_runtime_libs
|
||||
@@ -69,7 +69,7 @@ index c7b26d1927d..8c46369f73f 100755
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1788,6 +1789,8 @@ Optional Features:
|
||||
@@ -1785,6 +1786,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
@@ -78,7 +78,7 @@ index c7b26d1927d..8c46369f73f 100755
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
|
||||
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
@@ -99,10 +99,10 @@ index c7b26d1927d..8c46369f73f 100755
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 09082e8ccae..5504bf6eb01 100644
|
||||
index 23bee7010a3..75a7048045c 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
@@ -120,37 +120,37 @@ index 09082e8ccae..5504bf6eb01 100644
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index af0e5933fdb..b6731a4673c 100644
|
||||
index 07b440190c3..b2de464798a 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
|
||||
-Wparentheses -Wno-pedantic-ms-format
|
||||
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
|
||||
+-Wno-poison-system-directories
|
||||
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
|
||||
-Wrestrict -Wno-return-local-addr -Wreturn-type
|
||||
-Wno-scalar-storage-order -Wsequence-point
|
||||
@@ -8426,6 +8427,14 @@ made up of data only and thus requires no special treatment. But, for
|
||||
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
|
||||
-Wparentheses -Wno-pedantic-ms-format @gol
|
||||
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
|
||||
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
|
||||
-Wno-scalar-storage-order -Wsequence-point @gol
|
||||
@@ -8029,6 +8030,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.
|
||||
|
||||
+@opindex Wno-poison-system-directories
|
||||
+@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
|
||||
@item -Wfloat-equal
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 16bb07f2cdc..33b56e721d2 100644
|
||||
index bb07cc244e3..47fb5802194 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -1146,6 +1146,8 @@ proper position among the other output files. */
|
||||
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
@@ -160,7 +160,7 @@ index 16bb07f2cdc..33b56e721d2 100644
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
|
||||
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
|
||||
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
|
||||
index 4d44321183f..0f3f071b44c 100644
|
||||
index bd2a97938eb..c80f100f476 100644
|
||||
--- a/gcc/incpath.cc
|
||||
+++ b/gcc/incpath.cc
|
||||
@@ -26,6 +26,7 @@
|
||||
@@ -198,6 +198,3 @@ index 4d44321183f..0f3f071b44c 100644
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001
|
||||
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
||||
Subject: [PATCH 03/34] specs: turn on -Wl,-z,now by default
|
||||
Subject: [PATCH] specs: turn on -Wl,-z,now by default
|
||||
|
||||
Previously, we also used to turn on -z relro here, but we now build
|
||||
binutils with --enable-relro, which is functionally equivalent.
|
||||
@@ -14,24 +14,24 @@ now by default.
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index b6731a4673c..f393c7846c6 100644
|
||||
index b2de464798a..83bd1bde433 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -17961,6 +17961,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
||||
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
||||
linker. When using the GNU linker, you can also get the same effect with
|
||||
@option{-Wl,-Map=output.map}.
|
||||
|
||||
+NOTE: In Alpine Linux, for LDFLAGS, the option
|
||||
+@option{-Wl,-z,now} is used. To disable, use @option{-Wl,-z,nonow}.
|
||||
+
|
||||
@opindex u
|
||||
@item -u @var{symbol}
|
||||
@opindex u
|
||||
Pretend the symbol @var{symbol} is undefined, to force linking of
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 33b56e721d2..f82fae23c22 100644
|
||||
index 47fb5802194..d18b5d7b59a 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
|
||||
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
|
||||
"%{flto|flto=*:%<fcompare-debug*} \
|
||||
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
@@ -39,6 +39,3 @@ index 33b56e721d2..f82fae23c22 100644
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
%{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
From 1b315235433701e4a974da259b8d651169ddc7ac Mon Sep 17 00:00:00 2001
|
||||
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:46:22 +0000
|
||||
Subject: [PATCH 04/34] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
|
||||
ObjC, ObjC++, if the optimization level is > 0
|
||||
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
|
||||
ObjC++, if the optimization level is > 0
|
||||
|
||||
---
|
||||
gcc/c-family/c-cppbuiltin.cc | 4 ++++
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH 04/34] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
|
||||
index 5d64625fcd7..868d69506e4 100644
|
||||
index 4672ae8486a..573c021e1e8 100644
|
||||
--- a/gcc/c-family/c-cppbuiltin.cc
|
||||
+++ b/gcc/c-family/c-cppbuiltin.cc
|
||||
@@ -1546,6 +1546,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
@@ -25,10 +25,10 @@ index 5d64625fcd7..868d69506e4 100644
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index f393c7846c6..ef3c14a189e 100644
|
||||
index 83bd1bde433..dda299a9987 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -11868,6 +11868,12 @@ also turns on the following optimization flags:
|
||||
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
|
||||
Please note the warning under @option{-fgcse} about
|
||||
invoking @option{-O2} on programs that use computed gotos.
|
||||
|
||||
@@ -38,9 +38,6 @@ index f393c7846c6..ef3c14a189e 100644
|
||||
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
|
||||
+@option{-D_FORTIFY_SOURCE=0}.
|
||||
+
|
||||
@opindex O3
|
||||
@item -O3
|
||||
@opindex O3
|
||||
Optimize yet more. @option{-O3} turns on all optimizations specified
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001
|
||||
From 75d1a35180cf0967f062765314bf091a64032062 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:46:56 +0000
|
||||
Subject: [PATCH 05/34] On linux targets pass --as-needed by default to the
|
||||
linker, but always link the sanitizer libraries with --no-as-needed.
|
||||
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
|
||||
but always link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
---
|
||||
gcc/config/aarch64/aarch64-linux.h | 1 +
|
||||
@@ -22,7 +22,7 @@ Subject: [PATCH 05/34] On linux targets pass --as-needed by default to the
|
||||
14 files changed, 36 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
|
||||
index 4277f03da2a..b131983a546 100644
|
||||
index 5e4553d79f5..b516f3ef97f 100644
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h
|
||||
@@ -35,6 +35,7 @@
|
||||
@@ -34,7 +34,7 @@ index 4277f03da2a..b131983a546 100644
|
||||
%{shared:-shared} \
|
||||
%{symbolic:-Bsymbolic} \
|
||||
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
|
||||
index 03f783f2ad1..d946e700dda 100644
|
||||
index 17f16a55910..9ec667e9a5e 100644
|
||||
--- a/gcc/config/alpha/linux-elf.h
|
||||
+++ b/gcc/config/alpha/linux-elf.h
|
||||
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -47,7 +47,7 @@ index 03f783f2ad1..d946e700dda 100644
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
|
||||
index 7b7b7cbbe14..49c050c6f2c 100644
|
||||
index df3da67c4f0..7532bc29f9b 100644
|
||||
--- a/gcc/config/arm/linux-elf.h
|
||||
+++ b/gcc/config/arm/linux-elf.h
|
||||
@@ -70,6 +70,7 @@
|
||||
@@ -59,7 +59,7 @@ index 7b7b7cbbe14..49c050c6f2c 100644
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index eda8010b133..b26b17f2f2a 100644
|
||||
index 857c0e077bf..8433e56c3e1 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
@@ -69,9 +69,9 @@ index eda8010b133..b26b17f2f2a 100644
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBHWASAN_EARLY_SPEC
|
||||
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
|
||||
"%{static-libhwasan:%{!shared:" \
|
||||
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
|
||||
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
|
||||
"%{static-libtsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
|
||||
@@ -87,7 +87,7 @@ index eda8010b133..b26b17f2f2a 100644
|
||||
|
||||
#undef TARGET_F951_OPTIONS
|
||||
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
|
||||
index a79b739089d..e0752673dff 100644
|
||||
index 0102b2a6f3b..994414c1845 100644
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -100,7 +100,7 @@ index a79b739089d..e0752673dff 100644
|
||||
%{!static: \
|
||||
%{!static-pie: \
|
||||
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
|
||||
index 3b63b99acf6..759bf0db86f 100644
|
||||
index abc8cf624ca..fe656aeae27 100644
|
||||
--- a/gcc/config/i386/gnu-user64.h
|
||||
+++ b/gcc/config/i386/gnu-user64.h
|
||||
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
@@ -112,7 +112,7 @@ index 3b63b99acf6..759bf0db86f 100644
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
|
||||
index 5dfd428aa17..02656dad7fc 100644
|
||||
index 93510098ccc..3813e536423 100644
|
||||
--- a/gcc/config/ia64/linux.h
|
||||
+++ b/gcc/config/ia64/linux.h
|
||||
@@ -58,7 +58,7 @@ do { \
|
||||
@@ -125,7 +125,7 @@ index 5dfd428aa17..02656dad7fc 100644
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
|
||||
index a4e5380b589..3cc61bce69f 100644
|
||||
index 6aad7192e69..e1256a55add 100644
|
||||
--- a/gcc/config/mips/gnu-user.h
|
||||
+++ b/gcc/config/mips/gnu-user.h
|
||||
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -137,10 +137,10 @@ index a4e5380b589..3cc61bce69f 100644
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
|
||||
index 3e625e0f867..f8c2c351e5a 100644
|
||||
index 38803723ba9..3067ed6eac8 100644
|
||||
--- a/gcc/config/riscv/linux.h
|
||||
+++ b/gcc/config/riscv/linux.h
|
||||
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
"%{mabi=ilp32:_ilp32}"
|
||||
|
||||
#define LINK_SPEC "\
|
||||
@@ -149,7 +149,7 @@ index 3e625e0f867..f8c2c351e5a 100644
|
||||
%{mno-relax:--no-relax} \
|
||||
%{mbig-endian:-EB} \
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index 9e457033d11..08016bf224d 100644
|
||||
index b2a7afabc73..34ceb4e4fce 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -377,13 +377,13 @@ extern int dot_symbols;
|
||||
@@ -169,10 +169,10 @@ index 9e457033d11..08016bf224d 100644
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
|
||||
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
|
||||
index ae932fc22f0..c8ff0c6dc8e 100644
|
||||
index 7e2519de5d4..61215a7a1b3 100644
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
|
||||
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
|
||||
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
#endif
|
||||
|
||||
@@ -182,7 +182,7 @@ index ae932fc22f0..c8ff0c6dc8e 100644
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
|
||||
|
||||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 02aa1edaff8..64df5801134 100644
|
||||
index d7b7e7a7b02..d2287f14f2e 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -195,7 +195,7 @@ index 02aa1edaff8..64df5801134 100644
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
|
||||
index 0e33b3cac2c..c2f44546e62 100644
|
||||
index 6a809e9092d..93bfb92d3ff 100644
|
||||
--- a/gcc/config/sparc/linux.h
|
||||
+++ b/gcc/config/sparc/linux.h
|
||||
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
||||
@@ -208,10 +208,10 @@ index 0e33b3cac2c..c2f44546e62 100644
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index f82fae23c22..da6417dd0d1 100644
|
||||
index d18b5d7b59a..3b76311b544 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -754,8 +754,11 @@ proper position among the other output files. */
|
||||
@@ -744,8 +744,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBASAN_EARLY_SPEC
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
@@ -225,7 +225,7 @@ index f82fae23c22..da6417dd0d1 100644
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -790,8 +793,11 @@ proper position among the other output files. */
|
||||
@@ -780,8 +783,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
@@ -239,7 +239,7 @@ index f82fae23c22..da6417dd0d1 100644
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -808,8 +814,11 @@ proper position among the other output files. */
|
||||
@@ -798,8 +804,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
@@ -253,7 +253,7 @@ index f82fae23c22..da6417dd0d1 100644
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -824,8 +833,11 @@ proper position among the other output files. */
|
||||
@@ -814,8 +823,11 @@ proper position among the other output files. */
|
||||
#define STATIC_LIBUBSAN_LIBS \
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
@@ -267,6 +267,3 @@ index f82fae23c22..da6417dd0d1 100644
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001
|
||||
From c664283dd30949c5299d1c45bd5740bcfe993d22 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:47:43 +0000
|
||||
Subject: [PATCH 06/34] Enable -Wformat and -Wformat-security by default.
|
||||
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
|
||||
|
||||
---
|
||||
gcc/c-family/c.opt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
|
||||
index a75038930ae..b98726f33ed 100644
|
||||
index 07da40ef43b..8683f706426 100644
|
||||
--- a/gcc/c-family/c.opt
|
||||
+++ b/gcc/c-family/c.opt
|
||||
@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end
|
||||
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
|
||||
of the destination region. Same as -Wformat-overflow=1.
|
||||
|
||||
Wformat-security
|
||||
@@ -20,7 +20,7 @@ index a75038930ae..b98726f33ed 100644
|
||||
Warn about possible security problems with format functions.
|
||||
|
||||
Wformat-signedness
|
||||
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
|
||||
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
|
||||
Warn about zero-length formats.
|
||||
|
||||
Wformat=
|
||||
@@ -29,6 +29,3 @@ index a75038930ae..b98726f33ed 100644
|
||||
Warn about printf/scanf/strftime/strfmon format string anomalies.
|
||||
|
||||
Wformat-overflow=
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001
|
||||
From e4d0ec43e772b6dc7c3708aed5309897df26a125 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:48:24 +0000
|
||||
Subject: [PATCH 07/34] Enable -Wtrampolines by default.
|
||||
Subject: [PATCH] Enable -Wtrampolines by default.
|
||||
|
||||
---
|
||||
gcc/common.opt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 64c4277c991..c24839d32bc 100644
|
||||
index 0357868e22c..6d5e5eebe60 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
|
||||
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers.
|
||||
|
||||
Wtrampolines
|
||||
@@ -20,6 +20,3 @@ index 64c4277c991..c24839d32bc 100644
|
||||
Warn whenever a trampoline is generated.
|
||||
|
||||
Wtrivial-auto-var-init
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001
|
||||
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:49:40 +0000
|
||||
Subject: [PATCH 08/34] Disable ssp on -nostdlib, -nodefaultlibs and
|
||||
-ffreestanding Change the buffer size.
|
||||
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
|
||||
Change the buffer size.
|
||||
|
||||
---
|
||||
gcc/gcc.cc | 8 +++++++-
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH 08/34] Disable ssp on -nostdlib, -nodefaultlibs and
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index da6417dd0d1..b5a6f200635 100644
|
||||
index 3b76311b544..cc99d0b7aa1 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -983,6 +983,12 @@ proper position among the other output files. */
|
||||
@@ -996,6 +996,12 @@ proper position among the other output files. */
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@ index da6417dd0d1..b5a6f200635 100644
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
|
||||
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
|
||||
%{-version:--version}\
|
||||
%{-help=*:--help=%*}\
|
||||
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
|
||||
@@ -36,10 +36,10 @@ index da6417dd0d1..b5a6f200635 100644
|
||||
%{fprofile-arcs|fprofile-generate*|coverage:\
|
||||
%{!fprofile-update=single:\
|
||||
diff --git a/gcc/params.opt b/gcc/params.opt
|
||||
index 823cdb2ff85..5b096899b40 100644
|
||||
index b88e1372005..82a7e25dd2f 100644
|
||||
--- a/gcc/params.opt
|
||||
+++ b/gcc/params.opt
|
||||
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
|
||||
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
|
||||
The maximum number of SSA_NAME assignments to follow in determining a value.
|
||||
|
||||
-param=ssp-buffer-size=
|
||||
@@ -48,6 +48,3 @@ index 823cdb2ff85..5b096899b40 100644
|
||||
The lower bound for a buffer to be considered for stack smashing protection.
|
||||
|
||||
-param=stack-clash-protection-guard-size=
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001
|
||||
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:50:33 +0000
|
||||
Subject: [PATCH 09/34] Ensure that msgfmt doesn't encounter problems during
|
||||
gcc bootstrapping.
|
||||
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
|
||||
bootstrapping.
|
||||
|
||||
Solves error messages like the following:
|
||||
|
||||
@@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
|
||||
index 12d34910830..61b13762b71 100644
|
||||
index 8f51544989e..5329804d136 100644
|
||||
--- a/libstdc++-v3/po/Makefile.am
|
||||
+++ b/libstdc++-v3/po/Makefile.am
|
||||
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
|
||||
@@ -38,7 +38,7 @@ index 12d34910830..61b13762b71 100644
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
|
||||
index 8e93445acd2..d6ff06e5ddb 100644
|
||||
index 243f3db7b72..822210781fa 100644
|
||||
--- a/libstdc++-v3/po/Makefile.in
|
||||
+++ b/libstdc++-v3/po/Makefile.in
|
||||
@@ -561,6 +561,7 @@ uninstall-am:
|
||||
@@ -49,6 +49,3 @@ index 8e93445acd2..d6ff06e5ddb 100644
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001
|
||||
From 190064993cd8ddbd48015c1fc1916e4110a97733 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:52:07 +0000
|
||||
Subject: [PATCH 10/34] Don't declare asprintf if defined as a macro.
|
||||
Subject: [PATCH] Don't declare asprintf if defined as a macro.
|
||||
|
||||
---
|
||||
include/libiberty.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/include/libiberty.h b/include/libiberty.h
|
||||
index 1d5c779fcff..19e3cb1e31c 100644
|
||||
index a65ced9c820..eb20ab0f95f 100644
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
|
||||
@@ -23,6 +23,3 @@ index 1d5c779fcff..19e3cb1e31c 100644
|
||||
|
||||
/* Like asprintf but allocates memory without fail. This works like
|
||||
xmalloc. */
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001
|
||||
From 838e1daa955d9013c462be3471497cb39641e951 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:53:00 +0000
|
||||
Subject: [PATCH 11/34] libiberty: copy PIC objects during build process
|
||||
Subject: [PATCH] libiberty: copy PIC objects during build process
|
||||
|
||||
---
|
||||
libiberty/Makefile.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
|
||||
index 72608f3e4a7..58356884728 100644
|
||||
index 1b17c2e3a47..8db1176df2e 100644
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
@@ -19,6 +19,3 @@ index 72608f3e4a7..58356884728 100644
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 717346fbbd6642ba6b0c3af2deb3771794346507 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:53:36 +0000
|
||||
Subject: [PATCH] libitm: disable FORTIFY
|
||||
|
||||
---
|
||||
libitm/configure.tgt | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
|
||||
index 06e90973ef3..669e64236c3 100644
|
||||
--- a/libitm/configure.tgt
|
||||
+++ b/libitm/configure.tgt
|
||||
@@ -47,6 +47,16 @@ if test "$gcc_cv_have_tls" = yes ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
+# FIXME: error: inlining failed in call to always_inline
|
||||
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’
|
||||
+# : function body can be overwritten at link time
|
||||
+# Disable Fortify in libitm for now. #508852
|
||||
+case "${target}" in
|
||||
+ *-*-linux*)
|
||||
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
# Map the target cpu to an ARCH sub-directory. At the same time,
|
||||
# work out any special compilation flags as necessary.
|
||||
case "${target_cpu}" in
|
||||
@@ -1,7 +1,7 @@
|
||||
From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001
|
||||
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 24 Oct 2015 20:09:53 +0000
|
||||
Subject: [PATCH 12/34] libgcc_s
|
||||
Subject: [PATCH] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386-expand.cc | 4 ++--
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH 12/34] libgcc_s
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
|
||||
index 0d817fc3f3b..2e99db00db9 100644
|
||||
index 31780b6daf7..d89898846e1 100644
|
||||
--- a/gcc/config/i386/i386-expand.cc
|
||||
+++ b/gcc/config/i386/i386-expand.cc
|
||||
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
@@ -27,7 +27,7 @@ index 0d817fc3f3b..2e99db00db9 100644
|
||||
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
|
||||
}
|
||||
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
|
||||
index 50b6d8248a2..724ced402a1 100644
|
||||
index dab1d98060f..cf824b4114a 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
|
||||
@@ -52,6 +52,3 @@ index 8506a635790..564296f788e 100644
|
||||
-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.41.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001
|
||||
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 7 Nov 2015 02:08:05 +0000
|
||||
Subject: [PATCH 13/34] nopie
|
||||
Subject: [PATCH] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 13/34] nopie
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 8c46369f73f..e59cbee1767 100755
|
||||
index e9060112384..2f6b3265a6c 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -32268,6 +32268,33 @@ fi
|
||||
@@ -32497,6 +32497,33 @@ fi
|
||||
$as_echo "$gcc_cv_no_pie" >&6; }
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
@@ -47,10 +47,10 @@ index 8c46369f73f..e59cbee1767 100755
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 5504bf6eb01..57268319de1 100644
|
||||
index 75a7048045c..e683d3a7a5f 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7552,6 +7552,19 @@ AC_CACHE_CHECK([for -no-pie option],
|
||||
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
|
||||
LDFLAGS="$saved_LDFLAGS"])
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
@@ -70,6 +70,3 @@ index 5504bf6eb01..57268319de1 100644
|
||||
fi
|
||||
AC_SUBST([NO_PIE_FLAG])
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:18:32 +0000
|
||||
Subject: [PATCH] dlang: use libucontext on mips64
|
||||
|
||||
---
|
||||
libphobos/configure.tgt | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
|
||||
index 0063dd23249..c5e782a1238 100644
|
||||
--- a/libphobos/configure.tgt
|
||||
+++ b/libphobos/configure.tgt
|
||||
@@ -38,6 +38,7 @@ case "${target}" in
|
||||
;;
|
||||
mips*-*-linux*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
|
||||
;;
|
||||
power*-*-freebsd*)
|
||||
LIBPHOBOS_SUPPORTED=yes
|
||||
+3
-6
@@ -1,14 +1,14 @@
|
||||
From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001
|
||||
From fd642f8cd61849a9dc169588be5562ceda96a889 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:59:16 +0000
|
||||
Subject: [PATCH 14/34] ada: fix shared linking
|
||||
Subject: [PATCH] ada: fix shared linking
|
||||
|
||||
---
|
||||
gcc/ada/link.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
|
||||
index f2126441208..22cfa9c641f 100644
|
||||
index a7574efb472..0ad0d66463c 100644
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|
||||
@@ -37,6 +37,3 @@ index f2126441208..22cfa9c641f 100644
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+4
-7
@@ -1,17 +1,17 @@
|
||||
From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001
|
||||
From a547632f5c7caec4a164e8d5e5b568fb7a461365 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 06:59:43 +0000
|
||||
Subject: [PATCH 15/34] build: fix CXXFLAGS_FOR_BUILD passing
|
||||
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
|
||||
|
||||
---
|
||||
Makefile.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 06a9398e172..6ff2b3f9925 100644
|
||||
index 593495e1650..b96f60e33e2 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -178,6 +178,7 @@ BUILD_EXPORTS = \
|
||||
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
@@ -19,6 +19,3 @@ index 06a9398e172..6ff2b3f9925 100644
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:03:42 +0000
|
||||
Subject: [PATCH 18/34] DP: Use --push-state/--pop-state for gold as well when
|
||||
linking libtsan.
|
||||
|
||||
---
|
||||
gcc/gcc.cc | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 6cbb726599b..59390fd39d6 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -755,10 +755,10 @@ proper position among the other output files. */
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libasan:--push-state --no-as-needed}" \
|
||||
" -lasan " \
|
||||
" %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libasan:--pop-state}" \
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -794,10 +794,10 @@ proper position among the other output files. */
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libtsan:--push-state --no-as-needed}" \
|
||||
" -ltsan " \
|
||||
" %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libtsan:--pop-state}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -815,10 +815,10 @@ proper position among the other output files. */
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-liblsan:--push-state --no-as-needed}" \
|
||||
" -llsan " \
|
||||
" %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-liblsan:--pop-state}" \
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -834,10 +834,10 @@ proper position among the other output files. */
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " %{!static-libubsan:--push-state --no-as-needed}" \
|
||||
" -lubsan " \
|
||||
" %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
+ " %{!static-libubsan:--pop-state}" \
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+4
-7
@@ -1,17 +1,17 @@
|
||||
From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001
|
||||
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:01:06 +0000
|
||||
Subject: [PATCH 16/34] add fortify-headers paths
|
||||
Subject: [PATCH] add fortify-headers paths
|
||||
|
||||
---
|
||||
gcc/config/linux.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
|
||||
index e3aca79cccc..b3537b8fbeb 100644
|
||||
index 74f70793d90..61b07f319f6 100644
|
||||
--- a/gcc/config/linux.h
|
||||
+++ b/gcc/config/linux.h
|
||||
@@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
|
||||
#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
@@ -20,6 +20,3 @@ index e3aca79cccc..b3537b8fbeb 100644
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+7
-10
@@ -1,11 +1,11 @@
|
||||
From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001
|
||||
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
|
||||
Date: Fri, 21 Aug 2020 07:03:00 +0000
|
||||
Subject: [PATCH 17/34] 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.
|
||||
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
|
||||
it unconditionally, as otherwise we get link failures if some objects are
|
||||
-fstack-protector built and final link happens with -fno-stack-protector.
|
||||
This seems to be the common case when bootstrapping gcc, the piepatches do
|
||||
not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
|
||||
not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
|
||||
stack-protector flag usage.
|
||||
|
||||
---
|
||||
@@ -13,10 +13,10 @@ Subject: [PATCH 17/34] Alpine musl package provides libssp_nonshared.a. We
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index b5a6f200635..6cbb726599b 100644
|
||||
index cc99d0b7aa1..c60a75371f8 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -991,8 +991,7 @@ proper position among the other output files. */
|
||||
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
@@ -26,6 +26,3 @@ index b5a6f200635..6cbb726599b 100644
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+7
-10
@@ -1,7 +1,7 @@
|
||||
From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001
|
||||
From bbd5c529ef878c2d6096fd4949616714eb82683a Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:03:42 +0000
|
||||
Subject: [PATCH 18/34] DP: Use --push-state/--pop-state for gold as well when
|
||||
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
|
||||
linking libtsan.
|
||||
|
||||
---
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 18/34] DP: Use --push-state/--pop-state for gold as well when
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 6cbb726599b..59390fd39d6 100644
|
||||
index c60a75371f8..735b2b1bba1 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -755,10 +755,10 @@ proper position among the other output files. */
|
||||
@@ -745,10 +745,10 @@ proper position among the other output files. */
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
@@ -25,7 +25,7 @@ index 6cbb726599b..59390fd39d6 100644
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -794,10 +794,10 @@ proper position among the other output files. */
|
||||
@@ -784,10 +784,10 @@ proper position among the other output files. */
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
@@ -38,7 +38,7 @@ index 6cbb726599b..59390fd39d6 100644
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -815,10 +815,10 @@ proper position among the other output files. */
|
||||
@@ -805,10 +805,10 @@ proper position among the other output files. */
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
@@ -51,7 +51,7 @@ index 6cbb726599b..59390fd39d6 100644
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -834,10 +834,10 @@ proper position among the other output files. */
|
||||
@@ -824,10 +824,10 @@ proper position among the other output files. */
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
@@ -64,6 +64,3 @@ index 6cbb726599b..59390fd39d6 100644
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 714ed6d9649bf9ed42e34fef9c41169921e63921 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Andreas Svee <me@lochnair.net>
|
||||
Date: Thu, 21 Dec 2017 03:14:33 +0100
|
||||
Subject: [PATCH] mips64: disable multilib support
|
||||
|
||||
multilib is not supported by Alpine GCC
|
||||
---
|
||||
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 858bbba3a36..2d4f553e652 100644
|
||||
--- a/gcc/config/mips/mips.h
|
||||
+++ b/gcc/config/mips/mips.h
|
||||
@@ -3447,11 +3447,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 2fdd8e00407..406a3676289 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
|
||||
@@ -1,81 +0,0 @@
|
||||
From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:14:33 +0000
|
||||
Subject: [PATCH 21/34] ppc64[le]: disable multilib support
|
||||
|
||||
multilib is not presently supported on Alpine GCC
|
||||
---
|
||||
gcc/config/rs6000/t-linux | 6 ++++--
|
||||
gcc/config/rs6000/t-linux64 | 4 ++--
|
||||
gcc/config/rs6000/t-linux64bele | 4 ++--
|
||||
gcc/config/rs6000/t-linux64lebe | 4 ++--
|
||||
4 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
|
||||
index 4e371255533..128c75c7d39 100644
|
||||
--- a/gcc/config/rs6000/t-linux
|
||||
+++ b/gcc/config/rs6000/t-linux
|
||||
@@ -2,7 +2,8 @@
|
||||
# or soft-float.
|
||||
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
|
||||
ifneq (,$(findstring powerpc64,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
else
|
||||
MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
|
||||
endif
|
||||
@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target)))
|
||||
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
|
||||
endif
|
||||
ifneq (,$(findstring powerpc64le,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
endif
|
||||
endif
|
||||
|
||||
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
|
||||
index 01a94242308..b3a76379c03 100644
|
||||
--- a/gcc/config/rs6000/t-linux64
|
||||
+++ b/gcc/config/rs6000/t-linux64
|
||||
@@ -28,8 +28,8 @@
|
||||
MULTILIB_OPTIONS := m64/m32
|
||||
MULTILIB_DIRNAMES := 64 32
|
||||
MULTILIB_EXTRA_OPTS :=
|
||||
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
|
||||
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc
|
||||
$(COMPILE) $<
|
||||
diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele
|
||||
index 97c1ee6fb4d..08d72639cb6 100644
|
||||
--- a/gcc/config/rs6000/t-linux64bele
|
||||
+++ b/gcc/config/rs6000/t-linux64bele
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mlittle
|
||||
MULTILIB_DIRNAMES += le
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe
|
||||
index 2e63bdb9fc9..c6e1c5db65d 100644
|
||||
--- a/gcc/config/rs6000/t-linux64lebe
|
||||
+++ b/gcc/config/rs6000/t-linux64lebe
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mbig
|
||||
MULTILIB_DIRNAMES += be
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+3
-6
@@ -1,7 +1,7 @@
|
||||
From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001
|
||||
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:12:55 +0000
|
||||
Subject: [PATCH 19/34] aarch64: disable multilib support
|
||||
Subject: [PATCH] aarch64: disable multilib support
|
||||
|
||||
multilib is unsupported on Alpine GCC
|
||||
---
|
||||
@@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
|
||||
index 57bf4100fcd..172894b57ef 100644
|
||||
index d0cd546002a..b63a77f4969 100644
|
||||
--- a/gcc/config/aarch64/t-aarch64-linux
|
||||
+++ b/gcc/config/aarch64/t-aarch64-linux
|
||||
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
|
||||
@@ -21,6 +21,3 @@ index 57bf4100fcd..172894b57ef 100644
|
||||
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
|
||||
|
||||
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+2
-5
@@ -1,7 +1,7 @@
|
||||
From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001
|
||||
From 65ad898df141261a1ccd891a99133ad8f9847133 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:13:59 +0000
|
||||
Subject: [PATCH 20/34] s390x: disable multilib support
|
||||
Subject: [PATCH] s390x: disable multilib support
|
||||
|
||||
multilib is not supported on Alpine GCC at present
|
||||
---
|
||||
@@ -20,6 +20,3 @@ index cc6ab367072..7f498ee1cdc 100644
|
||||
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+3
-6
@@ -1,7 +1,7 @@
|
||||
From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001
|
||||
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:14:33 +0000
|
||||
Subject: [PATCH 21/34] ppc64[le]: disable multilib support
|
||||
Subject: [PATCH] ppc64[le]: disable multilib support
|
||||
|
||||
multilib is not presently supported on Alpine GCC
|
||||
---
|
||||
@@ -36,7 +36,7 @@ index 4e371255533..128c75c7d39 100644
|
||||
endif
|
||||
|
||||
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
|
||||
index 01a94242308..b3a76379c03 100644
|
||||
index 47e0efd5764..f89729af64f 100644
|
||||
--- a/gcc/config/rs6000/t-linux64
|
||||
+++ b/gcc/config/rs6000/t-linux64
|
||||
@@ -28,8 +28,8 @@
|
||||
@@ -76,6 +76,3 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+3
-6
@@ -1,7 +1,7 @@
|
||||
From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001
|
||||
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 6 Jan 2022 03:14:54 +0000
|
||||
Subject: [PATCH 22/34] x86_64: disable multilib support
|
||||
Subject: [PATCH] x86_64: disable multilib support
|
||||
|
||||
multilib is not presently supported on Alpine GCC
|
||||
---
|
||||
@@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
|
||||
index 138956b0962..bc03dab874f 100644
|
||||
index 5526ad0e6cc..78866afab36 100644
|
||||
--- a/gcc/config/i386/t-linux64
|
||||
+++ b/gcc/config/i386/t-linux64
|
||||
@@ -33,6 +33,6 @@
|
||||
@@ -21,6 +21,3 @@ index 138956b0962..bc03dab874f 100644
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+6
-11
@@ -1,7 +1,7 @@
|
||||
From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001
|
||||
From 2eed19787020ce52cf07b76a5d167c420ec42b61 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Mon, 3 Jan 2022 07:14:48 +0100
|
||||
Subject: [PATCH 23/34] riscv: disable multilib support
|
||||
Subject: [PATCH] riscv: disable multilib support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
@@ -38,15 +38,15 @@ library.
|
||||
[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122
|
||||
[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369
|
||||
---
|
||||
gcc/config/riscv/linux.h | 8 --------
|
||||
gcc/config/riscv/linux.h | 6 ------
|
||||
gcc/config/riscv/t-linux | 7 +++++--
|
||||
2 files changed, 5 insertions(+), 10 deletions(-)
|
||||
2 files changed, 5 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
|
||||
index f8c2c351e5a..8d9881eadeb 100644
|
||||
index 3067ed6eac8..4c8c85e3285 100644
|
||||
--- a/gcc/config/riscv/linux.h
|
||||
+++ b/gcc/config/riscv/linux.h
|
||||
@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see
|
||||
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
|
||||
%{static:-static}}"
|
||||
|
||||
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
||||
@@ -56,8 +56,6 @@ index f8c2c351e5a..8d9881eadeb 100644
|
||||
- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
|
||||
- "/lib/ " \
|
||||
- "/usr/lib/ "
|
||||
-
|
||||
-#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi
|
||||
diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux
|
||||
index 216d2776a18..1a8a863853e 100644
|
||||
--- a/gcc/config/riscv/t-linux
|
||||
@@ -71,6 +69,3 @@ index 216d2776a18..1a8a863853e 100644
|
||||
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
|
||||
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
|
||||
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+6
-9
@@ -1,7 +1,7 @@
|
||||
From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001
|
||||
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:05:41 +0000
|
||||
Subject: [PATCH 24/34] always build libgcc_eh.a
|
||||
Subject: [PATCH] always build libgcc_eh.a
|
||||
|
||||
highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
@@ -10,10 +10,10 @@ highly inspired by:
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
|
||||
index 6c4dc79ab71..023cede18a7 100644
|
||||
index 09b3ec8bc2e..c9ca58c64cc 100644
|
||||
--- a/libgcc/Makefile.in
|
||||
+++ b/libgcc/Makefile.in
|
||||
@@ -960,8 +960,9 @@ ifneq ($(LIBUNWIND),)
|
||||
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
|
||||
all: libunwind.a
|
||||
endif
|
||||
|
||||
@@ -24,7 +24,7 @@ index 6c4dc79ab71..023cede18a7 100644
|
||||
ifneq ($(LIBUNWIND),)
|
||||
all: libunwind$(SHLIB_EXT)
|
||||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
|
||||
@@ -1163,10 +1164,6 @@ install-libunwind:
|
||||
@@ -1160,10 +1161,6 @@ install-libunwind:
|
||||
install-shared:
|
||||
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
|
||||
|
||||
@@ -35,7 +35,7 @@ index 6c4dc79ab71..023cede18a7 100644
|
||||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
|
||||
@shlib_base_name@,libgcc_s,$(subst \
|
||||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
|
||||
@@ -1183,6 +1180,10 @@ ifeq ($(enable_gcov),yes)
|
||||
@@ -1180,6 +1177,10 @@ ifeq ($(enable_gcov),yes)
|
||||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
endif
|
||||
|
||||
@@ -46,6 +46,3 @@ index 6c4dc79ab71..023cede18a7 100644
|
||||
parts="$(INSTALL_PARTS)"; \
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,256 +0,0 @@
|
||||
From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001
|
||||
From: Drew DeVault <sir@cmpwn.com>
|
||||
Date: Wed, 9 Dec 2020 07:42:06 +0000
|
||||
Subject: [PATCH 27/34] configure: Add --enable-autolink-libatomic, use in
|
||||
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
|
||||
|
||||
This fixes issues with RISC-V.
|
||||
---
|
||||
Makefile.in | 1 +
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/config/gnu-user.h | 12 +++++++++++-
|
||||
gcc/configure | 31 ++++++++++++++++++++++++++++++-
|
||||
gcc/configure.ac | 21 +++++++++++++++++++++
|
||||
gcc/doc/install.texi | 8 ++++++++
|
||||
gcc/doc/tm.texi | 8 +++++++-
|
||||
gcc/doc/tm.texi.in | 8 +++++++-
|
||||
gcc/gcc.cc | 12 +++++++++++-
|
||||
9 files changed, 102 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 6ff2b3f9925..394b105b271 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
|
||||
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
|
||||
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
|
||||
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
|
||||
+ TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \
|
||||
HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
|
||||
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
|
||||
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
|
||||
diff --git a/gcc/config.in b/gcc/config.in
|
||||
index 0679fbbf4c6..ee81139b385 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -118,6 +118,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define if libatomic should always be linked. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_AUTOLINK_LIBATOMIC
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define to 1 to specify that we are using the BID decimal floating point
|
||||
format instead of DPD */
|
||||
#ifndef USED_FOR_TARGET
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index b26b17f2f2a..3f64ea46180 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
|
||||
#endif
|
||||
|
||||
+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC)
|
||||
+# ifdef LD_AS_NEEDED_OPTION
|
||||
+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION
|
||||
+# else
|
||||
+# define LINK_LIBATOMIC_SPEC "-latomic"
|
||||
+# endif
|
||||
+#elif !defined(LINK_LIBATOMIC_SPEC)
|
||||
+# define LINK_LIBATOMIC_SPEC ""
|
||||
+#endif
|
||||
+
|
||||
#define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \
|
||||
- "%{static|static-pie:--start-group} %G %{!nolibc:%L} \
|
||||
+ "%{static|static-pie:--start-group} %G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L} \
|
||||
%{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
|
||||
|
||||
#undef LINK_GCC_C_SEQUENCE_SPEC
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index e59cbee1767..787c35d4e25 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -984,6 +984,7 @@ with_changes_root_url
|
||||
enable_languages
|
||||
with_multilib_list
|
||||
with_multilib_generator
|
||||
+enable_autolink_libatomic
|
||||
with_zstd
|
||||
with_zstd_include
|
||||
with_zstd_lib
|
||||
@@ -1713,6 +1714,9 @@ Optional Features:
|
||||
--disable-shared don't provide a shared libgcc
|
||||
--disable-gcov don't provide libgcov and related host tools
|
||||
--enable-languages=LIST specify which front-ends to build
|
||||
+ --enable-autolink-libatomic
|
||||
+ enable automatic linking of libatomic (ignored if
|
||||
+ not built)
|
||||
--disable-rpath do not hardcode runtime library paths
|
||||
--enable-sjlj-exceptions
|
||||
arrange to use setjmp/longjmp exception handling
|
||||
@@ -8329,7 +8333,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
-
|
||||
# Check whether --with-multilib-generator was given.
|
||||
if test "${with_multilib_generator+set}" = set; then :
|
||||
withval=$with_multilib_generator; :
|
||||
@@ -8337,6 +8340,32 @@ else
|
||||
with_multilib_generator=default
|
||||
fi
|
||||
|
||||
+# If libatomic is available, whether it should be linked automatically
|
||||
+# Check whether --enable-autolink-libatomic was given.
|
||||
+if test "${enable_autolink_libatomic+set}" = set; then :
|
||||
+ enableval=$enable_autolink_libatomic;
|
||||
+ case $enable_autolink_libatomic in
|
||||
+ yes | no) ;;
|
||||
+ *) as_fn_error $? "'$enable_autolink_libatomic' is an invalid value for
|
||||
+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'." "$LINENO" 5 ;;
|
||||
+ esac
|
||||
+
|
||||
+else
|
||||
+ enable_autolink_libatomic=''
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+if test x$enable_autolink_libatomic = xyes; then
|
||||
+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_AUTOLINK_LIBATOMIC 1" >>confdefs.h
|
||||
+
|
||||
+ else
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&5
|
||||
+$as_echo "$as_me: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&2;}
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
|
||||
# -------------------------
|
||||
# Checks for other programs
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 57268319de1..56bcaa87620 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
|
||||
:,
|
||||
with_multilib_generator=default)
|
||||
|
||||
+# If libatomic is available, whether it should be linked automatically
|
||||
+AC_ARG_ENABLE(autolink-libatomic,
|
||||
+[AS_HELP_STRING([--enable-autolink-libatomic],
|
||||
+ [enable automatic linking of libatomic (ignored if not built)])],
|
||||
+[
|
||||
+ case $enable_autolink_libatomic in
|
||||
+ yes | no) ;;
|
||||
+ *) AC_MSG_ERROR(['$enable_autolink_libatomic' is an invalid value for
|
||||
+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'.]) ;;
|
||||
+ esac
|
||||
+], [enable_autolink_libatomic=''])
|
||||
+
|
||||
+if test x$enable_autolink_libatomic = xyes; then
|
||||
+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then
|
||||
+ AC_DEFINE(ENABLE_AUTOLINK_LIBATOMIC, 1,
|
||||
+ [Define if libatomic should always be linked.])
|
||||
+ else
|
||||
+ AC_MSG_WARN([libatomic is not build for this target, --enable-autolink-libatomic ignored])
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
# -------------------------
|
||||
# Checks for other programs
|
||||
# -------------------------
|
||||
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
|
||||
index b30d3691fe6..ccc8e5dbb00 100644
|
||||
--- a/gcc/doc/install.texi
|
||||
+++ b/gcc/doc/install.texi
|
||||
@@ -2377,6 +2377,14 @@ files, but these changed header paths may conflict with some compilation
|
||||
environments. Enabled by default, and may be disabled using
|
||||
@option{--disable-canonical-system-headers}.
|
||||
|
||||
+@item --enable-autolink-libatomic
|
||||
+@itemx --disable-autolink-libatomic
|
||||
+Tell GCC that it should automatically link libatomic; if supported by
|
||||
+the linker, the file is only linked as needed. This flag is ignored
|
||||
+when libatomic is not built. Note that this conigure flag is in particular
|
||||
+useful when building an offloading-target compiler; as for those, a
|
||||
+user had to specify @code{-foffload=target=-latomic} otherwise.
|
||||
+
|
||||
@item --with-glibc-version=@var{major}.@var{minor}
|
||||
Tell GCC that when the GNU C Library (glibc) is used on the target it
|
||||
will be version @var{major}.@var{minor} or later. Normally this can
|
||||
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
|
||||
index a660e33739b..6183c407a2b 100644
|
||||
--- a/gcc/doc/tm.texi
|
||||
+++ b/gcc/doc/tm.texi
|
||||
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
|
||||
|
||||
@defmac LINK_GCC_C_SEQUENCE_SPEC
|
||||
The sequence in which libgcc and libc are specified to the linker.
|
||||
-By default this is @code{%G %L %G}.
|
||||
+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}.
|
||||
+@end defmac
|
||||
+
|
||||
+@defmac LINK_LIBATOMIC_SPEC
|
||||
+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link
|
||||
+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC}
|
||||
+is set.
|
||||
@end defmac
|
||||
|
||||
@defmac POST_LINK_SPEC
|
||||
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
|
||||
index f7ab5d48a63..281540aba68 100644
|
||||
--- a/gcc/doc/tm.texi.in
|
||||
+++ b/gcc/doc/tm.texi.in
|
||||
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
|
||||
|
||||
@defmac LINK_GCC_C_SEQUENCE_SPEC
|
||||
The sequence in which libgcc and libc are specified to the linker.
|
||||
-By default this is @code{%G %L %G}.
|
||||
+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}.
|
||||
+@end defmac
|
||||
+
|
||||
+@defmac LINK_LIBATOMIC_SPEC
|
||||
+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link
|
||||
+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC}
|
||||
+is set.
|
||||
@end defmac
|
||||
|
||||
@defmac POST_LINK_SPEC
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 59390fd39d6..dae1dd4cf79 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -974,13 +974,23 @@ proper position among the other output files. */
|
||||
# define ASM_DEBUG_OPTION_SPEC ""
|
||||
#endif
|
||||
|
||||
+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC)
|
||||
+# ifdef LD_AS_NEEDED_OPTION
|
||||
+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION
|
||||
+# else
|
||||
+# define LINK_LIBATOMIC_SPEC "-latomic"
|
||||
+# endif
|
||||
+#elif !defined(LINK_LIBATOMIC_SPEC)
|
||||
+# define LINK_LIBATOMIC_SPEC ""
|
||||
+#endif
|
||||
+
|
||||
/* Here is the spec for running the linker, after compiling all files. */
|
||||
|
||||
/* This is overridable by the target in case they need to specify the
|
||||
-lgcc and -lc order specially, yet not require them to override all
|
||||
of LINK_COMMAND_SPEC. */
|
||||
#ifndef LINK_GCC_C_SEQUENCE_SPEC
|
||||
-#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
|
||||
+#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L %G}"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEFAULT_SSP
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+4
-7
@@ -1,7 +1,7 @@
|
||||
From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001
|
||||
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:06:30 +0000
|
||||
Subject: [PATCH 25/34] ada: libgnarl compatibility for musl
|
||||
Subject: [PATCH] ada: libgnarl compatibility for musl
|
||||
|
||||
---
|
||||
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 25/34] ada: libgnarl compatibility for musl
|
||||
2 files changed, 3 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
index a5e645d334d..32165347071 100644
|
||||
index 7c9e7ca4518..caafc4aa68f 100644
|
||||
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
|
||||
@@ -403,12 +403,6 @@ package System.OS_Interface is
|
||||
@@ -38,7 +38,7 @@ index a5e645d334d..32165347071 100644
|
||||
sched_priority : int; -- scheduling priority
|
||||
end record;
|
||||
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
index 821ceef30e4..ae95b58e01e 100644
|
||||
index 4ff784f0ea7..b34a12802c6 100644
|
||||
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
|
||||
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
|
||||
@@ -130,6 +130,3 @@ index 821ceef30e4..ae95b58e01e 100644
|
||||
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
|
||||
|
||||
pragma Assert (Result in 0 | ENOMEM);
|
||||
--
|
||||
2.41.0
|
||||
|
||||
Loaded 100 of 1733 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user