Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7595cdbcb1 | ||
|
|
db18bf5de3 | ||
|
|
f71ef9f787 | ||
|
|
a7d92d9f8b | ||
|
|
468cbbe102 | ||
|
|
416b90dc61 | ||
|
|
590d339717 | ||
|
|
4b84be3d62 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
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
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Description: verify CODEOWNERS file is sane
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
# TODO Future improvements:
|
||||
# * Check that all devices in main/community have someone in CODEOWNERS
|
||||
# * Check that GitLab user actually exists (e.g. deleted account, account with
|
||||
# changed user name)
|
||||
|
||||
if grep -q " " CODEOWNERS; then
|
||||
echo
|
||||
echo "ERROR: Found space indentation in CODEOWNERS."
|
||||
echo "ERROR: Please indent with tab characters."
|
||||
grep " " CODEOWNERS
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail=0
|
||||
tmppipe=$(mktemp -u)
|
||||
mkfifo "$tmppipe"
|
||||
grep -v "^#" CODEOWNERS | cut -d' ' -f1 > "$tmppipe" &
|
||||
while IFS= read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
|
||||
# Check if entry generally exists
|
||||
# shellcheck disable=SC2086
|
||||
ls $line >/dev/null 2>&1 || { fail=1; echo "Non-existing: $line"; }
|
||||
|
||||
# Check that directories end with a slash
|
||||
# shellcheck disable=SC2086
|
||||
if test -d "$(ls -d $line)"; then
|
||||
echo "$line" | grep -q '/$' || { fail=1; echo "Missing trailing slash: $line"; }
|
||||
fi
|
||||
done < "$tmppipe"
|
||||
rm "$tmppipe"
|
||||
|
||||
if [ "$fail" = 1 ]; then
|
||||
echo
|
||||
echo "ERROR: Invalid CODEOWNERS entries, see above."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
+1
-1
@@ -11,7 +11,7 @@ if [ "$(id -u)" = 0 ]; then
|
||||
# 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.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
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"
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/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')
|
||||
+5
-41
@@ -2,8 +2,6 @@
|
||||
# Description: check various bad patterns with grep
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
exit_code=0
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add grep
|
||||
@@ -14,7 +12,7 @@ fi
|
||||
if grep -qr '(CHANGEME!)' -- *; then
|
||||
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
||||
grep --color=always -r '(CHANGEME!)' -- *
|
||||
exit_code=1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# DTBs installed to /usr/share/db
|
||||
@@ -25,7 +23,7 @@ if grep -qr 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/; then
|
||||
echo 'ERROR: Files that need fixing:'
|
||||
# shellcheck disable=SC2016
|
||||
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
|
||||
exit_code=1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -33,51 +31,17 @@ fi
|
||||
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_code=1
|
||||
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_code=1
|
||||
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_code=1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Removed deviceinfo variable
|
||||
if grep -qr 'deviceinfo_modules_initfs' -- *; then
|
||||
echo 'ERROR: deviceinfo_modules_initfs variable has been removed. Use "modules-initfs" file instead.'
|
||||
grep --color=always -r 'deviceinfo_modules_initfs' -- *
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
POSTMARKETOS_WALLPAPER_PATH='/usr/share/wallpapers/postmarketos.jpg'
|
||||
# The excluded devices are "grandfathered in". New devices should not be added here.
|
||||
# See https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2529
|
||||
if grep -qr $POSTMARKETOS_WALLPAPER_PATH \
|
||||
--exclude-dir='device-pine64-pinetab' \
|
||||
--exclude-dir='device-oneplus-kebab' \
|
||||
--exclude-dir='device-xiaomi-willow' \
|
||||
-- device; then
|
||||
echo "ERROR: Please don't include configuration files that set the default wallpaper in device-specific packages!"
|
||||
grep --color=always -r $POSTMARKETOS_WALLPAPER_PATH \
|
||||
--exclude-dir='device-pine64-pinetab' \
|
||||
--exclude-dir='device-oneplus-kebab' \
|
||||
--exclude-dir='device-xiaomi-willow' \
|
||||
-- device
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
OPENRC_SERVICE_FILES=$(find . -name '*.initd')
|
||||
# shellcheck disable=SC2086
|
||||
if grep -q 'before wpa_supplicant' $OPENRC_SERVICE_FILES; then
|
||||
echo "ERROR: Please use 'before wlan' in OpenRC service files! This ensures compatibility with both wpa_supplicant and iwd."
|
||||
grep --color=always 'before wpa_supplicant' $OPENRC_SERVICE_FILES
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
exit "$exit_code"
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
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
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
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
|
||||
|
||||
@@ -16,7 +16,8 @@ import pmb.parse
|
||||
import pmb.parse.version
|
||||
import pmb.helpers.logging
|
||||
|
||||
def get_package_contents(args, package, revision, check=True):
|
||||
|
||||
def get_package_version(args, package, revision, check=True):
|
||||
# Redirect stderr to /dev/null, so git doesn't complain about files not
|
||||
# existing in upstream branch for new packages
|
||||
stderr = None
|
||||
@@ -39,15 +40,6 @@ def get_package_contents(args, package, revision, check=True):
|
||||
handle.write(apkbuild_content)
|
||||
parsed = pmb.parse.apkbuild(tempdir + "/APKBUILD", False, False)
|
||||
|
||||
return parsed
|
||||
|
||||
|
||||
def get_package_version(args, package, revision, check=True):
|
||||
""" returns version in the format "{pkgver}-r{pkgrel}", or None if no
|
||||
matching package is found """
|
||||
parsed = get_package_contents(args, package, revision, check)
|
||||
if parsed is None:
|
||||
return None
|
||||
return parsed["pkgver"] + "-r" + parsed["pkgrel"]
|
||||
|
||||
|
||||
@@ -120,40 +112,6 @@ def check_versions(args, packages):
|
||||
print(f"- {package}: {head} (HEAD) (new package)")
|
||||
continue
|
||||
|
||||
# Check pkgver follows expected format for device packages
|
||||
pkgver = head.rpartition('-r')[0]
|
||||
if package.startswith('device-') and not pkgver.isdigit():
|
||||
print(f" - {package}: invalid pkgver \"{pkgver}\""
|
||||
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
|
||||
error = True
|
||||
|
||||
# Additional checks for device packages
|
||||
if package.startswith('device-'):
|
||||
head_parsed = get_package_contents(args, package, "HEAD", False)
|
||||
upstream_parsed = get_package_contents(args, package, commit, False)
|
||||
|
||||
# checksums did not change
|
||||
if head_parsed["sha512sums"] == upstream_parsed["sha512sums"]:
|
||||
# Check that pkgver did not change
|
||||
if head_parsed["pkgver"] != upstream_parsed["pkgver"]:
|
||||
print(f" - {package}: pkgver should not change when package source checksums did not change."
|
||||
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
|
||||
error = True
|
||||
# We do not check for a bumped pkgrel, because not everything
|
||||
# needs it, e.g: pmb_recommends
|
||||
# checksums changed
|
||||
else:
|
||||
# Check that pkgrel was reset to 0
|
||||
if head_parsed["pkgrel"] != "0":
|
||||
print(f" - {package}: pkgrel should be 0 when package source checksums change."
|
||||
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
|
||||
error = True
|
||||
# Check that pkgver was changed
|
||||
if head_parsed["pkgver"] == upstream_parsed["pkgver"]:
|
||||
print(f" - {package}: pkgver should change when package source checksums change."
|
||||
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
|
||||
error = True
|
||||
|
||||
# Compare head and upstream versions
|
||||
result = pmb.parse.version.compare(head, upstream)
|
||||
if result != 1:
|
||||
|
||||
@@ -106,7 +106,7 @@ def main():
|
||||
# Ask to adjust the wiki
|
||||
if error:
|
||||
print("*** Wiki check failed!")
|
||||
print("Thank you for porting postmarketOS to a new device! \\o/")
|
||||
print("Thank you for porting postmarketOS to a new device! \o/")
|
||||
print("")
|
||||
print("Now it's time to add some documentation:")
|
||||
print("1) Create a device specific wiki page as described here:")
|
||||
|
||||
+22
-28
@@ -36,7 +36,7 @@ def run_git(parameters, check=True, stderr=None):
|
||||
def add_upstream_git_remote():
|
||||
""" Add a remote pointing to postmarketOS/pmaports. """
|
||||
run_git(["remote", "add", "upstream",
|
||||
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False)
|
||||
"https://gitlab.com/postmarketOS/pmaports.git"], False)
|
||||
run_git(["fetch", "-q", "upstream"])
|
||||
|
||||
|
||||
@@ -59,11 +59,6 @@ def get_upstream_branch():
|
||||
channels.cfg from master to retrieve the upstream branch.
|
||||
|
||||
:returns: branch name, e.g. "v20.05" """
|
||||
|
||||
# Prefer gitlab CI target branch name if it's set (i.e. running in gitlab CI)
|
||||
if target_branch := os.environ.get("CI_MERGE_REQUEST_TARGET_BRANCH_NAME"):
|
||||
return target_branch
|
||||
|
||||
global cache
|
||||
if "upstream_branch" in cache:
|
||||
return cache["upstream_branch"]
|
||||
@@ -135,28 +130,27 @@ def get_changed_packages_sanity_check(count):
|
||||
return
|
||||
|
||||
branch = get_upstream_branch()
|
||||
print(f"""
|
||||
ERROR: Too many packages have changed!
|
||||
|
||||
This is a sanity check, so we don't end up building packages that
|
||||
have not been modified. CI won't run for more than three hours
|
||||
anyway.
|
||||
|
||||
Your options:
|
||||
a) If you *did not* modify everything listed above, then rebase
|
||||
your branch on the official postmarketOS/pmaports.git {branch}
|
||||
branch. Feel free to ask in the chat for help if you need any.
|
||||
b) If you *did* modify all these packages, and you assume that
|
||||
they will build within one hour: skip this sanity check by
|
||||
adding '[ci:ignore-count]' to the commit message of the last
|
||||
commit in the merge request (then force push).
|
||||
c) If you *did* modify all these packages, and you are sure that
|
||||
they won't build in time, please add '[ci:skip-build]' to the
|
||||
commit message (then force push). Make sure that all packages
|
||||
build with 'pmbootstrap build --strict'!
|
||||
|
||||
Thank you and sorry for the inconvenience.
|
||||
""")
|
||||
print()
|
||||
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("anyway.")
|
||||
print()
|
||||
print("Your options:")
|
||||
print("a) If you *did not* modify everything listed above, then rebase")
|
||||
print(f" your branch on the official postmarketOS/pmaports.git {branch}")
|
||||
print(" branch. Feel free to ask in the chat for help if you need any.")
|
||||
print("b) If you *did* modify all these packages, and you assume that")
|
||||
print(" they will build within one hour: skip this sanity check by")
|
||||
print(" adding '[ci:ignore-count]' to the commit message (then force")
|
||||
print(" push).")
|
||||
print("c) If you *did* modify all these packages, and you are sure that")
|
||||
print(" they won't build in time, please add '[ci:skip-build]' to the")
|
||||
print(" commit message (then force push). Make sure that all packages")
|
||||
print(" build with 'pmbootstrap build --strict'!")
|
||||
print()
|
||||
print("Thank you and sorry for the inconvenience.")
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
||||
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
|
||||
|
||||
-14
@@ -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 ruff
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
ruff check --ignore E501,F401,E722,W605 $(find .ci -name '*.py')
|
||||
+5
-3
@@ -15,14 +15,16 @@ fi
|
||||
# Shell: shellcheck
|
||||
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-tethering.sh
|
||||
./main/postmarketos-base-ui/rootfs-etc-NetworkManager-dispatcher.d-99-dns-filter.sh
|
||||
./main/postmarketos-base-ui/rootfs-etc-NetworkManager-dispatcher.d-85-tethering
|
||||
./main/postmarketos-installkernel/installkernel-pmos
|
||||
./main/postmarketos-initramfs/init.sh
|
||||
./main/postmarketos-initramfs/init_functions.sh
|
||||
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
|
||||
./main/postmarketos-mkinitfs-hook-debug-shell/setup_usb_storage.sh
|
||||
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
|
||||
./main/postmarketos-update-kernel/update-kernel.sh
|
||||
./main/ttyescape/*.post-install
|
||||
./main/unl0kr/unlock.sh
|
||||
./main/msm-firmware-loader/*.post-install
|
||||
@@ -46,5 +48,5 @@ sh_files="
|
||||
for file in $sh_files; do
|
||||
echo "Test with shellcheck: $file"
|
||||
cd "$DIR/$(dirname "$file")"
|
||||
shellcheck -e SC1008 -e SC3043 -x "$(basename "$file")"
|
||||
shellcheck -e SC1008 -x "$(basename "$file")"
|
||||
done
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
import os
|
||||
import importlib
|
||||
import importlib.util
|
||||
from site import getsitepackages
|
||||
from distutils.sysconfig import get_python_lib
|
||||
|
||||
|
||||
def path_pmbootstrap():
|
||||
@@ -24,17 +24,16 @@ def path_pmbootstrap():
|
||||
sys.exit(1)
|
||||
|
||||
# Resolve the symlink and verify the folder
|
||||
directory = os.path.dirname(os.path.realpath(bin))
|
||||
if os.path.exists(directory + "/pmb/__init__.py"):
|
||||
return directory
|
||||
dir = os.path.dirname(os.path.realpath(bin))
|
||||
if os.path.exists(dir + "/pmb/__init__.py"):
|
||||
return dir
|
||||
|
||||
directories = getsitepackages()
|
||||
for directory in directories:
|
||||
if os.path.exists(directory + "/pmb/__init__.py"):
|
||||
return directory
|
||||
dir = get_python_lib()
|
||||
if os.path.exists(dir + "/pmb/__init__.py"):
|
||||
return dir
|
||||
|
||||
# Symlink not set up properly
|
||||
print("ERROR: unable to find path to pmbootstrap.py. Try setting 'PMBOOTSTRAP_CMD'.")
|
||||
print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2024 Oliver Smith
|
||||
# Copyright 2021 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import fnmatch
|
||||
import glob
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
|
||||
# Cache for codeowners_parse
|
||||
codeowners_parsed = {}
|
||||
|
||||
# Don't complain if these nicknames are the only maintainers of an APKBUILD,
|
||||
# because they are actually a group of people
|
||||
gitlab_groups = [
|
||||
"@sdm845-mainline",
|
||||
]
|
||||
|
||||
|
||||
def device_dependency_check(apkbuild, path):
|
||||
""" Raise an error if a device package has a dependency that is not allowed
|
||||
(e.g. because it should be in a subpackage instead). """
|
||||
|
||||
for depend in apkbuild["depends"]:
|
||||
if depend == "linux-firmware-none":
|
||||
continue
|
||||
if (depend.startswith("firmware-") or
|
||||
depend.startswith("linux-firmware")):
|
||||
raise RuntimeError("Firmware package '" + depend + "' found in"
|
||||
" depends of " + path + ". These go into"
|
||||
" subpackages now, see"
|
||||
" <https://postmarketos.org/devicepkg>.")
|
||||
if depend == "mesa-dri-gallium":
|
||||
raise RuntimeError(f"{path}: mesa-dri-gallium shouldn't be in"
|
||||
" depends anymore (see pmaports!3478)")
|
||||
@@ -48,7 +46,7 @@ def test_aports_device(args):
|
||||
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
|
||||
path)
|
||||
|
||||
# Depends: Must not have specific packages
|
||||
# Depends: Must not have firmware packages
|
||||
for depend in apkbuild["depends"]:
|
||||
device_dependency_check(apkbuild, path)
|
||||
|
||||
@@ -61,6 +59,14 @@ def test_aports_device(args):
|
||||
if "!archcheck" not in apkbuild["options"]:
|
||||
raise RuntimeError("!archcheck missing in options= line: " + path)
|
||||
|
||||
if deviceinfo["flash_kernel_on_update"] == "true" \
|
||||
and "postmarketos-update-kernel" not in apkbuild["depends"]:
|
||||
raise RuntimeError(
|
||||
"Deviceinfo indicates this device supports automatic kernel"
|
||||
" flashing on update, but doesn't depend on"
|
||||
" 'postmarketos-update-kernel'. Please add the missing"
|
||||
" dependency.")
|
||||
|
||||
|
||||
def test_aports_device_kernel(args):
|
||||
"""
|
||||
@@ -102,84 +108,23 @@ def test_aports_device_kernel(args):
|
||||
path)
|
||||
|
||||
|
||||
def codeowners_parse(args):
|
||||
global codeowners_parsed
|
||||
|
||||
pattern_prev = None
|
||||
|
||||
with open(f"{args.aports}/CODEOWNERS") as h:
|
||||
for line in h:
|
||||
line = line.rstrip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
|
||||
pattern_nicks = line.split()
|
||||
assert len(pattern_nicks) > 1, f"CODEOWNERS line without nicks: {line}"
|
||||
|
||||
pattern = pattern_nicks[0]
|
||||
if pattern.endswith("/"):
|
||||
pattern += "*"
|
||||
|
||||
nicks = []
|
||||
for word in pattern_nicks[1:]:
|
||||
if word.startswith("@"):
|
||||
nicks += [word]
|
||||
codeowners_parsed[pattern] = nicks
|
||||
|
||||
if pattern_prev:
|
||||
assert pattern_prev <= pattern, "CODEOWNERS: please order entries alphabetically"
|
||||
pattern_prev = pattern
|
||||
|
||||
|
||||
def require_enough_codeowners_entries(args, path, maintainers):
|
||||
"""
|
||||
:param path: full path to an APKBUILD (e.g. /home/user/…/APKBUILD)
|
||||
:param maintainers: list of one or more maintainers
|
||||
"""
|
||||
path = os.path.relpath(path, args.aports)
|
||||
|
||||
nicks = set()
|
||||
for pattern, pattern_nicks in codeowners_parsed.items():
|
||||
if fnmatch.fnmatch(path, pattern):
|
||||
for nick in pattern_nicks:
|
||||
nicks.add(nick)
|
||||
|
||||
print(f"{path}:")
|
||||
print(f" APKBUILD: {maintainers}")
|
||||
print(f" CODEOWNERS: {nicks}")
|
||||
|
||||
if len(nicks) < len(maintainers):
|
||||
for nick in nicks:
|
||||
if nick in gitlab_groups:
|
||||
print(f" -> {nick} is a group")
|
||||
return
|
||||
|
||||
assert len(nicks) >= len(maintainers), \
|
||||
f"{path}: make sure that each maintainer is listed in CODEOWNERS!"
|
||||
|
||||
|
||||
def test_aports_maintained(args):
|
||||
"""
|
||||
Ensure that aports in /device/{main,community} have "Maintainer:" and
|
||||
"Co-Maintainer:" (only required for main) listed in their APKBUILDs. Also
|
||||
check that at least as many are listed in CODEOWNERS.
|
||||
"Co-Maintainer:" (only required for main) listed in their APKBUILDs.
|
||||
"""
|
||||
codeowners_parse(args)
|
||||
|
||||
for path in glob.iglob(f"{args.aports}/device/main/*/APKBUILD"):
|
||||
if '/firmware-' in path:
|
||||
continue
|
||||
maintainers = pmb.parse._apkbuild.maintainers(path)
|
||||
assert maintainers and len(maintainers) >= 2, \
|
||||
f"{path} in main needs at least 1 Maintainer and 1 Co-Maintainer"
|
||||
require_enough_codeowners_entries(args, path, maintainers)
|
||||
|
||||
for path in glob.iglob(f"{args.aports}/device/community/*/APKBUILD"):
|
||||
if '/firmware-' in path:
|
||||
continue
|
||||
maintainers = pmb.parse._apkbuild.maintainers(path)
|
||||
assert maintainers, f"{path} in community needs at least 1 Maintainer"
|
||||
require_enough_codeowners_entries(args, path, maintainers)
|
||||
|
||||
|
||||
def test_aports_unmaintained(args):
|
||||
|
||||
@@ -6,10 +6,10 @@ import stat
|
||||
|
||||
expected_directories = [
|
||||
"cross",
|
||||
"device/archived",
|
||||
"device/community",
|
||||
"device/main",
|
||||
"device/testing",
|
||||
"device/unmaintained",
|
||||
"main",
|
||||
"modem",
|
||||
"non-free",
|
||||
@@ -28,9 +28,9 @@ def test_directories():
|
||||
|
||||
|
||||
# Ensure no file in pmaports are executable.
|
||||
# see https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/593.
|
||||
# see https://gitlab.com/postmarketOS/pmaports/-/issues/593.
|
||||
def test_executable_files():
|
||||
for file in glob.iglob("[!temp]**/**/*", recursive=True):
|
||||
for file in glob.iglob("**/*", recursive=True):
|
||||
if os.path.isdir(file) or os.path.islink(file):
|
||||
continue
|
||||
# still check other less common inode types
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"SpacesAftertabs": true,
|
||||
"Exclude": ["temp"]
|
||||
"SpacesAftertabs": true
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
# Top-most EditorConfig file.
|
||||
root = true
|
||||
|
||||
[{**.{md,ini,sh,rules,nft},**/APKBUILD,CODEOWNERS}]
|
||||
[{**.{md,ini,sh,rules,nft},**/APKBUILD}]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
+61
-49
@@ -2,70 +2,69 @@
|
||||
|
||||
# global settings
|
||||
image: alpine:latest
|
||||
before_script: &global_before_scripts
|
||||
- apk upgrade -U
|
||||
after_script:
|
||||
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
|
||||
stages:
|
||||
- lint
|
||||
- build
|
||||
variables:
|
||||
PMBOOTSTRAP_TAG: 2.3.x
|
||||
|
||||
# This defines the rules for when a pipeline should run.
|
||||
workflow:
|
||||
rules:
|
||||
# Don't run branch pipeline if an MR is open (only the MR pipeline will run)
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
|
||||
when: never
|
||||
# Run for merge requests
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
# Run scheduled pipeline for autoupdate
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
# defaults for "only"
|
||||
# We need to run the CI jobs in a "merge request specific context", if CI is
|
||||
# running in a merge request. Otherwise the environment variable that holds the
|
||||
# merge request ID is not available. This means, we must set the "only"
|
||||
# variable accordingly - and if we only do it for one job, all other jobs will
|
||||
# not get executed. So have the defaults here, and use them in all jobs that
|
||||
# should run on both the master branch, and in merge requests.
|
||||
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
|
||||
.only-default: &only-default
|
||||
only:
|
||||
- master
|
||||
- merge_requests
|
||||
- tags
|
||||
|
||||
# device documentation
|
||||
wiki:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
changes:
|
||||
- .ci/**/*
|
||||
- .gitlab-ci.yml
|
||||
- device/*/device-*/*
|
||||
<<: *only-default
|
||||
only:
|
||||
refs:
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/device-*/*
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/wiki.sh
|
||||
|
||||
# testcases linting
|
||||
ruff:
|
||||
flake8:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
changes:
|
||||
- .ci/*
|
||||
- .ci/*/*
|
||||
- .gitlab-ci.yml
|
||||
<<: *only-default
|
||||
only:
|
||||
refs:
|
||||
- merge_requests
|
||||
changes:
|
||||
- .ci/*
|
||||
- .ci/*/*
|
||||
before_script:
|
||||
- apk -q add py-flake8
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/ruff.sh
|
||||
- .ci/flake8.sh
|
||||
|
||||
# shellcheck and various grep checks
|
||||
shellcheck-grep:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
image: alpine:edge
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/shellcheck.sh
|
||||
- .ci/grep.sh
|
||||
- .ci/codeowners.sh
|
||||
|
||||
editor-config:
|
||||
stage: lint
|
||||
<<: *only-default
|
||||
image: alpine:edge
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/ec.sh
|
||||
@@ -73,8 +72,7 @@ editor-config:
|
||||
# aports checks (generic)
|
||||
pytest-commits:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
<<: *only-default
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/pytest.sh
|
||||
@@ -90,21 +88,23 @@ pytest-commits:
|
||||
# APKBUILD linting
|
||||
aport-lint:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/apkbuild-lint.sh
|
||||
only:
|
||||
- merge_requests
|
||||
allow_failure: true
|
||||
|
||||
# kernel kconfig check
|
||||
kernel-kconfig:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
- main/linux-*/config-*
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
- merge_requests
|
||||
changes:
|
||||
- device/*/linux-*/config-*
|
||||
- main/linux-*/config-*
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/kconfig.sh
|
||||
@@ -113,22 +113,19 @@ kernel-kconfig:
|
||||
# (Checks for "Allow commits from members who can merge to the target branch")
|
||||
mr-settings:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
only:
|
||||
- merge_requests
|
||||
before_script:
|
||||
- *global_before_scripts
|
||||
- apk -q add python3
|
||||
script:
|
||||
- wget -q "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
|
||||
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
|
||||
- python3 ./check_mr_settings.py
|
||||
|
||||
# build changed aports
|
||||
.build:
|
||||
stage: build
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
|
||||
<<: *only-default
|
||||
before_script:
|
||||
- *global_before_scripts
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
after_script:
|
||||
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
|
||||
@@ -143,6 +140,11 @@ build-x86_64:
|
||||
script:
|
||||
- .ci/build-x86_64.sh
|
||||
|
||||
build-x86:
|
||||
extends: .build
|
||||
script:
|
||||
- .ci/build-x86.sh
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
script:
|
||||
@@ -152,3 +154,13 @@ 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,12 +1,6 @@
|
||||
<!--
|
||||
Thank you for using postmarketOS! In order to speed up process of resolving your issue,
|
||||
we would like you to fill in the following form.
|
||||
|
||||
*** NOTE FOR CONFIDENTIAL ISSUES: ***
|
||||
A lot of people can read confidential pmaports issues! If you want to
|
||||
submit something that only the postmarketOS Core Team can see, write to
|
||||
team@postmarketos.org
|
||||
instead of opening an issue here!
|
||||
we would like you to fill in the following :
|
||||
-->
|
||||
### Describe your issue
|
||||
#### What's the expected behaviour?
|
||||
@@ -27,7 +21,8 @@
|
||||
Replace space inside `[ ]` with `x` to fill the checkbox
|
||||
-->
|
||||
* [ ] edge (`master` branch)
|
||||
* [ ] `v23.12`
|
||||
* [ ] `v23.06`
|
||||
* [ ] `v22.12` (Supported until 2023-07-06)
|
||||
|
||||
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
|
||||
|
||||
|
||||
+78
-113
@@ -1,123 +1,88 @@
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html
|
||||
# Put groups like @sdm845-mainline into test_device.py:gitlab_groups.
|
||||
# Order lines alphabetically!
|
||||
|
||||
device/*/*-amlogic-s905*/ @funderscore
|
||||
device/*/*-arrow-db410c/ @Minecrell
|
||||
device/*/*-asus-me176c/ @Minecrell
|
||||
device/*/*-ayn-odin/ @jenneron
|
||||
device/*/*-bq-paella/ @Minecrell
|
||||
device/*/*-bq-tenshi/ @fossdd
|
||||
device/*/*-google-gru/ @jenneron
|
||||
device/*/*-google-kukui/ @jenneron @binarycraft
|
||||
device/*/*-google-oak/ @jenneron @adamthiede
|
||||
device/*/*-google-trogdor/ @jenneron
|
||||
device/*/*-google-veyron/ @jenneron
|
||||
device/*/*-google-x64cros/ @jenneron @JustSoup321 @alpernebbi
|
||||
device/*/*-htc-golfu/ @Newbyte
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
|
||||
device/*/*-htc-m8qlul/ @Newbyte
|
||||
device/*/*-kobo-clara/ @akemnade
|
||||
device/*/*-lenovo-21bx/ @craftyguy @jane400
|
||||
device/*/*-lenovo-a6000/ @jenneron @Minecrell
|
||||
device/*/*-lenovo-a6010/ @jenneron @Minecrell
|
||||
device/*/*-librecomputer-lafrite/ @funderscore
|
||||
device/*/*-librecomputer-lepotato/ @funderscore
|
||||
device/*/*-librecomputer-solitude/ @Newbyte @funderscore
|
||||
device/*/*-motorola-harpia/ @Minecrell
|
||||
device/*/*-nokia-n900/ @sicelo @Danct12
|
||||
device/*/*-pine64-pinebookpro/ @QC8086
|
||||
device/*/*-pine64-pinephone/ @craftyguy @milesalan @proycon @anjandev @StacyHarper @Arnavion @PsychoGame
|
||||
device/*/*-pine64-pinephonepro/ @PsychoGame
|
||||
device/*/*-pine64-rockpro64/ @PureTryOut
|
||||
device/*/*-purism-librem5/ @craftyguy @alistair23 @Newbyte
|
||||
device/*/*-qcom-msm8916/ @Minecrell @TravMurav
|
||||
device/*/*-qcom-sdm845/ @sdm845-mainline
|
||||
device/*/*-qcom-sm6350/ @z3ntu
|
||||
device/*/*-samsung-a3/ @Mis012 @TravMurav @Minecrell
|
||||
device/*/*-samsung-a5/ @Minecrell @minlexx
|
||||
device/*/*-samsung-e7/ @wonderfulShrineMaidenOfParadise
|
||||
device/*/*-samsung-espresso10/ @MightyM17
|
||||
device/*/*-samsung-espresso7/ @MightyM17 @antoni.aloytorrens
|
||||
device/*/*-samsung-grandmax/ @wonderfulShrineMaidenOfParadise
|
||||
device/*/*-samsung-gt510/ @TravMurav
|
||||
device/*/*-samsung-gt58/ @TravMurav
|
||||
device/*/*-samsung-j5/ @wonderfulShrineMaidenOfParadise
|
||||
device/*/*-samsung-j5x/ @wonderfulShrineMaidenOfParadise
|
||||
device/*/*-samsung-serranove/ @Minecrell
|
||||
device/*/*-tolino-shine2hd/ @akemnade
|
||||
device/*/*-videostrong-kii-pro/ @funderscore
|
||||
device/*/*-wileyfox-crackling/ @TravMurav @Minecrell
|
||||
device/*/*-xiaomi-beryllium/ @joelselvaraj
|
||||
device/*/*-xiaomi-daisy/ @joelselvaraj @alikates
|
||||
device/*/*-xiaomi-markw/ @vipaoL
|
||||
device/*/*-xiaomi-mido/ @barni2000
|
||||
device/*/*-xiaomi-scorpio/ @Tooniis
|
||||
device/*/*-xiaomi-tissot/ @jiaxyga @barni2000
|
||||
device/*/*-xiaomi-vince/ @M0Rf30
|
||||
device/*/*-xiaomi-wt88047/ @Minecrell
|
||||
device/*/*-xiaomi-ysl/ @barni2000
|
||||
device/*/alsa-ucm-conf-cros/ @WeirdTreeThing
|
||||
device/*/device-fairphone-*/ @z3ntu
|
||||
device/*/device-generic-x86_64/ @craftyguy @ollieparanoid
|
||||
device/*/device-google-nyan-big/ @jenneron
|
||||
device/*/device-google-nyan-blaze/ @jenneron
|
||||
device/*/device-google-peach-pi/ @jenneron
|
||||
device/*/device-google-peach-pit/ @jenneron
|
||||
device/*/device-google-snow/ @jenneron
|
||||
device/*/*-purism-librem5/ @craftyguy @bshah
|
||||
device/*/device-lg-judyln/ @Newbyte
|
||||
device/*/device-lg-judyp/ @jenneron
|
||||
device/*/device-microsoft-surface-rt/ @jenneron @jethrob
|
||||
device/*/device-nvidia-tegra-armv7/ @clamor-s @okias @mschwalm @nokun
|
||||
device/*/device-odroid-xu4/ @Grimler
|
||||
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/*/device-qemu-aarch64/ @Minecrell @ollieparanoid
|
||||
device/*/device-qemu-amd64/ @Minecrell @ollieparanoid
|
||||
device/*/device-qualcomm-sdm845/ @calebccff
|
||||
device/*/device-samsung-chagallwifi/ @Grimler
|
||||
device/*/device-samsung-coreprimevelte/ @legolivesmatter @balejk
|
||||
device/*/device-samsung-j5y17lte/ @andrisas
|
||||
device/*/device-samsung-klimtlte/ @Grimler
|
||||
device/*/device-samsung-lt01/ @knuxify
|
||||
device/*/device-samsung-m0/ @Newbyte
|
||||
device/*/device-samsung-manta/ @jenneron @alexmrqt
|
||||
device/*/device-shift-axolotl/ @amartinz @calebccff @dylanvanassche
|
||||
device/*/firmware-google-veyron-brcm/ @jenneron
|
||||
device/*/firmware-odroid-xu4/ @Grimler
|
||||
device/*/firmware-oneplus-sdm845/ @calebccff
|
||||
device/*/firmware-powervr-gx6250/ @jenneron
|
||||
device/*/kobo-epdc-extractor/ @akemnade
|
||||
device/*/linux-google-nyan/ @jenneron
|
||||
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/*/linux-postmarketos-allwinner/ @Arnavion @PsychoGame
|
||||
device/*/linux-postmarketos-amlogic/ @funderscore @exkc
|
||||
device/*/linux-postmarketos-exynos4/ @Newbyte @ThiagaoPlusPlus
|
||||
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/*/linux-postmarketos-grate/ @clamor-s @jenneron @jethrob
|
||||
device/*/linux-postmarketos-imx-ereader/ @akemnade
|
||||
device/*/linux-postmarketos-mediatek-mt8173/ @jenneron @adamthiede
|
||||
device/*/linux-postmarketos-mediatek-mt8183/ @jenneron @binarycraft
|
||||
device/*/linux-postmarketos-omap/ @MightyM17 @Sicelo
|
||||
device/*/linux-postmarketos-qcom-msm8953/ @M0Rf30 @Ultra-azu @barni2000
|
||||
device/*/linux-postmarketos-qcom-msm8996/ @Tooniis
|
||||
device/*/linux-postmarketos-qcom-sc7180/ @jenneron
|
||||
device/*/linux-postmarketos-rockchip/ @QC8086
|
||||
device/*/linux-postmarketos-stericsson/ @Newbyte
|
||||
device/*/linux-samsung-chagallwifi/ @Grimler
|
||||
device/*/linux-samsung-coreprimevelte/ @legolivesmatter @balejk
|
||||
device/*/linux-samsung-j5y17lte/ @andrisas
|
||||
device/*/linux-samsung-klimtlte/ @Grimler
|
||||
device/*/oem-amd/ @craftyguy
|
||||
device/*/oem-intel/ @craftyguy
|
||||
device/*/device-google-krane/ @jenneron
|
||||
device/*/soc-mediatek-mt8183/ @jenneron
|
||||
device/*/soc-qcom-msm8953/ @barni2000
|
||||
device/*/soc-qcom-msm8996/ @Tooniis
|
||||
device/*/soc-qcom-sc7180/ @jenneron
|
||||
device/*/soc-rockchip-rk3399/ @jenneron
|
||||
device/*/soc-samsung-exynos4412/ @Newbyte
|
||||
device/*/u-boot-librem5/ @craftyguy @alistair23 @Newbyte
|
||||
device/*/u-boot-pinebookpro/ @QC8086
|
||||
device/*/u-boot-pinephone/ @Arnavion @PsychoGame
|
||||
device/*/wl1251-cal/ @Danct12
|
||||
main/postmarketos-ui-plasma-mobile/ @PureTryOut
|
||||
main/shutdown-clear-rtc-wakealarm/ @Arnavion
|
||||
main/ttyescape/ @calebccff
|
||||
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
|
||||
|
||||
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
|
||||
@@ -0,0 +1,51 @@
|
||||
# Reference: https://postmarketos.org/channels.cfg
|
||||
[channels.cfg]
|
||||
recommended=edge
|
||||
|
||||
[edge]
|
||||
description=Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
|
||||
branch_pmaports=master
|
||||
branch_aports=master
|
||||
mirrordir_alpine=edge
|
||||
|
||||
[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 (supported until: 2023-07-07)
|
||||
branch_pmaports=v22.12
|
||||
branch_aports=3.17-stable
|
||||
mirrordir_alpine=v3.17
|
||||
|
||||
[v22.06]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v22.06
|
||||
branch_aports=3.16-stable
|
||||
mirrordir_alpine=v3.16
|
||||
|
||||
[v21.12]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v21.12
|
||||
branch_aports=3.15-stable
|
||||
mirrordir_alpine=v3.15
|
||||
|
||||
[v21.06]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v21.06
|
||||
branch_aports=3.14-stable
|
||||
mirrordir_alpine=v3.14
|
||||
|
||||
[v21.03]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v21.03
|
||||
branch_aports=3.13-stable
|
||||
mirrordir_alpine=v3.13
|
||||
|
||||
[v20.05]
|
||||
description=Old release (unsupported)
|
||||
branch_pmaports=v20.05
|
||||
branch_aports=3.12-stable
|
||||
mirrordir_alpine=v3.12
|
||||
+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,153 @@
|
||||
# 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.40
|
||||
pkgrel=12
|
||||
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 jansson-dev zstd-dev"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2023-1972.patch
|
||||
binutils-ld-fix-static-linking.patch
|
||||
riscv64-textrels.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ -z "$BOOTSTRAP" ]; then
|
||||
makedepends_host="$makedepends_host jansson-dev zstd-dev"
|
||||
_noboot_configure="--enable-jansson --with-zstd"
|
||||
fi
|
||||
|
||||
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.40-r10:
|
||||
# - CVE-2023-1972
|
||||
# 2.40-r0:
|
||||
# - CVE-2023-1579
|
||||
# 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
|
||||
|
||||
CFLAGS="$CFLAGS -O2" \
|
||||
CXXFLAGS="$CXXFLAGS -O2" \
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--sysconfdir=/etc \
|
||||
$_arch_configure \
|
||||
$_cross_configure \
|
||||
$_gold_configure \
|
||||
$_plugin_configure \
|
||||
$_noboot_configure \
|
||||
--disable-gprofng \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-colored-disassembly \
|
||||
--enable-default-execstack=no \
|
||||
--enable-default-hash-style=gnu \
|
||||
--enable-deterministic-archives \
|
||||
--enable-ld=default \
|
||||
--enable-new-dtags \
|
||||
--enable-relro \
|
||||
--enable-threads \
|
||||
--with-bugurl="https://postmarketos.org/issues" \
|
||||
--with-mmap \
|
||||
--with-pic \
|
||||
--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
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
amove usr/bin/ld.gold
|
||||
fi
|
||||
amove usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
|
||||
"
|
||||
@@ -0,0 +1,37 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
|
||||
--
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
|
||||
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
|
||||
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
|
||||
PR 30285
|
||||
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 027d0143735..185028cbd97 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return_verdef;
|
||||
}
|
||||
+
|
||||
+ if (amt == 0)
|
||||
+ goto error_return_verdef;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return_verdef;
|
||||
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return;
|
||||
}
|
||||
+ if (amt == 0)
|
||||
+ goto error_return;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return;
|
||||
@@ -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,103 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
|
||||
--
|
||||
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
|
||||
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
|
||||
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
|
||||
|
||||
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
|
||||
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
|
||||
|
||||
* For PR ld/25694,
|
||||
In the check_reloc, refer to spare and loongarch, they don't need to reserve
|
||||
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
|
||||
So it seems like riscv was too conservative to estimate the TLS LE before.
|
||||
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
|
||||
TEXTREL problem.
|
||||
|
||||
* For PR ld/22263,
|
||||
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
|
||||
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
|
||||
also the right way to do the same thing for risc-v.
|
||||
|
||||
On risc-v, fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
RISC-V haven't supported the TLS transitions, so will need the same fix (use
|
||||
bfd_link_dll) in the future.
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
PR ld/25694
|
||||
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
|
||||
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
|
||||
relocation for TLS LE in pie/pde, and report error in pic just like
|
||||
before.
|
||||
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
|
||||
than !bfd_link_pic in determining the dynamic symbol index. Avoid
|
||||
the index of -1.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
|
||||
index 75af040cf92..762ea231c0b 100644
|
||||
--- a/bfd/elfnn-riscv.c
|
||||
+++ b/bfd/elfnn-riscv.c
|
||||
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
break;
|
||||
|
||||
case R_RISCV_TLS_GOT_HI20:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|
||||
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
|
||||
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
goto static_reloc;
|
||||
|
||||
case R_RISCV_TPREL_HI20:
|
||||
+ /* This is not allowed in the pic, but okay in pie. */
|
||||
if (!bfd_link_executable (info))
|
||||
return bad_static_reloc (abfd, r_type, h);
|
||||
if (h != NULL)
|
||||
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
|
||||
- goto static_reloc;
|
||||
+ break;
|
||||
|
||||
case R_RISCV_HI20:
|
||||
if (bfd_link_pic (info))
|
||||
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
|
||||
if (htab->elf.srelgot == NULL)
|
||||
abort ();
|
||||
|
||||
- if (h != NULL)
|
||||
- {
|
||||
- bool dyn, pic;
|
||||
- dyn = htab->elf.dynamic_sections_created;
|
||||
- pic = bfd_link_pic (info);
|
||||
-
|
||||
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
|
||||
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
- indx = h->dynindx;
|
||||
- }
|
||||
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
|
||||
+ if (h != NULL
|
||||
+ && h->dynindx != -1
|
||||
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
|
||||
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
+ indx = h->dynindx;
|
||||
|
||||
/* The GOT entries have not been initialized yet. Do it
|
||||
now, and emit any relocations. */
|
||||
- if ((bfd_link_pic (info) || indx != 0)
|
||||
+ if ((bfd_link_dll (info) || indx != 0)
|
||||
&& (h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
- need_relocs = true;
|
||||
+ need_relocs = true;
|
||||
|
||||
if (tls_type & GOT_TLS_GD)
|
||||
{
|
||||
|
||||
@@ -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,153 @@
|
||||
# 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.40
|
||||
pkgrel=12
|
||||
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 jansson-dev zstd-dev"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2023-1972.patch
|
||||
binutils-ld-fix-static-linking.patch
|
||||
riscv64-textrels.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ -z "$BOOTSTRAP" ]; then
|
||||
makedepends_host="$makedepends_host jansson-dev zstd-dev"
|
||||
_noboot_configure="--enable-jansson --with-zstd"
|
||||
fi
|
||||
|
||||
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.40-r10:
|
||||
# - CVE-2023-1972
|
||||
# 2.40-r0:
|
||||
# - CVE-2023-1579
|
||||
# 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
|
||||
|
||||
CFLAGS="$CFLAGS -O2" \
|
||||
CXXFLAGS="$CXXFLAGS -O2" \
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--sysconfdir=/etc \
|
||||
$_arch_configure \
|
||||
$_cross_configure \
|
||||
$_gold_configure \
|
||||
$_plugin_configure \
|
||||
$_noboot_configure \
|
||||
--disable-gprofng \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-colored-disassembly \
|
||||
--enable-default-execstack=no \
|
||||
--enable-default-hash-style=gnu \
|
||||
--enable-deterministic-archives \
|
||||
--enable-ld=default \
|
||||
--enable-new-dtags \
|
||||
--enable-relro \
|
||||
--enable-threads \
|
||||
--with-bugurl="https://postmarketos.org/issues" \
|
||||
--with-mmap \
|
||||
--with-pic \
|
||||
--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
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
amove usr/bin/ld.gold
|
||||
fi
|
||||
amove usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
|
||||
"
|
||||
@@ -0,0 +1,37 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
|
||||
--
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
|
||||
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
|
||||
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
|
||||
PR 30285
|
||||
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 027d0143735..185028cbd97 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return_verdef;
|
||||
}
|
||||
+
|
||||
+ if (amt == 0)
|
||||
+ goto error_return_verdef;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return_verdef;
|
||||
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return;
|
||||
}
|
||||
+ if (amt == 0)
|
||||
+ goto error_return;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return;
|
||||
@@ -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,103 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
|
||||
--
|
||||
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
|
||||
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
|
||||
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
|
||||
|
||||
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
|
||||
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
|
||||
|
||||
* For PR ld/25694,
|
||||
In the check_reloc, refer to spare and loongarch, they don't need to reserve
|
||||
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
|
||||
So it seems like riscv was too conservative to estimate the TLS LE before.
|
||||
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
|
||||
TEXTREL problem.
|
||||
|
||||
* For PR ld/22263,
|
||||
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
|
||||
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
|
||||
also the right way to do the same thing for risc-v.
|
||||
|
||||
On risc-v, fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
RISC-V haven't supported the TLS transitions, so will need the same fix (use
|
||||
bfd_link_dll) in the future.
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
PR ld/25694
|
||||
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
|
||||
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
|
||||
relocation for TLS LE in pie/pde, and report error in pic just like
|
||||
before.
|
||||
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
|
||||
than !bfd_link_pic in determining the dynamic symbol index. Avoid
|
||||
the index of -1.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
|
||||
index 75af040cf92..762ea231c0b 100644
|
||||
--- a/bfd/elfnn-riscv.c
|
||||
+++ b/bfd/elfnn-riscv.c
|
||||
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
break;
|
||||
|
||||
case R_RISCV_TLS_GOT_HI20:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|
||||
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
|
||||
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
goto static_reloc;
|
||||
|
||||
case R_RISCV_TPREL_HI20:
|
||||
+ /* This is not allowed in the pic, but okay in pie. */
|
||||
if (!bfd_link_executable (info))
|
||||
return bad_static_reloc (abfd, r_type, h);
|
||||
if (h != NULL)
|
||||
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
|
||||
- goto static_reloc;
|
||||
+ break;
|
||||
|
||||
case R_RISCV_HI20:
|
||||
if (bfd_link_pic (info))
|
||||
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
|
||||
if (htab->elf.srelgot == NULL)
|
||||
abort ();
|
||||
|
||||
- if (h != NULL)
|
||||
- {
|
||||
- bool dyn, pic;
|
||||
- dyn = htab->elf.dynamic_sections_created;
|
||||
- pic = bfd_link_pic (info);
|
||||
-
|
||||
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
|
||||
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
- indx = h->dynindx;
|
||||
- }
|
||||
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
|
||||
+ if (h != NULL
|
||||
+ && h->dynindx != -1
|
||||
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
|
||||
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
+ indx = h->dynindx;
|
||||
|
||||
/* The GOT entries have not been initialized yet. Do it
|
||||
now, and emit any relocations. */
|
||||
- if ((bfd_link_pic (info) || indx != 0)
|
||||
+ if ((bfd_link_dll (info) || indx != 0)
|
||||
&& (h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
- need_relocs = true;
|
||||
+ need_relocs = true;
|
||||
|
||||
if (tls_type & GOT_TLS_GD)
|
||||
{
|
||||
|
||||
@@ -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,153 @@
|
||||
# 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.40
|
||||
pkgrel=12
|
||||
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 jansson-dev zstd-dev"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2023-1972.patch
|
||||
binutils-ld-fix-static-linking.patch
|
||||
riscv64-textrels.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ -z "$BOOTSTRAP" ]; then
|
||||
makedepends_host="$makedepends_host jansson-dev zstd-dev"
|
||||
_noboot_configure="--enable-jansson --with-zstd"
|
||||
fi
|
||||
|
||||
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.40-r10:
|
||||
# - CVE-2023-1972
|
||||
# 2.40-r0:
|
||||
# - CVE-2023-1579
|
||||
# 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
|
||||
|
||||
CFLAGS="$CFLAGS -O2" \
|
||||
CXXFLAGS="$CXXFLAGS -O2" \
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--sysconfdir=/etc \
|
||||
$_arch_configure \
|
||||
$_cross_configure \
|
||||
$_gold_configure \
|
||||
$_plugin_configure \
|
||||
$_noboot_configure \
|
||||
--disable-gprofng \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-colored-disassembly \
|
||||
--enable-default-execstack=no \
|
||||
--enable-default-hash-style=gnu \
|
||||
--enable-deterministic-archives \
|
||||
--enable-ld=default \
|
||||
--enable-new-dtags \
|
||||
--enable-relro \
|
||||
--enable-threads \
|
||||
--with-bugurl="https://postmarketos.org/issues" \
|
||||
--with-mmap \
|
||||
--with-pic \
|
||||
--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
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
amove usr/bin/ld.gold
|
||||
fi
|
||||
amove usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
|
||||
"
|
||||
@@ -0,0 +1,37 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
|
||||
--
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
|
||||
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
|
||||
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
|
||||
PR 30285
|
||||
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 027d0143735..185028cbd97 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return_verdef;
|
||||
}
|
||||
+
|
||||
+ if (amt == 0)
|
||||
+ goto error_return_verdef;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return_verdef;
|
||||
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return;
|
||||
}
|
||||
+ if (amt == 0)
|
||||
+ goto error_return;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return;
|
||||
@@ -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,103 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
|
||||
--
|
||||
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
|
||||
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
|
||||
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
|
||||
|
||||
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
|
||||
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
|
||||
|
||||
* For PR ld/25694,
|
||||
In the check_reloc, refer to spare and loongarch, they don't need to reserve
|
||||
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
|
||||
So it seems like riscv was too conservative to estimate the TLS LE before.
|
||||
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
|
||||
TEXTREL problem.
|
||||
|
||||
* For PR ld/22263,
|
||||
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
|
||||
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
|
||||
also the right way to do the same thing for risc-v.
|
||||
|
||||
On risc-v, fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
RISC-V haven't supported the TLS transitions, so will need the same fix (use
|
||||
bfd_link_dll) in the future.
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
PR ld/25694
|
||||
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
|
||||
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
|
||||
relocation for TLS LE in pie/pde, and report error in pic just like
|
||||
before.
|
||||
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
|
||||
than !bfd_link_pic in determining the dynamic symbol index. Avoid
|
||||
the index of -1.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
|
||||
index 75af040cf92..762ea231c0b 100644
|
||||
--- a/bfd/elfnn-riscv.c
|
||||
+++ b/bfd/elfnn-riscv.c
|
||||
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
break;
|
||||
|
||||
case R_RISCV_TLS_GOT_HI20:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|
||||
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
|
||||
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
goto static_reloc;
|
||||
|
||||
case R_RISCV_TPREL_HI20:
|
||||
+ /* This is not allowed in the pic, but okay in pie. */
|
||||
if (!bfd_link_executable (info))
|
||||
return bad_static_reloc (abfd, r_type, h);
|
||||
if (h != NULL)
|
||||
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
|
||||
- goto static_reloc;
|
||||
+ break;
|
||||
|
||||
case R_RISCV_HI20:
|
||||
if (bfd_link_pic (info))
|
||||
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
|
||||
if (htab->elf.srelgot == NULL)
|
||||
abort ();
|
||||
|
||||
- if (h != NULL)
|
||||
- {
|
||||
- bool dyn, pic;
|
||||
- dyn = htab->elf.dynamic_sections_created;
|
||||
- pic = bfd_link_pic (info);
|
||||
-
|
||||
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
|
||||
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
- indx = h->dynindx;
|
||||
- }
|
||||
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
|
||||
+ if (h != NULL
|
||||
+ && h->dynindx != -1
|
||||
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
|
||||
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
+ indx = h->dynindx;
|
||||
|
||||
/* The GOT entries have not been initialized yet. Do it
|
||||
now, and emit any relocations. */
|
||||
- if ((bfd_link_pic (info) || indx != 0)
|
||||
+ if ((bfd_link_dll (info) || indx != 0)
|
||||
&& (h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
- need_relocs = true;
|
||||
+ need_relocs = true;
|
||||
|
||||
if (tls_type & GOT_TLS_GD)
|
||||
{
|
||||
|
||||
+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,153 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-riscv64
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
CTARGET_ARCH=riscv64
|
||||
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||
|
||||
pkgname=binutils-riscv64
|
||||
pkgver=2.40
|
||||
pkgrel=12
|
||||
pkgdesc="Tools necessary to build programs for riscv64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
makedepends_build="bison flex texinfo"
|
||||
makedepends_host="zlib-dev jansson-dev zstd-dev"
|
||||
arch="x86_64"
|
||||
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
|
||||
subpackages="binutils-dev binutils-doc"
|
||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
CVE-2023-1972.patch
|
||||
binutils-ld-fix-static-linking.patch
|
||||
riscv64-textrels.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ -z "$BOOTSTRAP" ]; then
|
||||
makedepends_host="$makedepends_host jansson-dev zstd-dev"
|
||||
_noboot_configure="--enable-jansson --with-zstd"
|
||||
fi
|
||||
|
||||
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.40-r10:
|
||||
# - CVE-2023-1972
|
||||
# 2.40-r0:
|
||||
# - CVE-2023-1579
|
||||
# 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
|
||||
|
||||
CFLAGS="$CFLAGS -O2" \
|
||||
CXXFLAGS="$CXXFLAGS -O2" \
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--target=$CTARGET \
|
||||
--with-build-sysroot="$CBUILDROOT" \
|
||||
--with-sysroot=$_sysroot \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--sysconfdir=/etc \
|
||||
$_arch_configure \
|
||||
$_cross_configure \
|
||||
$_gold_configure \
|
||||
$_plugin_configure \
|
||||
$_noboot_configure \
|
||||
--disable-gprofng \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-colored-disassembly \
|
||||
--enable-default-execstack=no \
|
||||
--enable-default-hash-style=gnu \
|
||||
--enable-deterministic-archives \
|
||||
--enable-ld=default \
|
||||
--enable-new-dtags \
|
||||
--enable-relro \
|
||||
--enable-threads \
|
||||
--with-bugurl="https://postmarketos.org/issues" \
|
||||
--with-mmap \
|
||||
--with-pic \
|
||||
--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
|
||||
}
|
||||
|
||||
gold() {
|
||||
pkgdesc="GNU binutils - gold linker"
|
||||
|
||||
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||
amove usr/bin/ld.gold
|
||||
fi
|
||||
amove usr/$CTARGET/bin/ld.gold
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
|
||||
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
|
||||
"
|
||||
@@ -0,0 +1,37 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
|
||||
--
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
|
||||
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
|
||||
|
||||
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
|
||||
|
||||
PR 30285
|
||||
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elf.c b/bfd/elf.c
|
||||
index 027d0143735..185028cbd97 100644
|
||||
--- a/bfd/elf.c
|
||||
+++ b/bfd/elf.c
|
||||
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return_verdef;
|
||||
}
|
||||
+
|
||||
+ if (amt == 0)
|
||||
+ goto error_return_verdef;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return_verdef;
|
||||
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return;
|
||||
}
|
||||
+ if (amt == 0)
|
||||
+ goto error_return;
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return;
|
||||
@@ -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,103 @@
|
||||
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
|
||||
--
|
||||
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
|
||||
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
|
||||
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
|
||||
|
||||
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
|
||||
|
||||
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
|
||||
|
||||
* For PR ld/25694,
|
||||
In the check_reloc, refer to spare and loongarch, they don't need to reserve
|
||||
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
|
||||
So it seems like riscv was too conservative to estimate the TLS LE before.
|
||||
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
|
||||
TEXTREL problem.
|
||||
|
||||
* For PR ld/22263,
|
||||
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
|
||||
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
|
||||
also the right way to do the same thing for risc-v.
|
||||
|
||||
On risc-v, fixes
|
||||
FAIL: Build pr22263-1
|
||||
|
||||
RISC-V haven't supported the TLS transitions, so will need the same fix (use
|
||||
bfd_link_dll) in the future.
|
||||
|
||||
bfd/
|
||||
PR ld/22263
|
||||
PR ld/25694
|
||||
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
|
||||
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
|
||||
relocation for TLS LE in pie/pde, and report error in pic just like
|
||||
before.
|
||||
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
|
||||
than !bfd_link_pic in determining the dynamic symbol index. Avoid
|
||||
the index of -1.
|
||||
---
|
||||
|
||||
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
|
||||
index 75af040cf92..762ea231c0b 100644
|
||||
--- a/bfd/elfnn-riscv.c
|
||||
+++ b/bfd/elfnn-riscv.c
|
||||
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
break;
|
||||
|
||||
case R_RISCV_TLS_GOT_HI20:
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (bfd_link_dll (info))
|
||||
info->flags |= DF_STATIC_TLS;
|
||||
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|
||||
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
|
||||
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
goto static_reloc;
|
||||
|
||||
case R_RISCV_TPREL_HI20:
|
||||
+ /* This is not allowed in the pic, but okay in pie. */
|
||||
if (!bfd_link_executable (info))
|
||||
return bad_static_reloc (abfd, r_type, h);
|
||||
if (h != NULL)
|
||||
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
|
||||
- goto static_reloc;
|
||||
+ break;
|
||||
|
||||
case R_RISCV_HI20:
|
||||
if (bfd_link_pic (info))
|
||||
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
|
||||
if (htab->elf.srelgot == NULL)
|
||||
abort ();
|
||||
|
||||
- if (h != NULL)
|
||||
- {
|
||||
- bool dyn, pic;
|
||||
- dyn = htab->elf.dynamic_sections_created;
|
||||
- pic = bfd_link_pic (info);
|
||||
-
|
||||
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
|
||||
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
- indx = h->dynindx;
|
||||
- }
|
||||
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
|
||||
+ if (h != NULL
|
||||
+ && h->dynindx != -1
|
||||
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
|
||||
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
|
||||
+ indx = h->dynindx;
|
||||
|
||||
/* The GOT entries have not been initialized yet. Do it
|
||||
now, and emit any relocations. */
|
||||
- if ((bfd_link_pic (info) || indx != 0)
|
||||
+ if ((bfd_link_dll (info) || indx != 0)
|
||||
&& (h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
- need_relocs = true;
|
||||
+ need_relocs = true;
|
||||
|
||||
if (tls_type & GOT_TLS_GD)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ fi
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.36.1
|
||||
pkgrel=29
|
||||
pkgrel=2
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -21,16 +21,16 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-v3.20.apk::$_mirror/v3.20/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.20.apk
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a90e30c6d373665aa30c0fc3eb74a34180d5d56ddd5e296616baf46802addf39a243370987b43495ead70fe0ed47251b81e31c77dd3a4c309ae5e76b7c50f738 busybox-static-1.36.1-r29-aarch64-v3.20.apk
|
||||
25394d1105e40c8decf861c55c68401708ed8dbcd9643194c7c270f9cc4a792d0376cb926816f8803d496610bdbc53494a09a360097981f862958ceb4435768a busybox-static-1.36.1-r2-aarch64-edge.apk
|
||||
"
|
||||
@@ -0,0 +1,36 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-armhf
|
||||
|
||||
# Stub for apkbuild-lint
|
||||
if [ -z "$(type -t arch_to_hostspec)" ]; then
|
||||
arch_to_hostspec() { :; }
|
||||
fi
|
||||
|
||||
pkgname=busybox-static-armhf
|
||||
pkgver=1.36.1
|
||||
pkgrel=2
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
|
||||
url="http://busybox.net"
|
||||
license="GPL2"
|
||||
arch="x86_64"
|
||||
options="!check !strip"
|
||||
pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
6dd546f62fdb8c0a45428bc313c28be573d92e468c52ac1210ea054a4cc701810a5bbee766d53e0374fcca6b6611e9202ab4036899c97b5129ac216ffccadf73 busybox-static-1.36.1-r2-armhf-edge.apk
|
||||
"
|
||||
@@ -8,7 +8,7 @@ fi
|
||||
|
||||
pkgname=busybox-static-armv7
|
||||
pkgver=1.36.1
|
||||
pkgrel=29
|
||||
pkgrel=2
|
||||
|
||||
_arch="armv7"
|
||||
_mirror="http://dl-4.alpinelinux.org/alpine/"
|
||||
@@ -21,16 +21,16 @@ pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-v3.20.apk::$_mirror/v3.20/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.20.apk
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a4a364d5957aa556c1660ea47e5e45fd882644bb468b6eea38fb1176f03f2106c14b7ac7b111d38a1c0df2e467a053d25efcab99b8c2c27a4a550286dbabeb02 busybox-static-1.36.1-r29-armv7-v3.20.apk
|
||||
b723bb48cc886706271f39a2bc096a1d6adfcca3df6233a3f7e904996e6dcd76a0a7d24fb75e4e637bf6a1b35f71221e8a10cd52a4f1e9bbe403a81d1f83bfc1 busybox-static-1.36.1-r2-armv7-edge.apk
|
||||
"
|
||||
+12
-18
@@ -1,6 +1,3 @@
|
||||
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
|
||||
# https://wiki.postmarketos.org/wiki/Pmbootstrap:_Cross_Compiling
|
||||
#
|
||||
# Wrapper for the "crossdirect" compilation method.
|
||||
# pmbootstrap mounts the native chroot in the foreign arch (e.g. armhf) chroot
|
||||
# as /native. This package gets installed into the native chroot, and creates
|
||||
@@ -19,14 +16,14 @@
|
||||
# version is implemented as simple shell wrappers.
|
||||
|
||||
pkgname=crossdirect
|
||||
pkgver=5.1.0
|
||||
pkgrel=0
|
||||
pkgver=4
|
||||
pkgrel=3
|
||||
pkgdesc="Wrappers to launch native cross compilers in foreign chroots"
|
||||
url="https://postmarketOS.org"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
options="!check"
|
||||
source="cargo.sh crossdirect.c rustc.sh rust-qemu-linker.sh"
|
||||
source="crossdirect.c rustc.sh rust-qemu-linker.sh"
|
||||
|
||||
build() {
|
||||
cd "$srcdir"
|
||||
@@ -43,6 +40,9 @@ build() {
|
||||
-Werror \
|
||||
-DHOSTSPEC="\"$_hostspec\"" \
|
||||
crossdirect.c
|
||||
|
||||
# rustc
|
||||
sed "s/@ARCH@/$_arch/g" rustc.sh >rustc-"$_arch"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -51,11 +51,9 @@ package() {
|
||||
_archs="x86_64 armhf armv7 aarch64"
|
||||
_bins="c++ cc cpp g++ gcc clang clang++"
|
||||
|
||||
# Rust wrappers
|
||||
# Rust: qemu-linker
|
||||
install -Dm755 "$srcdir/rust-qemu-linker.sh" \
|
||||
"$pkgdir/usr/lib/crossdirect/rust-qemu-linker"
|
||||
install -Dm755 "$srcdir/cargo.sh" "$pkgdir/usr/lib/crossdirect/cargo.sh"
|
||||
install -Dm755 "$srcdir/rustc.sh" "$pkgdir/usr/lib/crossdirect/rustc.sh"
|
||||
|
||||
# Iterate over architectures
|
||||
for _arch in $_archs; do
|
||||
@@ -75,14 +73,10 @@ package() {
|
||||
ln -s "crossdirect-$_arch" "$_hostspec-$_bin"
|
||||
done
|
||||
|
||||
ln -s ../cargo.sh cargo
|
||||
ln -s ../rustc.sh rustc
|
||||
# Rust: arch-specific rustc wrapper
|
||||
install -Dm755 "$srcdir/rustc-$_arch" "$_bindir/rustc"
|
||||
done
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
0f4b48f250425dc57f63955fc8b38477d23db793bee367c3fbe03c3d2a559ba576434d07518310db4cae9d90d501af4051b80038b10fae94b980e537fc9374ad cargo.sh
|
||||
500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
|
||||
de2aa6929bbff5db9132673e667f4525b333d062cb1f7a0597dd924de9e5c7215a9f8e2e6263b6fb5ace06f2c4b64f4ebfd0ede9b78add07c2cd08ec8613e98f rustc.sh
|
||||
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh
|
||||
"
|
||||
sha512sums="500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
|
||||
6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh
|
||||
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh"
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if [ -n "$CROSSDIRECT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
native_version=$(LD_LIBRARY_PATH=/native/lib:/native/usr/lib /native/usr/bin/rustc -V)
|
||||
target_version=$(/usr/bin/rustc -V)
|
||||
|
||||
if [ "$target_version" != "$native_version" ]; then
|
||||
echo "ERROR: crossdirect: rustc version mismatch between native and build chroot. Please update your chroots and try again." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
triplet=$(/usr/bin/rustc -vV | sed -n 's/host: //p')
|
||||
cmd=$1
|
||||
shift
|
||||
|
||||
case "$cmd" in
|
||||
build|test|run)
|
||||
;;
|
||||
*)
|
||||
echo "WARNING: crossdirect: 'cargo $cmd $*' command not supported, running in QEMU (slow!)" >&2
|
||||
export PATH="$(echo "$PATH" | sed 's,/native/usr/lib/crossdirect/[^:]*:,,')"
|
||||
exec /usr/bin/cargo "$cmd" "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
target_dir=${CARGO_TARGET_DIR:-target}
|
||||
target_already_specified=${CARGO_BUILD_TARGET:+1}
|
||||
|
||||
if [ -z "$target_specified" ]; then
|
||||
for arg in "$@"; do
|
||||
if [ "$arg_target_dir" = 1 ]; then
|
||||
target_dir=$arg
|
||||
arg_target_dir=0
|
||||
fi
|
||||
case "$arg" in
|
||||
--target|--target=*)
|
||||
target_already_specified=1
|
||||
break
|
||||
;;
|
||||
--target-dir)
|
||||
arg_target_dir=1
|
||||
;;
|
||||
--target-dir=*)
|
||||
target_dir=${arg##--target-dir=}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$target_already_specified" ]; then
|
||||
exec /usr/bin/cargo "$cmd" "$@"
|
||||
fi
|
||||
|
||||
/usr/bin/cargo "$cmd" --target=$triplet "$@"
|
||||
|
||||
# copy target/$triplet/{release,debug,...} to target/{release,debug,...}
|
||||
if [ -d "$target_dir/$triplet" ]; then
|
||||
for dir in "$target_dir/$triplet"/*/; do
|
||||
build=$(basename "$dir")
|
||||
rm -rf "$target_dir/$build"
|
||||
cp -r "$target_dir/$triplet/$build" "$target_dir/$build"
|
||||
done
|
||||
fi
|
||||
+41
-31
@@ -1,38 +1,48 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if [ -n "$CROSSDIRECT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
rust_triplet() {
|
||||
# Find the triplets in Alpine's rust APKBUILD or with:
|
||||
# pmbootstrap chroot -barmhf --add=rust -- ls /usr/lib/rustlib
|
||||
case "$1" in
|
||||
x86_64)
|
||||
echo "x86_64-alpine-linux-musl"
|
||||
;;
|
||||
armhf)
|
||||
echo "armv6-alpine-linux-musleabihf"
|
||||
;;
|
||||
armv7)
|
||||
echo "armv7-alpine-linux-musleabihf"
|
||||
;;
|
||||
aarch64)
|
||||
echo "aarch64-alpine-linux-musl"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: don't know the rust triple for $1!" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# return the correct host architecture when cargo requests it
|
||||
if [ "$*" = "-vV" ] || [ "$*" = "-V" ]; then
|
||||
exec /usr/bin/rustc "$*"
|
||||
fi
|
||||
arch="@ARCH@" # filled in by APKBUILD
|
||||
|
||||
# pmbootstrap installs sccache when building a rust program, unless --no-ccache
|
||||
# is set. In that case it also sets CCACHE_DISABLE.
|
||||
SCCACHE=/native/usr/bin/sccache
|
||||
if ! [ -e "$SCCACHE" ] || [ -n "$CCACHE_DISABLE" ]; then
|
||||
SCCACHE=""
|
||||
fi
|
||||
|
||||
# We expect the right target to be set in the arguments if compiling for the
|
||||
# target architecture. Our cargo wrapper passes the right "--target" argument
|
||||
# automatically. If no target is provided, this is probably a macro or a
|
||||
# build script, so it should be compiled for the native architecture.
|
||||
if echo "$*" | grep -qFe "--target"; then
|
||||
# Not using sccache when building for foreign architecture, as it
|
||||
# doesn't cache the output with "Non-cacheable reasons: --sysroot"
|
||||
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
|
||||
/native/usr/bin/rustc \
|
||||
if ! LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
|
||||
/native/usr/bin/rustc \
|
||||
-Clinker=/native/usr/lib/crossdirect/rust-qemu-linker \
|
||||
--target=$(rust_triplet "$arch") \
|
||||
--sysroot=/usr \
|
||||
"$@"
|
||||
else
|
||||
PATH=/native/usr/bin:/native/bin \
|
||||
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
|
||||
$SCCACHE \
|
||||
/native/usr/bin/rustc \
|
||||
-Clink-arg=-Wl,-rpath,/native/lib:/native/usr/lib \
|
||||
"$@"
|
||||
"$@"; then
|
||||
echo "---" >&2
|
||||
echo "WARNING: crossdirect: cross compiling with rustc failed, trying"\
|
||||
"again with rustc + qemu" >&2
|
||||
echo "---" >&2
|
||||
# Usually the crossdirect approach works; however, when passing
|
||||
# --extern to rustc with a dynamic library (.so), it fails with an
|
||||
# error like 'can't find crate for `serde_derive`' (although the crate
|
||||
# does exist). I think it fails to parse the metadata of the so file
|
||||
# for some reason. We probably need to adjust rustc's
|
||||
# librustc_metadata/locator.rs or something (and upstream that
|
||||
# change!), but I've spent enough time on this already. Let's simply
|
||||
# fall back to compiling in qemu in the very few cases where this is
|
||||
# necessary.
|
||||
/usr/bin/rustc "$@"
|
||||
fi
|
||||
@@ -1,7 +1,7 @@
|
||||
From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001
|
||||
From 75e758609803afe6ced6cd7799b4159f3848a8d5 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/35] posix_memalign
|
||||
Subject: [PATCH 01/33] posix_memalign
|
||||
|
||||
---
|
||||
gcc/config/i386/pmm_malloc.h | 9 +++++----
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001
|
||||
From 447c2a21d1fa8c2c3b216102a808834d86f12104 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/35] gcc: poison-system-directories
|
||||
Subject: [PATCH 02/33] 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
|
||||
@@ -120,7 +120,7 @@ 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 b61ecfc1bc8..b290908679e 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
@@ -131,7 +131,7 @@ index af0e5933fdb..b6731a4673c 100644
|
||||
-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
|
||||
@@ -8424,6 +8425,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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001
|
||||
From b5c378c4c1e71b2dd8b4616d8f61530ee1a3ac98 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/35] specs: turn on -Wl,-z,now by default
|
||||
Subject: [PATCH 03/33] 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,10 +14,10 @@ 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 b290908679e..cb34e6d40c9 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
|
||||
@@ -17959,6 +17959,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}.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 1b315235433701e4a974da259b8d651169ddc7ac Mon Sep 17 00:00:00 2001
|
||||
From bb3ef1f5acfde9658c922d0aef9283fe60328c33 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/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
|
||||
Subject: [PATCH 04/33] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
|
||||
ObjC, ObjC++, if the optimization level is > 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 cb34e6d40c9..7f1aa660285 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -11868,6 +11868,12 @@ also turns on the following optimization flags:
|
||||
@@ -11866,6 +11866,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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001
|
||||
From 0727ad9e4a458d090be6fb0cfbe334d8496cd5e0 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/35] On linux targets pass --as-needed by default to the
|
||||
Subject: [PATCH 05/33] On linux targets pass --as-needed by default to the
|
||||
linker, but always link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001
|
||||
From dc3e2f629fe7f8df81c74162c66910339ec5d03d 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/35] Enable -Wformat and -Wformat-security by default.
|
||||
Subject: [PATCH 06/33] Enable -Wformat and -Wformat-security by default.
|
||||
|
||||
---
|
||||
gcc/c-family/c.opt | 4 ++--
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001
|
||||
From d25c373cf839df0720f8d345b5ad55147030515a 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/35] Enable -Wtrampolines by default.
|
||||
Subject: [PATCH 07/33] Enable -Wtrampolines by default.
|
||||
|
||||
---
|
||||
gcc/common.opt | 2 +-
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001
|
||||
From eb58983c3d3126caaab8ed174571b142a095c132 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/35] Disable ssp on -nostdlib, -nodefaultlibs and
|
||||
Subject: [PATCH 08/33] Disable ssp on -nostdlib, -nodefaultlibs and
|
||||
-ffreestanding Change the buffer size.
|
||||
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001
|
||||
From 823afef2053ca4f79ac13f2b0f52b132282ee705 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/35] Ensure that msgfmt doesn't encounter problems during
|
||||
Subject: [PATCH 09/33] Ensure that msgfmt doesn't encounter problems during
|
||||
gcc bootstrapping.
|
||||
|
||||
Solves error messages like the following:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001
|
||||
From 702cbba342eae468e79d9b42e366b9699c158402 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/35] Don't declare asprintf if defined as a macro.
|
||||
Subject: [PATCH 10/33] Don't declare asprintf if defined as a macro.
|
||||
|
||||
---
|
||||
include/libiberty.h | 3 +++
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001
|
||||
From 18f0ecbdab63b0ee590ef21650ac72879318a8be 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/35] libiberty: copy PIC objects during build process
|
||||
Subject: [PATCH 11/33] libiberty: copy PIC objects during build process
|
||||
|
||||
---
|
||||
libiberty/Makefile.in | 1 +
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001
|
||||
From e350a47267790a1a624032a645425b4018433e0c 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/35] libgcc_s
|
||||
Subject: [PATCH 12/33] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386-expand.cc | 4 ++--
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001
|
||||
From 6ed790bb2e5bf49d186885cad8fd7efc10d8fd36 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/35] nopie
|
||||
Subject: [PATCH 13/33] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001
|
||||
From c7398885b5c2cd91a3ad1a56fde272b719d17ff5 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/35] ada: fix shared linking
|
||||
Subject: [PATCH 14/33] ada: fix shared linking
|
||||
|
||||
---
|
||||
gcc/ada/link.c | 12 ++++++------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001
|
||||
From c2861147eacede8c97dbb8d251f7d30ac2116481 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/35] build: fix CXXFLAGS_FOR_BUILD passing
|
||||
Subject: [PATCH 15/33] build: fix CXXFLAGS_FOR_BUILD passing
|
||||
|
||||
---
|
||||
Makefile.in | 1 +
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001
|
||||
From 736fd338aaa6d0686b15beabac687a20cfb29c27 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/35] add fortify-headers paths
|
||||
Subject: [PATCH 16/33] add fortify-headers paths
|
||||
|
||||
---
|
||||
gcc/config/linux.h | 2 ++
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001
|
||||
From f71fef0a3d527ba84faaf63cee2a5ecb2322412e 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/35] Alpine musl package provides libssp_nonshared.a. We
|
||||
Subject: [PATCH 17/33] 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001
|
||||
From 06624ddc7dfd4dcfb4e41f4549ffcacfbc43b315 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/35] DP: Use --push-state/--pop-state for gold as well when
|
||||
Subject: [PATCH 18/33] DP: Use --push-state/--pop-state for gold as well when
|
||||
linking libtsan.
|
||||
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001
|
||||
From cbc762f2d4c8ae714f7a0c762d90453607a5c2e5 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/35] aarch64: disable multilib support
|
||||
Subject: [PATCH 19/33] aarch64: disable multilib support
|
||||
|
||||
multilib is unsupported on Alpine GCC
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001
|
||||
From f820b730e48421ab03e5742dc06e83570690078e 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/35] s390x: disable multilib support
|
||||
Subject: [PATCH 20/33] s390x: disable multilib support
|
||||
|
||||
multilib is not supported on Alpine GCC at present
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001
|
||||
From 40c3d28f4d090fcd3486ca2a88d0c7618fdb03ed 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/35] ppc64[le]: disable multilib support
|
||||
Subject: [PATCH 21/33] ppc64[le]: disable multilib support
|
||||
|
||||
multilib is not presently supported on Alpine GCC
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001
|
||||
From 05cf20eb11b3013c2fbb26c841485f675811058c 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/35] x86_64: disable multilib support
|
||||
Subject: [PATCH 22/33] x86_64: disable multilib support
|
||||
|
||||
multilib is not presently supported on Alpine GCC
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001
|
||||
From 0920d23e3a345bc17675b9bebc52644c238123e2 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/35] riscv: disable multilib support
|
||||
Subject: [PATCH 23/33] riscv: disable multilib support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001
|
||||
From 5c955776d65f5a018375652904b088a37203899d 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/35] always build libgcc_eh.a
|
||||
Subject: [PATCH 24/33] always build libgcc_eh.a
|
||||
|
||||
highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001
|
||||
From ac6202d063308fbf67e4b617b768536e66a44519 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/35] ada: libgnarl compatibility for musl
|
||||
Subject: [PATCH 25/33] ada: libgnarl compatibility for musl
|
||||
|
||||
---
|
||||
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001
|
||||
From b7404c39a6a76ebe382caa2b9da16006413b21b9 Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Fri, 21 Aug 2020 07:07:48 +0000
|
||||
Subject: [PATCH 26/35] ada: musl support fixes
|
||||
Subject: [PATCH 26/33] ada: musl support fixes
|
||||
|
||||
---
|
||||
gcc/ada/Makefile.rtl | 10 +++++-----
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001
|
||||
From 401ac3feeea049a8035bf916f550ce6f4e859cba 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/35] configure: Add --enable-autolink-libatomic, use in
|
||||
Subject: [PATCH 27/33] configure: Add --enable-autolink-libatomic, use in
|
||||
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
|
||||
|
||||
This fixes issues with RISC-V.
|
||||
@@ -166,10 +166,10 @@ index 57268319de1..56bcaa87620 100644
|
||||
# Checks for other programs
|
||||
# -------------------------
|
||||
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
|
||||
index b30d3691fe6..ccc8e5dbb00 100644
|
||||
index 928fc6b6d4b..81a677014df 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
|
||||
@@ -2374,6 +2374,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}.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001
|
||||
From cd46156af13743fe93c48d00b0661add2c319226 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sun, 29 Aug 2021 12:23:34 +0200
|
||||
Subject: [PATCH 28/35] configure: fix detection of atomic builtins in
|
||||
Subject: [PATCH 28/33] configure: fix detection of atomic builtins in
|
||||
libatomic configure script
|
||||
|
||||
Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001
|
||||
From f0f2cad36cd4796426ce1c25a6cec7c70a56741e Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Thu, 30 Jun 2022 16:44:51 +0000
|
||||
Subject: [PATCH 29/35] libstdc++: do not throw exceptions for non-C locales on
|
||||
Subject: [PATCH 29/33] libstdc++: do not throw exceptions for non-C locales on
|
||||
musl targets
|
||||
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001
|
||||
From b474c9688ebda225ced95ecea0219312110d9c9e Mon Sep 17 00:00:00 2001
|
||||
From: Mathias LANG <pro.mathias.lang@gmail.com>
|
||||
Date: Mon, 17 Jan 2022 03:49:21 +0000
|
||||
Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against
|
||||
Subject: [PATCH 30/33] gdc: unconditionally link libgphobos against
|
||||
libucontext
|
||||
|
||||
ref: alpine/aports#13422
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001
|
||||
From 6598811df64744ba862e36a6dca88578b01dd46e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Sat, 16 Jul 2022 09:21:11 +0200
|
||||
Subject: [PATCH 31/35] druntime: link against libucontext on all platforms
|
||||
Subject: [PATCH 31/33] druntime: link against libucontext on all platforms
|
||||
|
||||
On musl-based Linux distributions, swapcontext etc. are not provided by
|
||||
musl but instead by libucontext. Hence, we _always_ need to link against
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001
|
||||
From 4e84b0a3c019438b25de7c1e844746e4bc83af42 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
||||
Date: Tue, 19 Jul 2022 14:54:07 +0200
|
||||
Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc
|
||||
Subject: [PATCH 32/33] libgnat: time_t is always 64-bit on musl libc
|
||||
|
||||
---
|
||||
gcc/ada/libgnat/s-parame.ads | 2 +-
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001
|
||||
From 4cf06fff68090b1681d070a55214f2ab26754edf Mon Sep 17 00:00:00 2001
|
||||
From: psykose <alice@ayaya.dev>
|
||||
Date: Mon, 29 May 2023 15:33:11 +0000
|
||||
Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols
|
||||
Subject: [PATCH 33/33] libphobos: do not use LFS64 symbols
|
||||
|
||||
musl does not have these since 1.2.4, we can't use the compat interfaces.
|
||||
---
|
||||
libphobos/libdruntime/core/sys/posix/config.d | 2 +-
|
||||
libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +-----
|
||||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d
|
||||
index ae6752f220e..6b80d1ff0e6 100644
|
||||
--- a/libphobos/libdruntime/core/sys/posix/config.d
|
||||
+++ b/libphobos/libdruntime/core/sys/posix/config.d
|
||||
@@ -88,7 +88,7 @@ else version (CRuntime_Musl)
|
||||
enum __REDIRECT = false;
|
||||
|
||||
// Those three are irrelevant for Musl as it always uses 64 bits off_t
|
||||
- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64;
|
||||
+ enum __USE_FILE_OFFSET64 = false;
|
||||
enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT;
|
||||
enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT;
|
||||
|
||||
diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d
|
||||
index 0d3d517d69a..323aa0af72d 100644
|
||||
--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001
|
||||
From: psykose <alice@ayaya.dev>
|
||||
Date: Mon, 10 Jul 2023 23:23:29 +0000
|
||||
Subject: [PATCH 34/35] libgo: fix lfs64 use
|
||||
|
||||
---
|
||||
.../go/internal/syscall/unix/at_largefile.go | 2 +-
|
||||
libgo/go/os/dir_largefile.go | 2 +-
|
||||
libgo/go/syscall/libcall_glibc.go | 2 +-
|
||||
libgo/go/syscall/libcall_linux.go | 4 +--
|
||||
libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++----------
|
||||
libgo/runtime/go-varargs.c | 2 +-
|
||||
libgo/sysinfo.c | 9 +++----
|
||||
7 files changed, 22 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go
|
||||
index 82e0dcfd074..16151ecad1b 100644
|
||||
--- a/libgo/go/internal/syscall/unix/at_largefile.go
|
||||
+++ b/libgo/go/internal/syscall/unix/at_largefile.go
|
||||
@@ -10,5 +10,5 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
-//extern fstatat64
|
||||
+//extern fstatat
|
||||
func fstatat(int32, *byte, *syscall.Stat_t, int32) int32
|
||||
diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go
|
||||
index 1fc5ee0771f..0c6dffe1a75 100644
|
||||
--- a/libgo/go/os/dir_largefile.go
|
||||
+++ b/libgo/go/os/dir_largefile.go
|
||||
@@ -11,5 +11,5 @@ package os
|
||||
|
||||
import "syscall"
|
||||
|
||||
-//extern readdir64
|
||||
+//extern readdir
|
||||
func libc_readdir(*syscall.DIR) *syscall.Dirent
|
||||
diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go
|
||||
index 5c1ec483c75..5a1245ed44b 100644
|
||||
--- a/libgo/go/syscall/libcall_glibc.go
|
||||
+++ b/libgo/go/syscall/libcall_glibc.go
|
||||
@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) {
|
||||
}
|
||||
|
||||
//sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error)
|
||||
-//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
|
||||
+//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
|
||||
|
||||
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
if race.Enabled {
|
||||
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
|
||||
index 03ca7261b59..ad21fd0b3ac 100644
|
||||
--- a/libgo/go/syscall/libcall_linux.go
|
||||
+++ b/libgo/go/syscall/libcall_linux.go
|
||||
@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) {
|
||||
//adjtimex(buf *Timex) _C_int
|
||||
|
||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||
-//fstatfs64(fd _C_int, buf *Statfs_t) _C_int
|
||||
+//fstatfs(fd _C_int, buf *Statfs_t) _C_int
|
||||
|
||||
func Gettid() (tid int) {
|
||||
r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0)
|
||||
@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
|
||||
}
|
||||
|
||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
-//statfs64(path *byte, buf *Statfs_t) _C_int
|
||||
+//statfs(path *byte, buf *Statfs_t) _C_int
|
||||
|
||||
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
||||
//sysinfo(info *Sysinfo_t) _C_int
|
||||
diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go
|
||||
index f90055bb29a..334212f0af1 100644
|
||||
--- a/libgo/go/syscall/libcall_posix_largefile.go
|
||||
+++ b/libgo/go/syscall/libcall_posix_largefile.go
|
||||
@@ -10,40 +10,40 @@
|
||||
package syscall
|
||||
|
||||
//sys Creat(path string, mode uint32) (fd int, err error)
|
||||
-//creat64(path *byte, mode Mode_t) _C_int
|
||||
+//creat(path *byte, mode Mode_t) _C_int
|
||||
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||
-//fstat64(fd _C_int, stat *Stat_t) _C_int
|
||||
+//fstat(fd _C_int, stat *Stat_t) _C_int
|
||||
|
||||
//sys Ftruncate(fd int, length int64) (err error)
|
||||
-//ftruncate64(fd _C_int, length Offset_t) _C_int
|
||||
+//ftruncate(fd _C_int, length Offset_t) _C_int
|
||||
|
||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
||||
-//getrlimit64(resource _C_int, rlim *Rlimit) _C_int
|
||||
+//getrlimit(resource _C_int, rlim *Rlimit) _C_int
|
||||
|
||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||
-//lstat64(path *byte, stat *Stat_t) _C_int
|
||||
+//lstat(path *byte, stat *Stat_t) _C_int
|
||||
|
||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||
-//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte
|
||||
+//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte
|
||||
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
-//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int
|
||||
+//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int
|
||||
|
||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||
-//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
|
||||
+//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
|
||||
|
||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||
-//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
|
||||
+//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
|
||||
|
||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error)
|
||||
-//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t
|
||||
+//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t
|
||||
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
-//setrlimit64(resource int, rlim *Rlimit) _C_int
|
||||
+//setrlimit(resource int, rlim *Rlimit) _C_int
|
||||
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
-//stat64(path *byte, stat *Stat_t) _C_int
|
||||
+//stat(path *byte, stat *Stat_t) _C_int
|
||||
|
||||
//sys Truncate(path string, length int64) (err error)
|
||||
-//truncate64(path *byte, length Offset_t) _C_int
|
||||
+//truncate(path *byte, length Offset_t) _C_int
|
||||
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c
|
||||
index f84860891e6..7efc9615985 100644
|
||||
--- a/libgo/runtime/go-varargs.c
|
||||
+++ b/libgo/runtime/go-varargs.c
|
||||
@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg)
|
||||
int
|
||||
__go_open64 (char *path, int mode, mode_t perm)
|
||||
{
|
||||
- return open64 (path, mode, perm);
|
||||
+ return open (path, mode, perm);
|
||||
}
|
||||
|
||||
#endif
|
||||
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
|
||||
index 180f5c31d74..1d717d55c0e 100644
|
||||
--- a/libgo/sysinfo.c
|
||||
+++ b/libgo/sysinfo.c
|
||||
@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OFF64_T)
|
||||
-typedef off64_t libgo_off_t_type;
|
||||
+typedef off_t libgo_off_t_type;
|
||||
#else
|
||||
typedef off_t libgo_off_t_type;
|
||||
#endif
|
||||
@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type;
|
||||
|
||||
// From dirent.h
|
||||
SREF(dirent);
|
||||
-SREF(dirent64);
|
||||
OTREF(DIR);
|
||||
EREF(DT_UNKNOWN);
|
||||
|
||||
// From fcntl.h
|
||||
SREF(flock);
|
||||
-SREF(flock64);
|
||||
|
||||
// From ffi headers
|
||||
SREF(_ffi_type);
|
||||
@@ -485,11 +483,10 @@ EREF(SS_ONSTACK);
|
||||
EREF(SEGV_MAPERR);
|
||||
|
||||
// From stat.h
|
||||
-SREF(stat64);
|
||||
+SREF(stat);
|
||||
|
||||
// From statfs.h
|
||||
SREF(statfs);
|
||||
-SREF(statfs64);
|
||||
|
||||
// From sysinfo.h
|
||||
SREF(sysinfo);
|
||||
@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT);
|
||||
|
||||
// From sys/resource.h
|
||||
SREF(rusage);
|
||||
-SREF(rlimit64);
|
||||
+SREF(rlimit);
|
||||
EREF(RLIMIT_NOFILE);
|
||||
EREF(PRIO_USER);
|
||||
EREF(RUSAGE_SELF);
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
https://gcc.gnu.org/PR110792
|
||||
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=790c1f60a5662b16eb19eb4b81922995863c7571
|
||||
https://github.com/randombit/botan/issues/3637
|
||||
|
||||
From 85628c5653ff40963158a24c60eeec6a3b5a8e56 Mon Sep 17 00:00:00 2001
|
||||
From: Roger Sayle <roger@nextmovesoftware.com>
|
||||
Date: Thu, 3 Aug 2023 07:12:04 +0100
|
||||
Subject: [PATCH] PR target/110792: Early clobber issues with
|
||||
rot32di2_doubleword on i386.
|
||||
|
||||
This patch is a conservative fix for PR target/110792, a wrong-code
|
||||
regression affecting doubleword rotations by BITS_PER_WORD, which
|
||||
effectively swaps the highpart and lowpart words, when the source to be
|
||||
rotated resides in memory. The issue is that if the register used to
|
||||
hold the lowpart of the destination is mentioned in the address of
|
||||
the memory operand, the current define_insn_and_split unintentionally
|
||||
clobbers it before reading the highpart.
|
||||
|
||||
Hence, for the testcase, the incorrectly generated code looks like:
|
||||
|
||||
salq $4, %rdi // calculate address
|
||||
movq WHIRL_S+8(%rdi), %rdi // accidentally clobber addr
|
||||
movq WHIRL_S(%rdi), %rbp // load (wrong) lowpart
|
||||
|
||||
Traditionally, the textbook way to fix this would be to add an
|
||||
explicit early clobber to the instruction's constraints.
|
||||
|
||||
(define_insn_and_split "<insn>32di2_doubleword"
|
||||
- [(set (match_operand:DI 0 "register_operand" "=r,r,r")
|
||||
+ [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
|
||||
(any_rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,r,o")
|
||||
(const_int 32)))]
|
||||
|
||||
but unfortunately this currently generates significantly worse code,
|
||||
due to a strange choice of reloads (effectively memcpy), which ends up
|
||||
looking like:
|
||||
|
||||
salq $4, %rdi // calculate address
|
||||
movdqa WHIRL_S(%rdi), %xmm0 // load the double word in SSE reg.
|
||||
movaps %xmm0, -16(%rsp) // store the SSE reg back to the stack
|
||||
movq -8(%rsp), %rdi // load highpart
|
||||
movq -16(%rsp), %rbp // load lowpart
|
||||
|
||||
Note that reload's "&" doesn't distinguish between the memory being
|
||||
early clobbered, vs the registers used in an addressing mode being
|
||||
early clobbered.
|
||||
|
||||
The fix proposed in this patch is to remove the third alternative, that
|
||||
allowed offsetable memory as an operand, forcing reload to place the
|
||||
operand into a register before the rotation. This results in:
|
||||
|
||||
salq $4, %rdi
|
||||
movq WHIRL_S(%rdi), %rax
|
||||
movq WHIRL_S+8(%rdi), %rdi
|
||||
movq %rax, %rbp
|
||||
|
||||
I believe there's a more advanced solution, by swapping the order of
|
||||
the loads (if first destination register is mentioned in the address),
|
||||
or inserting a lea insn (if both destination registers are mentioned
|
||||
in the address), but this fix is a minimal "safe" solution, that
|
||||
should hopefully be suitable for backporting.
|
||||
|
||||
2023-08-03 Roger Sayle <roger@nextmovesoftware.com>
|
||||
|
||||
gcc/ChangeLog
|
||||
PR target/110792
|
||||
* config/i386/i386.md (<any_rotate>ti3): For rotations by 64 bits
|
||||
place operand in a register before gen_<insn>64ti2_doubleword.
|
||||
(<any_rotate>di3): Likewise, for rotations by 32 bits, place
|
||||
operand in a register before gen_<insn>32di2_doubleword.
|
||||
(<any_rotate>32di2_doubleword): Constrain operand to be in register.
|
||||
(<any_rotate>64ti2_doubleword): Likewise.
|
||||
|
||||
gcc/testsuite/ChangeLog
|
||||
PR target/110792
|
||||
* g++.target/i386/pr110792.C: New 32-bit C++ test case.
|
||||
* gcc.target/i386/pr110792.c: New 64-bit C test case.
|
||||
|
||||
(cherry picked from commit 790c1f60a5662b16eb19eb4b81922995863c7571)
|
||||
---
|
||||
gcc/config/i386/i386.md | 18 ++++++++++++------
|
||||
gcc/testsuite/g++.target/i386/pr110792.C | 16 ++++++++++++++++
|
||||
gcc/testsuite/gcc.target/i386/pr110792.c | 18 ++++++++++++++++++
|
||||
3 files changed, 46 insertions(+), 6 deletions(-)
|
||||
create mode 100644 gcc/testsuite/g++.target/i386/pr110792.C
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/pr110792.c
|
||||
|
||||
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
|
||||
index f3a3305..a71e837 100644
|
||||
--- a/gcc/config/i386/i386.md
|
||||
+++ b/gcc/config/i386/i386.md
|
||||
@@ -14359,7 +14359,10 @@
|
||||
emit_insn (gen_ix86_<insn>ti3_doubleword
|
||||
(operands[0], operands[1], operands[2]));
|
||||
else if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) == 64)
|
||||
- emit_insn (gen_<insn>64ti2_doubleword (operands[0], operands[1]));
|
||||
+ {
|
||||
+ operands[1] = force_reg (TImode, operands[1]);
|
||||
+ emit_insn (gen_<insn>64ti2_doubleword (operands[0], operands[1]));
|
||||
+ }
|
||||
else
|
||||
{
|
||||
rtx amount = force_reg (QImode, operands[2]);
|
||||
@@ -14394,7 +14397,10 @@
|
||||
emit_insn (gen_ix86_<insn>di3_doubleword
|
||||
(operands[0], operands[1], operands[2]));
|
||||
else if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) == 32)
|
||||
- emit_insn (gen_<insn>32di2_doubleword (operands[0], operands[1]));
|
||||
+ {
|
||||
+ operands[1] = force_reg (DImode, operands[1]);
|
||||
+ emit_insn (gen_<insn>32di2_doubleword (operands[0], operands[1]));
|
||||
+ }
|
||||
else
|
||||
FAIL;
|
||||
|
||||
@@ -14562,8 +14568,8 @@
|
||||
})
|
||||
|
||||
(define_insn_and_split "<insn>32di2_doubleword"
|
||||
- [(set (match_operand:DI 0 "register_operand" "=r,r,r")
|
||||
- (any_rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,r,o")
|
||||
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
|
||||
+ (any_rotate:DI (match_operand:DI 1 "register_operand" "0,r")
|
||||
(const_int 32)))]
|
||||
"!TARGET_64BIT"
|
||||
"#"
|
||||
@@ -14580,8 +14586,8 @@
|
||||
})
|
||||
|
||||
(define_insn_and_split "<insn>64ti2_doubleword"
|
||||
- [(set (match_operand:TI 0 "register_operand" "=r,r,r")
|
||||
- (any_rotate:TI (match_operand:TI 1 "nonimmediate_operand" "0,r,o")
|
||||
+ [(set (match_operand:TI 0 "register_operand" "=r,r")
|
||||
+ (any_rotate:TI (match_operand:TI 1 "register_operand" "0,r")
|
||||
(const_int 64)))]
|
||||
"TARGET_64BIT"
|
||||
"#"
|
||||
diff --git a/gcc/testsuite/g++.target/i386/pr110792.C b/gcc/testsuite/g++.target/i386/pr110792.C
|
||||
new file mode 100644
|
||||
index 0000000..ce21a7a
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/g++.target/i386/pr110792.C
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* { dg-do compile { target ia32 } } */
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+template <int ROT, typename T>
|
||||
+inline T rotr(T input)
|
||||
+{
|
||||
+ return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
|
||||
+}
|
||||
+
|
||||
+unsigned long long WHIRL_S[256] = {0x18186018C07830D8};
|
||||
+unsigned long long whirl(unsigned char x0)
|
||||
+{
|
||||
+ const unsigned long long s4 = WHIRL_S[x0&0xFF];
|
||||
+ return rotr<32>(s4);
|
||||
+}
|
||||
+/* { dg-final { scan-assembler-not "movl\tWHIRL_S\\+4\\(,%eax,8\\), %eax" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/pr110792.c b/gcc/testsuite/gcc.target/i386/pr110792.c
|
||||
new file mode 100644
|
||||
index 0000000..b65125c
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/pr110792.c
|
||||
@@ -0,0 +1,18 @@
|
||||
+/* { dg-do compile { target int128 } } */
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+static inline unsigned __int128 rotr(unsigned __int128 input)
|
||||
+{
|
||||
+ return ((input >> 64) | (input << (64)));
|
||||
+}
|
||||
+
|
||||
+unsigned __int128 WHIRL_S[256] = {((__int128)0x18186018C07830D8) << 64 |0x18186018C07830D8};
|
||||
+unsigned __int128 whirl(unsigned char x0)
|
||||
+{
|
||||
+ register int t __asm("rdi") = x0&0xFF;
|
||||
+ const unsigned __int128 s4 = WHIRL_S[t];
|
||||
+ register unsigned __int128 tt __asm("rdi") = rotr(s4);
|
||||
+ asm("":::"memory");
|
||||
+ return tt;
|
||||
+}
|
||||
+/* { dg-final { scan-assembler-not "movq\tWHIRL_S\\+8\\(%rdi\\), %rdi" } } */
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001
|
||||
From: Jingyun Hua <huajingyun@loongson.cn>
|
||||
Date: Mon, 7 Aug 2023 15:25:58 +0800
|
||||
Subject: [PATCH] loongarch disable multilib support
|
||||
|
||||
Signed-off-by: Jingyun Hua <huajingyun@loongson.cn>
|
||||
---
|
||||
gcc/config/loongarch/linux.h | 10 +---------
|
||||
gcc/config/loongarch/t-linux | 18 +++---------------
|
||||
3 files changed, 5 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/loongarch/linux.h b/gcc/config/loongarch/linux.h
|
||||
index 9059d2441..23eaff0cc 100644
|
||||
--- a/gcc/config/loongarch/linux.h
|
||||
+++ b/gcc/config/loongarch/linux.h
|
||||
@@ -22,15 +22,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
* can work in a multilib environment. */
|
||||
|
||||
#if defined(LA_DISABLE_MULTILIB) && defined(LA_DISABLE_MULTIARCH)
|
||||
-
|
||||
- #if DEFAULT_ABI_BASE == ABI_BASE_LP64D
|
||||
- #define ABI_LIBDIR "lib64"
|
||||
- #elif DEFAULT_ABI_BASE == ABI_BASE_LP64F
|
||||
- #define ABI_LIBDIR "lib64/f32"
|
||||
- #elif DEFAULT_ABI_BASE == ABI_BASE_LP64S
|
||||
- #define ABI_LIBDIR "lib64/sf"
|
||||
- #endif
|
||||
-
|
||||
+ #define ABI_LIBDIR "lib"
|
||||
#endif
|
||||
|
||||
#ifndef ABI_LIBDIR
|
||||
diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux
|
||||
index e40da1792..f72c6e878 100644
|
||||
--- a/gcc/config/loongarch/t-linux
|
||||
+++ b/gcc/config/loongarch/t-linux
|
||||
@@ -36,18 +36,6 @@ else
|
||||
endif
|
||||
|
||||
# Don't define MULTILIB_OSDIRNAMES if multilib is disabled.
|
||||
-ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),)
|
||||
-
|
||||
- MULTILIB_OSDIRNAMES = \
|
||||
- mabi.lp64d=../lib64$\
|
||||
- $(call if_multiarch,:loongarch64-linux-gnu)
|
||||
-
|
||||
- MULTILIB_OSDIRNAMES += \
|
||||
- mabi.lp64f=../lib64/f32$\
|
||||
- $(call if_multiarch,:loongarch64-linux-gnuf32)
|
||||
-
|
||||
- MULTILIB_OSDIRNAMES += \
|
||||
- mabi.lp64s=../lib64/sf$\
|
||||
- $(call if_multiarch,:loongarch64-linux-gnusf)
|
||||
-
|
||||
-endif
|
||||
+ MULTILIB_OSDIRNAMES = mabi.lp64d=../lib
|
||||
+ MULTILIB_OSDIRNAMES += mabi.lp64f=../lib
|
||||
+ MULTILIB_OSDIRNAMES += mabi.lp64s=../lib
|
||||
--
|
||||
2.41.0
|
||||
|
||||
+42
-58
@@ -24,8 +24,8 @@ CBUILDROOT="/"
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname=gcc-aarch64
|
||||
pkgver=13.2.1_git20240309
|
||||
# i.e. 13.2.1, must match gcc/BASE-VER
|
||||
pkgver=13.1.1_git20230624
|
||||
# i.e. 13.1.1, must match gcc/BASE-VER
|
||||
_pkgbase="${pkgver%%_git*}"
|
||||
# date component from snapshots
|
||||
_pkgsnap="${pkgver##*_git}"
|
||||
@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname=gcc-aarch64
|
||||
pkgrel=0
|
||||
pkgrel=2
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="https://gcc.gnu.org"
|
||||
arch="x86_64"
|
||||
@@ -46,7 +46,6 @@ makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-
|
||||
subpackages="g++-aarch64:gpp libstdc++-dev-aarch64:libcxx_dev"
|
||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
|
||||
replaces="libstdc++ binutils"
|
||||
options="!strip"
|
||||
|
||||
: "${LANG_CXX:=true}"
|
||||
: "${LANG_D:=true}"
|
||||
@@ -144,7 +143,7 @@ case "$CARCH" in
|
||||
# GDC hasn't been ported to PowerPC
|
||||
# See libphobos/configure.tgt in GCC sources for supported targets
|
||||
# riscv fails with: error: static assert "unimplemented"
|
||||
ppc64le|riscv64|loongarch64) LANG_D=false ;;
|
||||
ppc64le|riscv64) LANG_D=false ;;
|
||||
# GDC does currently not work on 32-bit musl architectures.
|
||||
# This is a known upstream issue.
|
||||
# See: https://github.com/dlang/druntime/pull/3383
|
||||
@@ -156,7 +155,6 @@ case "$CTARGET_ARCH" in
|
||||
arm*) _libitm=false ;;
|
||||
mips*) _libitm=false ;;
|
||||
riscv64) _libitm=false ;;
|
||||
loongarch64) _libitm=false ;;
|
||||
esac
|
||||
|
||||
# Internal libffi fails to build on MIPS at the moment, need to
|
||||
@@ -164,7 +162,6 @@ esac
|
||||
# the internal libffi.
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) LANG_GO=false ;;
|
||||
loongarch64) LANG_GO=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
@@ -189,11 +186,6 @@ riscv64)
|
||||
LANG_ADA=false;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
loongarch64)
|
||||
LANG_ADA=false;;
|
||||
esac
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
@@ -275,15 +267,8 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${
|
||||
0031-druntime-link-against-libucontext-on-all-platforms.patch
|
||||
0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||
0033-libphobos-do-not-use-LFS64-symbols.patch
|
||||
0034-libgo-fix-lfs64-use.patch
|
||||
0036-PR110792-Early-clobber-issues-with-rot32di2-on-i386.patch
|
||||
0037-loongarch-disable-multilib-support.patch
|
||||
"
|
||||
|
||||
# secfixes:
|
||||
# 13.2.1_git20231014-r0:
|
||||
# - CVE-2023-4039
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
|
||||
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||
@@ -337,7 +322,6 @@ build() {
|
||||
i586-*-*-*) _arch_configure="--with-arch=pentium-m --with-fpmath=sse --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
riscv64-*-*-*) _arch_configure="--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic";;
|
||||
loongarch64-*-*-*) _arch_configure="--with-arch=loongarch64 --with-abi=lp64d";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
@@ -442,7 +426,6 @@ package() {
|
||||
make -j1 DESTDIR="$pkgdir" install
|
||||
|
||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
|
||||
|
||||
if $LANG_JIT; then
|
||||
make -C "$_builddir"/libgccjit-build/gcc DESTDIR="$pkgdir" jit.install-common
|
||||
@@ -693,6 +676,10 @@ go() {
|
||||
depends="gcc=$_gccrel libgo=$_gccrel !go"
|
||||
install="$pkgname-go.post-install"
|
||||
|
||||
# See https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E
|
||||
provides="go-bootstrap"
|
||||
provider_priority=1 # lowest, see community/go
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
@@ -793,41 +780,38 @@ gdb() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
2d1e0374ebdee526f0549319fc9c364968c52a0d4aaa16759f00453cb083fe58d8f463c47d97f3bb74a0a92e251989eb75a50ee5800b4569978c72d25446b44e gcc-13-20240309.tar.xz
|
||||
1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch
|
||||
163f282455b6a4df33f011bcd8b0440566ba0ffaeeab30d8ac52d39948980a56881ca0eff60687129d59556389a58b9d64e7768750bd70b1fe0fedbc9fc30dc2 0002-gcc-poison-system-directories.patch
|
||||
3f24bb6a50d3c45b71ea05590e32fe3e69b91377ab185352891d5035c76ed193117c6d0b314a4c364bcf136b9a9dd5c926d6c7c30ab436976c121ebfea8d3ddd 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||
17a2993027d3ddf8595952ebcae425695ddc7b1cf73b384d2e55fddecb9cbf3f6482860a502ff69b14075e12badf27300fd3039f3a9005e851fd8d121d258c2b 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
444550e55491ff89fe8cbbb4b73d017c9c147cdce1ad5c0561fe7d6ab3834515a814c7676c408cfeec18e1aaace27b3c26a2ffe4a75042285df5124976c38672 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
5a5f57e4e45745bb4d9d63d7d410fe9dd56ce12dbd70c376dd45015909307faf02391e75368e4e7404591614a874cee41b20652cf27be234765d6db97ceb4e7e 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
3a2b22388398a93dae7787e794cd580b9c577326f286241e086120c1fcfdd9228c2e00407088ebb163fb1acc21722c199071343551c989a958dc3c845b15132d 0007-Enable-Wtrampolines-by-default.patch
|
||||
7535de1c552544e3a51cbb00b5e08ac59edbf3bdcfce2a63b9f319fada3f3676f47e3a00c75d91bcefd14500555ea0844f18c130ff46b20f416ea76071e5af39 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
9d43f844fad0ac6e1c35a2b6f461f9278ae09e468f2c9ae8adc43accbe6934994aa10d3a433644d1393a4a76e3caed69e3191db7f3c0c24b4e7a0a0a0cbac3f1 0012-libgcc_s.patch
|
||||
b2c4921c5eef33ee43a92ab5ec7f09d5d3adb49a2416595001e6376ffdf652ef9d0dc21778c3a86e45334290dbe467a4e891ed34a6522e0c72f746def22e8663 0013-nopie.patch
|
||||
0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch
|
||||
00097c7106625ccf02149a757366f434c48f2abe824bb8b4bf067d29308889cb6039a5e5b2d3bd2683617693b47707d549252c56eea6bc3cdc2450a8d14f46a7 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch
|
||||
0841acbce81250f8cb140a75ff62958dfcab3bed792822baf1fe4193dd62633648343f4b66df886c12338eed88a98e591b968131416460f9f0274046019bb8ef 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
589d538bdf692559e475e53c79869734dede0eb15228cab9ca901c9db81b0e78a0e532b20dfb05ca584ea19ff4bedd83e139ddca912a26b446c5eb6905180536 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch
|
||||
a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch
|
||||
f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch
|
||||
44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch
|
||||
e0763083c31485e8ac0b3724376a28af01bb6f50e1a054780b61886e4e3de2a35d127e6e353eb8d8729964ada9b5751bf05bdd51df539667008216db38f228a3 0023-riscv-disable-multilib-support.patch
|
||||
ab88a2f63e3545bbc36537aa9a86f2c6c35e41bbf702d6e13743a405cdac4f901eed5737189b780da96647fea9f5d863fdc76373f25a00064106dcb5514d6d87 0024-always-build-libgcc_eh.a.patch
|
||||
8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch
|
||||
30369bea84020c32d514196ba3adb3d09d2d0359af5550bd3f9719aa357e44b2f695623c1d2a99416e120dc86896c196c5dd4f638183dced4799604137385367 0026-ada-musl-support-fixes.patch
|
||||
3f9a406d7d2ce34951215ffbcadb49a45e55ad5c24ab9097c0e5e92383e43b876872ccd2a7e7def2833ab204975ee5733f8bcf90934db9fa9c4f6f56c62081f6 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||
720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||
2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||
58e8415612e1042329ad114471852c19f6bf15bf3bfd7cd81ceeafa75778bcc28410a01071a7c8cbf12b8f549acd85723215772813deedb8f266e28b9e01a353 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
d47b559075f40d526235f47b91da1d0cf6bfe6c5b7311bbfe08af9dd6e8f27e6c7cd82e3b2d529aab0536246fc56e2d42c089b22cacb0e7f09ca4a9d07556994 0031-druntime-link-against-libucontext-on-all-platforms.patch
|
||||
b325035cb7122d79c6b42ca6d3fc9e02319ed2f7cddb0639dff25d2798d2ce63812cd623462cdf95e21c9ffbf2412193f8b9fc89a4c36fa5a6a041661ac7399d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||
c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch
|
||||
c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch
|
||||
cc1e10ac6e72db816f09325e301103109cc212a6f3de3ce0b9b038d149233c467319d203941695dbf3d7b9e2dcbbcd17609cdb056e831fcc323cd592423882d8 0036-PR110792-Early-clobber-issues-with-rot32di2-on-i386.patch
|
||||
d834f5f95f4ebe70ec0af0748c8632c99a4f57b69dc14db1a38becdfcb03406b32febf39f772f37bd145538147099fa7433edce845e14ee77cd8f38fd9774fc1 0037-loongarch-disable-multilib-support.patch
|
||||
0732cc63e8677d5c7d07d5eee837bf95fbc63d8592511963d3e47b7af816d0f81ad8c0a234c31df003fcd37682badc18e63a6ffe78a8ba3744e289f5319535f7 gcc-13-20230624.tar.xz
|
||||
5738a25e510d47058ea7acf44f47292c365f74f60f75d600c3bdf79022a78e3c14c87648e23d3f44612833123ba1ae6776c8a6ea4371bf8c2cf31ea8296a0278 0001-posix_memalign.patch
|
||||
35cba990b41ba8fd2544404a0330ceddfbc7b63475f4ebb515552d5ec494d0099f0585240a36099431ae6dcaf9bd7674ca0224f0dd4310cd3597aabadedd1d07 0002-gcc-poison-system-directories.patch
|
||||
fa3b349be7e7f49c1d2192a84d6fc6b9f9b750381607711950d3ad5c867c677dac65dc2274fa4227aa6909d6b5e0fcc59b137254202035e930a2c6a0ba494e2f 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||
495b08b8b25f25f616fd68d205c23232d8307a35dae81f5d37e248ec704734e40618d5e3855f1cedeaa615b1d03e5a34089695faca9798d51a367a0e3bc59b78 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||
ee10b0b91e7b0a91a47b6708dd8a41c8f08a89f87a3eed57aed2ea3df5b7109a2a33741651a294a10f056c736beeb0be0fb6004c0517e8687a80bc33be50d8c9 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||
87dca73e398acf396ade55b8cd533d3e90889444c27069df9840a57d524d8f045781b4a38f9e0e52595a510049a0832a5067f6f0200df00fc51501316fa7c61b 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||
5eca632dbb3f709ee92ba89e062642cfcf854aa31426b8eca859432773bff4bffd35fa6a7418a760bed89a30a1f64e1de87b0353e9d332d8abc72c14e236e1ed 0007-Enable-Wtrampolines-by-default.patch
|
||||
d46546536564f76abcda3a54b0c159175aca7044542fdcdf1f08c46bfabff452e2ba7d535e9e5b04c9c595c3f865bf80bdece8aee4a0bc24baea4f2c94fcf0bb 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||
00ce50efdeb9a31cbd9ca2d2fa22cd27b1d972e96c01948bd9ae95aff7275e6bc894196ff871107c5feadb6cb832119127240f4539fda35d4326955babf5f510 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||
46a228b875f835fd1c2cae479f5e931cd2afc4124690ebb935ea49a3fc4ed46b69d4c76e18a1d7632283690e9d51fbcb90f478fc0b87d532dc095fcf067de7e6 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||
b2c5e2af8f6f50da5795de7fb94309149eb63b1dcc31d72147975702b751e7af0f89adbde7e359416a4ad7749c3d251e6c2b8b57c9a24c77e15c9ce4730d5e4a 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||
8c60c72a123d984452b57bc6a7d3dea3ab092e963d459d8a69a27384c8cf2d7e0e718d1dda2957b62cb2d0353dd851e57c3d1791f90adf6a32393b64846677d9 0012-libgcc_s.patch
|
||||
082a1dcca42899fc7c70616f0b73fc640fbaae8c4f08c960c71bd9f2cda57bf34a662f1f6327a6eb7e026ebe3414ee71303c3354687ad6c14068fdf37025f2e5 0013-nopie.patch
|
||||
ced25410c21b0bac351ef4a6c2d381f4e0a1c0f4043899bbed2f10ad5f5c39ec6ff4cde07c62d486643a89421c28266798234c318a09a029bc1a79d6adee1c0e 0014-ada-fix-shared-linking.patch
|
||||
f245428f57f1d59e353b3c1d745c7cb3987689d8ef3cb38e113f69750dca08ed76681ed72b2d5ee659d0d6c33179c4b12eb1d509c0baf185cc8c8549e0c09f8f 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||
4fd357f4f24899f742e19680db543647dea556e3144744ac990474ee01f32d28e1724f6f56dac4ba2ce2491aae88ffea16b6f7c33b74132deb2f932d550f119a 0016-add-fortify-headers-paths.patch
|
||||
dd028aeb2e8a32157a419f4450fa70a96522ce2de88febfac374d11f1340660584c7547eaa287715f585289aa313b17918a52b64bc758778833f387c0e3c3506 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||
47eb31a354177f4abd699e6bcb29ba688eeb51511b27969a88e25a0153108023ceb3d821fe3ffca0491dafec5341a3186b813519b9d043450eeec990bfc7d7d4 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||
b77e98c45d28e42ec9f9842b5aab3fd69b8696ea69376a049e7792bd5cef98c730ab5a458406084fb7be2f3c361962c407b72dde3dd27857f55433f3fc749b3c 0019-aarch64-disable-multilib-support.patch
|
||||
79b3a8ea1fe452a2f8fdf2b15b75754ed00f2993120596e7870622d4d608edf8c3ddc31181dafa40815fdfe277a10d539830484f09a57c3b0ee5677785224e04 0020-s390x-disable-multilib-support.patch
|
||||
d250d791dd9d5190eee9fc54326830b0e19d9986e801d0576199808c6e211f5137ce71b92e0dbfb1ab910c22311b4b48dbbd63fa9390c2e2491dce80062e5f51 0021-ppc64-le-disable-multilib-support.patch
|
||||
51206e8132e93bb79f891f0f69461982435fa4212b1bf91c75b9bb9ee7fd25106d53fad21470f4706b5d258fbe1715ef7524d6c2bb94813b7d4a48d949a176f7 0022-x86_64-disable-multilib-support.patch
|
||||
b774c6a750077a546d1cef0b31812d5d68cf64a8abdd47a30180fb6f3a848941e7986f4a587da9a6ab034e5083068723620319e3f821f0db3ff66dc4c33faf06 0023-riscv-disable-multilib-support.patch
|
||||
1b6ed17c5798d8fd80826188c35232d0f90843d6cba060ea784fdfa5b5cb2490ac4507ce9802f7f6f50ccb7fe5db34cd6860c256e9da311710c95b1d4870fc1c 0024-always-build-libgcc_eh.a.patch
|
||||
4b9f4446254720e692478fb016798b44c6ebc021816dff49fe32b6eac4f4da091c47adf46f040df603ee74f4986a832257eaad4d3c594b6d50a23e447c755586 0025-ada-libgnarl-compatibility-for-musl.patch
|
||||
fbc903ca64f8a17ea8ffce4cb882dd53713dee3b24b729ab81741a8133802b9c95619596829706fcfe26350a33e8558dc9b9edf92802170041c3f4f831b2ff2c 0026-ada-musl-support-fixes.patch
|
||||
8d3f37bd75a9fea17c277b380aa943ad44989c65e6aabbf09f9c3f35acb1f048dbe361bc788b6ef2133dee3b9f646c56637811fe33171a50a2a024fe9d78e6ef 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||
04a07053c82842f1ec5ec58723c0801659f8174318e32d1e966411422bfa9665f259ba9025d030e0e298608d6eeff423cbe5ed9981717d691a49de8806ead7aa 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||
3398fcb9273e5d76006b2c2c0215cf9ead757faa4751f7a55cf7bc687894ac38da47e76700860ea3c7f8feb18361e4ce8ce6b16a365fdfe4c61032bd53da56e7 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||
ac86593db92aca836a91dd7ad3060e6c1d92b1b7c685a6fa1b51281f76b091fb07058d8d53f16f7df18eb148fde0526723c6cf6fc4c38471399dc7fde8892307 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||
e2f8901bf30494563373a24cb632a251056cb99dbb9cce789817f12016da323f702d981ce4ba9d7d52eefc33f257568509d391776fd022b012e589b43857c696 0031-druntime-link-against-libucontext-on-all-platforms.patch
|
||||
434d3739d7e6ecc5017c29711c3a7c207e7c673d2a535607dea78a5a5d265d8efb74b7f726c18efc13e9c80c29385ce1b4e3b53c7d1c9d55bb1b8a217425f3ea 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||
8a56a2a1d1c60894ab429ecc8fa3ddbfdd6c7e3cc9f764b4f260695a2cd54442668e9b4c7ba62d833e5dbc05548586aefc344caf9ea87cdf6de60ce3c30f9da9 0033-libphobos-do-not-use-LFS64-symbols.patch
|
||||
"
|
||||
@@ -0,0 +1,42 @@
|
||||
From 75e758609803afe6ced6cd7799b4159f3848a8d5 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/33] 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
|
||||
--- a/gcc/config/i386/pmm_malloc.h
|
||||
+++ b/gcc/config/i386/pmm_malloc.h
|
||||
@@ -27,12 +27,13 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
|
||||
- may not be visible. */
|
||||
+ may not be visible and we can't pollute the namespace either. */
|
||||
#ifndef __cplusplus
|
||||
-extern int posix_memalign (void **, size_t, size_t);
|
||||
+extern int _mm_posix_memalign (void **, size_t, size_t)
|
||||
#else
|
||||
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
||||
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
|
||||
#endif
|
||||
+__asm__("posix_memalign");
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t __size, size_t __alignment)
|
||||
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
|
||||
return malloc (__size);
|
||||
if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
|
||||
__alignment = sizeof (void *);
|
||||
- if (posix_memalign (&__ptr, __alignment, __size) == 0)
|
||||
+ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
|
||||
return __ptr;
|
||||
else
|
||||
return NULL;
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
From 447c2a21d1fa8c2c3b216102a808834d86f12104 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/33] gcc: poison-system-directories
|
||||
|
||||
Add /sw/include and /opt/include based on the original
|
||||
zecke-no-host-includes.patch patch. The original patch checked for
|
||||
/usr/include, /sw/include and /opt/include and then triggered a failure and
|
||||
aborted.
|
||||
|
||||
Instead, we add the two missing items to the current scan. If the user
|
||||
wants this to be a failure, they can add "-Werror=poison-system-directories".
|
||||
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Pending
|
||||
---
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/configure | 16 ++++++++++++++++
|
||||
gcc/configure.ac | 10 ++++++++++
|
||||
gcc/doc/invoke.texi | 9 +++++++++
|
||||
gcc/gcc.cc | 2 ++
|
||||
gcc/incpath.cc | 21 +++++++++++++++++++++
|
||||
7 files changed, 68 insertions(+)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 862c474d3c8..64c4277c991 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -711,6 +711,10 @@ Wreturn-local-addr
|
||||
Common Var(warn_return_local_addr) Init(1) Warning
|
||||
Warn about returning a pointer/reference to a local or temporary variable.
|
||||
|
||||
+Wpoison-system-directories
|
||||
+Common Var(flag_poison_system_directories) Init(1) Warning
|
||||
+Warn for -I and -L options using system directories if cross compiling
|
||||
+
|
||||
Wshadow
|
||||
Common Var(warn_shadow) Warning
|
||||
Warn when one variable shadows another. Same as -Wshadow=global.
|
||||
diff --git a/gcc/config.in b/gcc/config.in
|
||||
index 4cad077bfbe..0679fbbf4c6 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -236,6 +236,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to warn for use of native system header directories */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if you want all operations on RTL (the basic data structure of the
|
||||
optimizer and back end) to be checked for dynamic type safety at runtime.
|
||||
This is quite expensive. */
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index c7b26d1927d..8c46369f73f 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_link_serialization
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1788,6 +1789,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
+ --enable-poison-system-directories
|
||||
+ warn for use of native system header directories
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-poison-system-directories was given.
|
||||
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||
+ enableval=$enable_poison_system_directories;
|
||||
+else
|
||||
+ enable_poison_system_directories=no
|
||||
+fi
|
||||
+
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 09082e8ccae..5504bf6eb01 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
+AC_ARG_ENABLE([poison-system-directories],
|
||||
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||
+ [warn for use of native system header directories]),,
|
||||
+ [enable_poison_system_directories=no])
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||
+ [1],
|
||||
+ [Define to warn for use of native system header directories])
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index b61ecfc1bc8..b290908679e 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
|
||||
@@ -8424,6 +8425,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
|
||||
+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.
|
||||
+
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
@item -Wfloat-equal
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index 16bb07f2cdc..33b56e721d2 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -1146,6 +1146,8 @@ proper position among the other output files. */
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
|
||||
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
|
||||
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
|
||||
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
|
||||
index 4d44321183f..0f3f071b44c 100644
|
||||
--- a/gcc/incpath.cc
|
||||
+++ b/gcc/incpath.cc
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[INC_QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
|
||||
+ || (!strncmp (p->name, "/sw/include", 11))
|
||||
+ || (!strncmp (p->name, "/opt/include", 12)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From b5c378c4c1e71b2dd8b4616d8f61530ee1a3ac98 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/33] specs: turn on -Wl,-z,now by default
|
||||
|
||||
Previously, we also used to turn on -z relro here, but we now build
|
||||
binutils with --enable-relro, which is functionally equivalent.
|
||||
|
||||
Binutils does not appear to have a similar option for enabling -z
|
||||
now by default.
|
||||
---
|
||||
gcc/doc/invoke.texi | 3 +++
|
||||
gcc/gcc.cc | 1 +
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index b290908679e..cb34e6d40c9 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -17959,6 +17959,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}
|
||||
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
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
|
||||
"%{flto|flto=*:%<fcompare-debug*} \
|
||||
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
+ "-z now " \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
||||
%{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From bb3ef1f5acfde9658c922d0aef9283fe60328c33 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/33] 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 ++++
|
||||
gcc/doc/invoke.texi | 6 ++++++
|
||||
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
|
||||
--- a/gcc/c-family/c-cppbuiltin.cc
|
||||
+++ b/gcc/c-family/c-cppbuiltin.cc
|
||||
@@ -1546,6 +1546,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
+ /* Fortify Source enabled by default for optimization levels > 0 */
|
||||
+ if (optimize)
|
||||
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
|
||||
+
|
||||
/* Misc. */
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index cb34e6d40c9..7f1aa660285 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -11866,6 +11866,12 @@ also turns on the following optimization flags:
|
||||
Please note the warning under @option{-fgcse} about
|
||||
invoking @option{-O2} on programs that use computed gotos.
|
||||
|
||||
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
|
||||
+set by default, and is activated when @option{-O} is set to 2 or higher.
|
||||
+This enables additional compile-time and run-time checks for several libc
|
||||
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
|
||||
+@option{-D_FORTIFY_SOURCE=0}.
|
||||
+
|
||||
@opindex O3
|
||||
@item -O3
|
||||
Optimize yet more. @option{-O3} turns on all optimizations specified
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
From 0727ad9e4a458d090be6fb0cfbe334d8496cd5e0 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/33] On linux targets pass --as-needed by default to the
|
||||
linker, but always link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
---
|
||||
gcc/config/aarch64/aarch64-linux.h | 1 +
|
||||
gcc/config/alpha/linux-elf.h | 2 +-
|
||||
gcc/config/arm/linux-elf.h | 1 +
|
||||
gcc/config/gnu-user.h | 6 +++---
|
||||
gcc/config/i386/gnu-user.h | 2 +-
|
||||
gcc/config/i386/gnu-user64.h | 1 +
|
||||
gcc/config/ia64/linux.h | 2 +-
|
||||
gcc/config/mips/gnu-user.h | 1 +
|
||||
gcc/config/riscv/linux.h | 1 +
|
||||
gcc/config/rs6000/linux64.h | 4 ++--
|
||||
gcc/config/rs6000/sysv4.h | 2 +-
|
||||
gcc/config/s390/linux.h | 2 +-
|
||||
gcc/config/sparc/linux.h | 2 +-
|
||||
gcc/gcc.cc | 28 ++++++++++++++++++++--------
|
||||
14 files changed, 36 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
|
||||
index 4277f03da2a..b131983a546 100644
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
||||
+ --as-needed \
|
||||
%{static:-Bstatic} \
|
||||
%{shared:-shared} \
|
||||
%{symbolic:-Bsymbolic} \
|
||||
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
|
||||
index 03f783f2ad1..d946e700dda 100644
|
||||
--- a/gcc/config/alpha/linux-elf.h
|
||||
+++ b/gcc/config/alpha/linux-elf.h
|
||||
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
|
||||
|
||||
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
|
||||
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
|
||||
%{O*:-O3} %{!O*:-O1} \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
|
||||
index 7b7b7cbbe14..49c050c6f2c 100644
|
||||
--- a/gcc/config/arm/linux-elf.h
|
||||
+++ b/gcc/config/arm/linux-elf.h
|
||||
@@ -70,6 +70,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
|
||||
-X \
|
||||
+ --as-needed \
|
||||
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index eda8010b133..b26b17f2f2a 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
|
||||
"%{static-libasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBHWASAN_EARLY_SPEC
|
||||
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
|
||||
"%{static-libhwasan:%{!shared:" \
|
||||
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
|
||||
"%{static-libtsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
|
||||
"%{static-liblsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#endif
|
||||
|
||||
#undef TARGET_F951_OPTIONS
|
||||
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
|
||||
index a79b739089d..e0752673dff 100644
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
{ "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
|
||||
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
|
||||
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{!static-pie: \
|
||||
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
|
||||
index 3b63b99acf6..759bf0db86f 100644
|
||||
--- a/gcc/config/i386/gnu-user64.h
|
||||
+++ b/gcc/config/i386/gnu-user64.h
|
||||
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
|
||||
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
|
||||
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
|
||||
+ --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
|
||||
index 5dfd428aa17..02656dad7fc 100644
|
||||
--- a/gcc/config/ia64/linux.h
|
||||
+++ b/gcc/config/ia64/linux.h
|
||||
@@ -58,7 +58,7 @@ do { \
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "\
|
||||
+#define LINK_SPEC " --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
|
||||
index a4e5380b589..3cc61bce69f 100644
|
||||
--- a/gcc/config/mips/gnu-user.h
|
||||
+++ b/gcc/config/mips/gnu-user.h
|
||||
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
#undef GNU_USER_TARGET_LINK_SPEC
|
||||
#define GNU_USER_TARGET_LINK_SPEC "\
|
||||
%{G*} %{EB} %{EL} %{mips*} %{shared} \
|
||||
+ -as-needed \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
|
||||
index 3e625e0f867..f8c2c351e5a 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
|
||||
"%{mabi=ilp32:_ilp32}"
|
||||
|
||||
#define LINK_SPEC "\
|
||||
+-as-needed \
|
||||
-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
|
||||
%{mno-relax:--no-relax} \
|
||||
%{mbig-endian:-EB} \
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index 9e457033d11..08016bf224d 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -377,13 +377,13 @@ extern int dot_symbols;
|
||||
" -m elf64ppc")
|
||||
#endif
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
|
||||
%{!static-pie: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
|
||||
%(link_os_extra_spec32)"
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
|
||||
%{!static-pie: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
|
||||
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
|
||||
index ae932fc22f0..c8ff0c6dc8e 100644
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
|
||||
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
#endif
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
|
||||
|
||||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 02aa1edaff8..64df5801134 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
||||
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
|
||||
index 0e33b3cac2c..c2f44546e62 100644
|
||||
--- a/gcc/config/sparc/linux.h
|
||||
+++ b/gcc/config/sparc/linux.h
|
||||
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
|
||||
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
|
||||
%{!mno-relax:%{!r:-relax}} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index f82fae23c22..da6417dd0d1 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -754,8 +754,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBASAN_EARLY_SPEC
|
||||
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
|
||||
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -lasan " \
|
||||
+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBASAN_LIBS
|
||||
#else
|
||||
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
|
||||
@@ -790,8 +793,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
|
||||
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -ltsan " \
|
||||
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
@@ -808,8 +814,11 @@ proper position among the other output files. */
|
||||
#ifdef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
|
||||
- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -llsan " \
|
||||
+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBLSAN_LIBS
|
||||
#else
|
||||
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
|
||||
@@ -824,8 +833,11 @@ proper position among the other output files. */
|
||||
#define STATIC_LIBUBSAN_LIBS \
|
||||
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
|
||||
- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -lubsan " \
|
||||
+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBUBSAN_LIBS
|
||||
#else
|
||||
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From dc3e2f629fe7f8df81c74162c66910339ec5d03d 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/33] 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
|
||||
--- 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
|
||||
of the destination region. Same as -Wformat-overflow=1.
|
||||
|
||||
Wformat-security
|
||||
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
Warn about possible security problems with format functions.
|
||||
|
||||
Wformat-signedness
|
||||
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
|
||||
Warn about zero-length formats.
|
||||
|
||||
Wformat=
|
||||
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
|
||||
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
|
||||
Warn about printf/scanf/strftime/strfmon format string anomalies.
|
||||
|
||||
Wformat-overflow=
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From d25c373cf839df0720f8d345b5ad55147030515a 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/33] 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
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers.
|
||||
|
||||
Wtrampolines
|
||||
-Common Var(warn_trampolines) Warning
|
||||
+Common Var(warn_trampolines) Init(1) Warning
|
||||
Warn whenever a trampoline is generated.
|
||||
|
||||
Wtrivial-auto-var-init
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From eb58983c3d3126caaab8ed174571b142a095c132 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/33] Disable ssp on -nostdlib, -nodefaultlibs and
|
||||
-ffreestanding Change the buffer size.
|
||||
|
||||
---
|
||||
gcc/gcc.cc | 8 +++++++-
|
||||
gcc/params.opt | 2 +-
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
||||
index da6417dd0d1..b5a6f200635 100644
|
||||
--- a/gcc/gcc.cc
|
||||
+++ b/gcc/gcc.cc
|
||||
@@ -983,6 +983,12 @@ proper position among the other output files. */
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
|
||||
#endif
|
||||
|
||||
+#ifdef ENABLE_DEFAULT_SSP
|
||||
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
|
||||
+#else
|
||||
+#define NO_SSP_SPEC ""
|
||||
+#endif
|
||||
+
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
|
||||
%{-version:--version}\
|
||||
%{-help=*:--help=%*}\
|
||||
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
|
||||
- %{fsyntax-only:-o %j} %{-param*}\
|
||||
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
|
||||
%{coverage:-fprofile-arcs -ftest-coverage}\
|
||||
%{fprofile-arcs|fprofile-generate*|coverage:\
|
||||
%{!fprofile-update=single:\
|
||||
diff --git a/gcc/params.opt b/gcc/params.opt
|
||||
index 823cdb2ff85..5b096899b40 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
|
||||
The maximum number of SSA_NAME assignments to follow in determining a value.
|
||||
|
||||
-param=ssp-buffer-size=
|
||||
-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
|
||||
+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
|
||||
The lower bound for a buffer to be considered for stack smashing protection.
|
||||
|
||||
-param=stack-clash-protection-guard-size=
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From 823afef2053ca4f79ac13f2b0f52b132282ee705 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/33] Ensure that msgfmt doesn't encounter problems during
|
||||
gcc bootstrapping.
|
||||
|
||||
Solves error messages like the following:
|
||||
|
||||
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
|
||||
|
||||
The libgcc_s.so used during build doesn't satisfy the needs of the
|
||||
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
|
||||
is used as a stand-alone application here, and what library it uses
|
||||
behind the scenes is of no concern to the gcc build process.
|
||||
Therefore, simply invoking it "as usual", i.e. without any special
|
||||
library path, will make it work as expected here.
|
||||
|
||||
2011-09-19 Martin von Gagern
|
||||
|
||||
References:
|
||||
https://bugs.gentoo.org/372377
|
||||
https://bugs.gentoo.org/295480
|
||||
---
|
||||
libstdc++-v3/po/Makefile.am | 1 +
|
||||
libstdc++-v3/po/Makefile.in | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
|
||||
index 12d34910830..61b13762b71 100644
|
||||
--- a/libstdc++-v3/po/Makefile.am
|
||||
+++ b/libstdc++-v3/po/Makefile.am
|
||||
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
|
||||
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
|
||||
index 8e93445acd2..d6ff06e5ddb 100644
|
||||
--- a/libstdc++-v3/po/Makefile.in
|
||||
+++ b/libstdc++-v3/po/Makefile.in
|
||||
@@ -561,6 +561,7 @@ uninstall-am:
|
||||
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 702cbba342eae468e79d9b42e366b9699c158402 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/33] 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
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/* Like asprintf but allocates memory without fail. This works like
|
||||
xmalloc. */
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 18f0ecbdab63b0ee590ef21650ac72879318a8be 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/33] 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
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From e350a47267790a1a624032a645425b4018433e0c 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/33] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386-expand.cc | 4 ++--
|
||||
libgcc/config/i386/cpuinfo.c | 6 +++---
|
||||
libgcc/config/i386/t-linux | 2 +-
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
|
||||
index 0d817fc3f3b..2e99db00db9 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,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
- /* Make it call __cpu_indicator_init in libgcc. */
|
||||
+ /* Make it call __cpu_indicator_init in libgcc.a. */
|
||||
tree call_expr, fndecl, type;
|
||||
type = build_function_type_list (integer_type_node, NULL_TREE);
|
||||
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
|
||||
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
|
||||
call_expr = build_call_expr (fndecl, 0);
|
||||
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
|
||||
}
|
||||
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
|
||||
index 50b6d8248a2..724ced402a1 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
|
||||
__cpu_features2);
|
||||
}
|
||||
|
||||
-#if defined SHARED && defined USE_ELF_SYMVER
|
||||
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
|
||||
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
|
||||
+#ifndef SHARED
|
||||
+int __cpu_indicator_init_local (void)
|
||||
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
|
||||
#endif
|
||||
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
|
||||
index 8506a635790..564296f788e 100644
|
||||
--- a/libgcc/config/i386/t-linux
|
||||
+++ b/libgcc/config/i386/t-linux
|
||||
@@ -3,5 +3,5 @@
|
||||
# t-slibgcc-elf-ver and t-linux
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
|
||||
|
||||
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
|
||||
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
|
||||
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From 6ed790bb2e5bf49d186885cad8fd7efc10d8fd36 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/33] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
gcc/configure.ac | 13 +++++++++++++
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 8c46369f73f..e59cbee1767 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -32268,6 +32268,33 @@ fi
|
||||
$as_echo "$gcc_cv_no_pie" >&6; }
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
|
||||
+$as_echo_n "checking for -nopie option... " >&6; }
|
||||
+if test "${gcc_cv_nopie+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+int main(void) {return 0;}
|
||||
+_ACEOF
|
||||
+if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
+ gcc_cv_nopie=yes
|
||||
+else
|
||||
+ gcc_cv_nopie=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+ LDFLAGS="$saved_LDFLAGS"
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
|
||||
+$as_echo "$gcc_cv_nopie" >&6; }
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 5504bf6eb01..57268319de1 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -7552,6 +7552,19 @@ AC_CACHE_CHECK([for -no-pie option],
|
||||
LDFLAGS="$saved_LDFLAGS"])
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ AC_CACHE_CHECK([for -nopie option],
|
||||
+ [gcc_cv_nopie],
|
||||
+ [saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ AC_LINK_IFELSE([int main(void) {return 0;}],
|
||||
+ [gcc_cv_nopie=yes],
|
||||
+ [gcc_cv_nopie=no])
|
||||
+ LDFLAGS="$saved_LDFLAGS"])
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
AC_SUBST([NO_PIE_FLAG])
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From c7398885b5c2cd91a3ad1a56fde272b719d17ff5 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/33] 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
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|
||||
|| defined (__NetBSD__) || defined (__OpenBSD__) \
|
||||
|| defined (__QNX__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|
||||
|
||||
#elif defined (__linux__) || defined (__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From c2861147eacede8c97dbb8d251f7d30ac2116481 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/33] 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
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -178,6 +178,7 @@ BUILD_EXPORTS = \
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
--
|
||||
2.41.0
|
||||
|
||||
Loaded 100 of 5060 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user