Compare commits

..
Author SHA1 Message Date
Dylan Van Assche 19ab7e6e65 temp/libssc: patch 103 threading
DO NOT MERGE
2025-12-05 19:43:07 +01:00
3973 changed files with 60704 additions and 372771 deletions

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
apk add git openssh-keygen grep curl
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0 $*"
fi
@@ -89,7 +89,7 @@ update_linux_next() {
git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.postmarketos.org/postmarketOS/pmaports.git
git fetch gitlab
git checkout --track gitlab/main
git checkout --track gitlab/master
for pkg in $PKGS; do
case "$pkg" in
+1 -1
View File
@@ -11,7 +11,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-pip make git
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/main
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/master
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
+21 -20
View File
@@ -1,4 +1,4 @@
image: registry.alpinelinux.org/img/alpine:3.23
image: alpine:latest
stages:
- build
- hardware tests
@@ -6,7 +6,7 @@ stages:
variables:
CI_TRON_TEMPLATE_PROJECT: &ci-tron-template-project postmarketOS/ci-common
CI_TRON_JOB_TEMPLATE_PROJECT_URL: $CI_SERVER_URL/$CI_TRON_TEMPLATE_PROJECT
CI_TRON_JOB_TEMPLATE_COMMIT: &ci-tron-template-commit 1c70e34b7a610cda1d7f048f6b50ca9c10f52995
CI_TRON_JOB_TEMPLATE_COMMIT: &ci-tron-template-commit 7c95b5f2d53533e8722abf57c73e558168e811f3
include:
- project: *ci-tron-template-project
@@ -68,33 +68,34 @@ build:
# Define here all the gitlab-ci snippets that could be common between the
# different packages
# Extends from this job if the target device needs a kernel and initramfs to
# boot. This will not work if your device uses boot images.
# Extends from this job if the the build job generates a kernel and initramfs
# artifact for your target device. This will not work if your device generates
# boot images.
.device-boot-flow-separate-artifacts:
variables:
CI_TRON_KERNEL__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/vmlinuz"
CI_TRON_KERNEL__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/${KERNEL_NAME}"
CI_TRON_INITRAMFS__INITRAMFS__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/initramfs"
# Extends from this job if the target device boots using fastboot and boot images
.device-boot-flow-fastboot-image:
variables:
CI_TRON_FASTBOOT__BOOT_IMAGE__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/boot.img"
# NOTE: For fastboot devices, we will need to use something like this
# .ci-tron-device-boot-flow-fastboot-image:
# variables:
# CI_TRON_FASTBOOT__BOOT_IMAGE: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/bootimg"
# Include all the devices that need and can to be tested
{% for device in devices_under_test %}
{% for device in devices_under_test if device.is_present_in_ci %}
prepare-{{ device.name }}:
stage: hardware tests
extends:
.pmos-ci-tron-build-boot-artifacts
{%- if device.has_kernel_variants %}
# Build all the boot artifacts for all the supported kernel variants in
# Let's build all the boot artifacts for all the supported kernels in
# different jobs, but hide them behind a single job name so as not to pollute
# the pipeline.
parallel:
matrix:
- KERNEL_VARIANT:
{%- for kernel in device.kernel_variants %}
{%- for kernel in device.kernels %}
- {{ kernel }}
{%- endfor %}
{%- endif %}
@@ -108,17 +109,19 @@ prepare-{{ device.name }}:
DEVICE_NAME: {{ device.name }}
# NOTE: All the packages that may influence testing should have an
# `install-if postmarketos-mkinitfs-hook-ci`, so no need to add them here
INSTALL_PACKAGES: {{ device.pkgname }} {% if device.has_kernel_variants %}{{ device.pkgname }}-kernel-${KERNEL_VARIANT} {% endif %}postmarketos-mkinitfs-hook-ci
INSTALL_PACKAGES: {{ device.pkgname }} {{ device.pkgname }}-kernel-${KERNEL_VARIANT} postmarketos-mkinitfs-hook-ci
.test-{{ device.name }}:
stage: hardware tests
extends:
- .pmos-ci-tron-initramfs-test
{%- if device.has_kernel_variants %}
# Test all the kernels in different jobs, but hide them behind a single
# Let's test all the kernels in different jobs, but hide them behind a single
# job name so as not to pollute the pipeline.
parallel:
matrix:
- KERNEL_VARIANT:
{%- for kernel in device.kernel_variants %}
{%- for kernel in device.kernels %}
- {{ kernel }}
{%- endfor %}
{%- endif %}
@@ -126,13 +129,11 @@ prepare-{{ device.name }}:
needs:
- job: 'prepare-{{ device.name }}'
artifacts: false
{%- if device.has_kernel_variants %}
parallel:
matrix:
- KERNEL_VARIANT: $[[ matrix.KERNEL_VARIANT ]]
{%- endif %}
# NOTE: We can't wait for a particular job in the matrix until GitLab implements support for it:
# https://gitlab.com/gitlab-org/gitlab/-/issues/423553
variables:
CI_TRON__PMB_BUILD_JOB: "prepare-{{ device.name }}{% if device.has_kernel_variants %}: [$KERNEL_VARIANT]{% endif %}"
CI_TRON_KERNEL_CMDLINE__DEVICEINFO: '{{ device.deviceinfo.kernel_cmdline }}'
# Include the gitlab ci yml fragment, as found in
# `device/$category/device-$devicename/gitlab-ci.yml.j2` which defines the jobs
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-29
View File
@@ -1,29 +0,0 @@
#!/bin/sh -e
# Description: Ensure that we're not depending on a too new pmbootstrap version.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add coreutils curl jq
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
pmbootstrap_min_age_days="30"
pmbootstrap_min_version_field="$(grep pmbootstrap_min_version= pmaports.cfg)"
pmbootstrap_min_version="${pmbootstrap_min_version_field#*=}"
tag_date=$(curl -s "https://gitlab.postmarketos.org/api/v4/projects/postmarketOS%2Fpmbootstrap/repository/tags/$pmbootstrap_min_version" \
| jq -r ".created_at")
tag_age_timestamp=$(date -d "$tag_date" +"%s")
acceptable_age_timestamp=$(date -d "$pmbootstrap_min_age_days days ago" +"%s")
echo "NOTE: pmbootstrap versions must be at least $pmbootstrap_min_age_days days old to be the minimum required version"
if [ "$tag_age_timestamp" -ge "$acceptable_age_timestamp" ]; then
echo "ERROR: pmbootstrap version '$pmbootstrap_min_version' is too new!"
exit 1
else
echo "PASS: pmbootstrap version '$pmbootstrap_min_version' is acceptable"
exit 0
fi
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: check pkgver/pkgrel bumps, amount of changed pkgs etc
# Options: native
# Use 'native' because it requires running pmbootstrap.
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
@@ -11,10 +11,10 @@ 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/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
fi
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
.ci/lib/check_changed_versions.py
.ci/lib/check_changed_aports_versions.py
+1 -1
View File
@@ -6,7 +6,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
apk add git python3
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/main
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/master
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
+1 -73
View File
@@ -1,7 +1,4 @@
#!/bin/sh -e
# shellcheck shell=busybox
# Description: check various bad patterns with grep
# https://postmarketos.org/pmb-ci
@@ -9,7 +6,7 @@ exit_code=0
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add git grep
apk -q add grep
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
@@ -113,73 +110,4 @@ if grep -qr '/etc/modprobe.d' --exclude-dir='archived' \
exit_code=1
fi
# Disallow maintainer comments.
if grep -qr '# Maintainer:' -- *; then
echo 'ERROR: Please use maintainer variables of the form maintainer="..." instead of maintainer comments of the form # Maintainer: ...'
grep --color=always -r '# Maintainer:' -- *
exit_code=1
fi
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
# Find all moved or new kernel APKBUILDs in main, community or testing
MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\)/linux-.*/APKBUILD" || true)
if [ -n "$MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES" ]; then
if [ -n "$(grep -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES || true)" ]; then
echo "ERROR: An added or moved close-to-mainline kernel package is not being built with LLVM."
echo "See https://postmarketos.org/edge/2025/11/11/kernels-llvm/ for more details"
grep --color=always -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES
exit_code=1
fi
fi
# Find all moved, added, or generally modified kernel APKBUILDs
MODIFIED_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AMR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\|downstream\)/linux-.*/APKBUILD" || true)
if [ -n "$MODIFIED_KERNEL_PACKAGES" ]; then
# Disallow installing kernel modules outside /usr/
_bad_module_path_packages=""
for package in $MODIFIED_KERNEL_PACKAGES; do
# Check for INSTALL_MOD_PATH being set
if grep -qr 'INSTALL_MOD_PATH="$pkgdir"' "$package"; then
# Check if INSTALL_MOD_PATH is set to install to usr
if ! grep -qr 'INSTALL_MOD_PATH="$pkgdir"/usr' "$package"; then
# If INSTALL_MOD_PATH doesn't include usr, add package to list and
# setup failure
_bad_module_path_packages="$_bad_module_path_packages $package"
_module_error=1
fi
fi
done
# Fail with error and pretty print bad packages for logging
if [ -n "$_module_error" ]; then
echo "ERROR: Please set INSTALL_MOD_PATH to '\"\$pkgdir\"/usr'."
for package in $_bad_module_path_packages; do
printf "$package\n"
done
exit_code=1
fi
fi
# Disallow adding packages without a maintainer set
NEW_APKBUILDS=$(git show --pretty="" --name-only --diff-filter=A "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep APKBUILD || true)
if [ -n "$NEW_APKBUILDS" ]; then
if [ -n "$(grep -L '^maintainer="[^"]\+"$' $NEW_APKBUILDS || true)" ]; then
echo "ERROR: A new package does not have a maintainer set."
grep --color=always -L '^maintainer="[^"]\+"$' $NEW_APKBUILDS
exit_code=1
fi
fi
# Get latest commit message in MR
case "$CI_COMMIT_DESCRIPTION" in
*"[ci:skip-grep]"*)
echo "WARNING: not checking packages with grep"
echo " ([ci:skip-grep])!"
exit_code=0
;;
esac
fi
exit "$exit_code"
+2 -2
View File
@@ -6,11 +6,11 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
.ci/lib/kconfig.py
.ci/lib/check_changed_kernels.py
+1
View File
@@ -0,0 +1 @@
../testcases/add_pmbootstrap_to_import_path
+6 -23
View File
@@ -14,7 +14,7 @@ custom_valid_options = [
"pmb:cross-native",
"pmb:cross-native2",
"pmb:drm",
"pmb:generic-kernel",
"pmb:gpu-accel", # deprecated
"pmb:strict",
"pmb:systemd",
"pmb:systemd-never",
@@ -38,15 +38,11 @@ def get_kconfigcheck_categories() -> list [str]:
if __name__ == "__main__":
if common.commit_message_has_string("[ci:skip-apkbuild-lint]"):
print("WARNING: not linting deviceinfo files ([ci:skip-apkbuild-lint])")
exit(0)
kconfigcheck_categories = get_kconfigcheck_categories()
custom_valid_options += kconfigcheck_categories
os.environ["CUSTOM_VALID_OPTIONS"] = " ".join(custom_valid_options)
apkbuilds = {file for file in common.get_changed_files()
apkbuilds = {file for file in common.get_changed_files(removed=False)
if os.path.basename(file) == "APKBUILD"}
if len(apkbuilds) < 1:
print("No APKBUILDs to lint")
@@ -61,20 +57,7 @@ if __name__ == "__main__":
if len(apkbuilds_filtered) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
print("Running apkbuild-lint...")
print("")
ret = 0
for apkbuild in apkbuilds_filtered:
try:
cmd = ["apkbuild-lint", apkbuild]
subprocess.run(cmd, text=True, check=True)
except subprocess.CalledProcessError as exception:
ret = exception.returncode
print("")
if ret == 0:
print("Success")
sys.exit(ret)
try:
subprocess.run(["apkbuild-lint", *apkbuilds_filtered], text=True, check=True)
except subprocess.CalledProcessError as exception:
sys.exit(exception.returncode)
+1
View File
@@ -9,6 +9,7 @@ import pathlib
import common
# pmbootstrap
import add_pmbootstrap_to_import_path
import pmb.core
import pmb.parse
import pmb.parse._apkbuild
+1 -2
View File
@@ -1,12 +1,11 @@
#!/bin/sh -e
# Description: build modified packages for this architecture
# Options: native slow
# Use 'native' because it requires running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
@@ -12,6 +12,7 @@ import subprocess
import common
# pmbootstrap
import add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.parse.version
import pmb.helpers.logging
@@ -24,7 +25,7 @@ def get_package_contents(package, revision, check=True):
if not check:
stderr = subprocess.DEVNULL
# Run something like "git show upstream/main:main/hello-world/APKBUILD"
# Run something like "git show upstream/master:main/hello-world/APKBUILD"
pmaports_dir = common.get_pmaports_dir()
pattern = pmaports_dir + "/**/" + package + "/APKBUILD"
path = glob.glob(pattern, recursive=True)[0][len(pmaports_dir + "/"):]
@@ -137,7 +138,7 @@ def check_versions(packages):
pkgver = head.rpartition('-r')[0]
if package.startswith('device-') and not pkgver.isdigit():
print(f" - {package}: invalid pkgver \"{pkgver}\""
"See: https://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Additional checks for device packages
@@ -145,11 +146,27 @@ def check_versions(packages):
head_parsed = get_package_contents(package, "HEAD", False)
upstream_parsed = get_package_contents(package, commit, False)
# Check that pkgrel was reset to 0 when pkgver was changed
if head_parsed["pkgver"] != upstream_parsed["pkgver"] and head_parsed["pkgrel"] != "0":
print(f" - {package}: pkgrel should be 0 when pkgver changes."
"See: https://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
error = True
# 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)
@@ -166,6 +183,39 @@ def check_versions(packages):
if error:
exit_with_error_message()
def check_package_count(count):
for mark in ["[ci:ignore-count]", "[ci:skip-build]"]:
if common.commit_message_has_string(mark):
print("NOTE: package count sanity check skipped (" + mark + ").")
return
if count <= 10:
return
branch = common.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.
""")
exit(1)
if __name__ == "__main__":
# Get and print modified packages
@@ -175,6 +225,7 @@ if __name__ == "__main__":
exit(0)
print(f"Changed packages: {packages}")
check_package_count(len(packages))
# Potentially skip this check
if common.commit_message_has_string("[ci:skip-vercheck]"):
@@ -2,6 +2,9 @@
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import tempfile
import sys
import subprocess
# Same dir
+2 -2
View File
@@ -90,7 +90,7 @@ def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--booting", help="devices must be in the upper table,"
" being in the 'not booting' table below is not"
" enough (all devices in pmaports main and stable"
" enough (all devices in pmaports master and stable"
" branches and should be in the upper table)",
action="store_true")
parser.add_argument("--path", help="instead of downloading the devices"
@@ -108,7 +108,7 @@ def main() -> int:
if args.all:
devices = get_devices()
else:
devices = common.get_changed_devices(skip_archived=True)
devices = common.get_changed_devices()
# remove 'device-' prefix
devices = [d[7:] for d in devices]
devices = [d.removesuffix("-downstream") for d in devices]
+23 -20
View File
@@ -7,12 +7,18 @@
import configparser
import os
import subprocess
from functools import cache
@cache
cache = {}
def get_pmaports_dir():
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
global cache
if "pmaports_dir" in cache:
return cache["pmaports_dir"]
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
cache["pmaports_dir"] = ret
return ret
def run_git(parameters, check=True, stderr=None):
@@ -45,10 +51,9 @@ def run_pmbootstrap(parameters):
subprocess.run(cmd, universal_newlines=True, check=True)
@cache
def get_upstream_branch():
""" Use pmaports.cfg from current branch (e.g. "v20.05_fix-ci") and
channels.cfg from main to retrieve the upstream branch.
channels.cfg from master to retrieve the upstream branch.
:returns: branch name, e.g. "v20.05" """
@@ -56,6 +61,10 @@ def get_upstream_branch():
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"]
# Get channel (e.g. "stable") from pmaports.cfg
# https://postmarketos.org/pmaports.cfg
pmaports_dir = get_pmaports_dir()
@@ -65,7 +74,7 @@ def get_upstream_branch():
# Get branch_pmaports (e.g. "v20.05") from channels.cfg
# https://postmarketos.org/channels.cfg
channels_cfg_str = run_git(["show", "upstream/main:channels.cfg"])
channels_cfg_str = run_git(["show", "upstream/master:channels.cfg"])
channels_cfg = configparser.ConfigParser()
channels_cfg.read_string(channels_cfg_str)
assert channel in channels_cfg, \
@@ -73,10 +82,11 @@ def get_upstream_branch():
" This appears to be an old branch, consider recreating your change" \
" on top of master."
return channels_cfg[channel]["branch_pmaports"]
ret = channels_cfg[channel]["branch_pmaports"]
cache["upstream_branch"] = ret
return ret
@cache
def get_base_commit() -> str:
"""Get the base commit that can be compared with HEAD to get all commits in the
given branch/merge request."""
@@ -108,7 +118,7 @@ def get_base_commit() -> str:
return commit
def get_changed_files(removed=False):
def get_changed_files(removed=True):
""" Get all changed files and print them, as well as the branch and the
commit that was used for the diff.
:param removed: also return removed files (default: True)
@@ -133,20 +143,13 @@ def get_changed_files(removed=False):
def get_changed_packages(skip_archived: bool = False):
ret = set()
for file in get_changed_files(removed=True):
for file in get_changed_files():
dirname, filename = os.path.split(file)
# Skip files:
# * in the root dir of pmaports (e.g. README.md)
# * path with a dot (e.g. .ci/, device/.shared-patches/)
# * documentation
if (
not dirname
or file.startswith(".")
or "/." in file
or skip_archived and dirname.startswith("device/archived")
or dirname == "docs"
):
if not dirname or file.startswith(".") or "/." in file or skip_archived and dirname.startswith("device/archived"):
continue
if filename != "APKBUILD":
@@ -182,9 +185,9 @@ def get_changed_kernels(skip_archived: bool = False):
ret += [pkgname]
return ret
def get_changed_devices(skip_archived: bool = False):
def get_changed_devices():
ret = []
for pkgname in get_changed_packages(skip_archived):
for pkgname in get_changed_packages():
if pkgname.startswith("device-"):
ret += [pkgname]
return ret
+2 -10
View File
@@ -3,7 +3,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import glob
import os.path
import subprocess
import sys
@@ -12,15 +11,8 @@ if __name__ == "__main__":
if common.commit_message_has_string("[ci:skip-dint]"):
print("WARNING: not linting deviceinfo files ([ci:skip-dint])")
exit(0)
if "deviceinfo_schema.toml" in common.get_changed_files():
print("deviceinfo_schema.toml changed -> checking all deviceinfo files")
pmaports_dir = common.get_pmaports_dir()
deviceinfo_files = set(glob.glob(pmaports_dir + "/device/*/*/deviceinfo"))
else:
# only lint deviceinfo files in the devices repo
deviceinfo_files = {file for file in common.get_changed_files()
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")}
deviceinfo_files = {file for file in common.get_changed_files(removed=False)
if os.path.basename(file) == "deviceinfo"}
try:
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)
+40 -24
View File
@@ -2,7 +2,6 @@
# Copyright 2025 Pablo Correa Gomez
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
from functools import cached_property
from pathlib import Path
from typing import Self
@@ -44,6 +43,10 @@ class Device:
return Template(fragment_tmpl).render(device=self)
@property
def is_present_in_ci(self):
return bool(self.gitlab_ci_fragment)
@cached_property
def pmaports_path(self) -> Path:
# Find the root of pmaports
@@ -69,11 +72,11 @@ class Device:
@property
def testing_dependencies(self) -> set[str]:
# TODO: Source this from the APKBUILD
# TODO: Source this from the APKGBUILD
return {"postmarketos-mkinitfs-hook-ci"}
@cached_property
def package_dependencies(self) -> set[str]:
def package_dependencies(self) -> list[str]:
# HACK: Work around a bug in depends_recurse which prevents listing all the dependencies
# Bug: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2623
return {"postmarketos-initramfs"}
@@ -85,7 +88,7 @@ class Device:
return self.package_dependencies | self.testing_dependencies
@cached_property
def kernel_variants(self) -> list[str]:
def kernels(self) -> list[str] | None:
kernels = []
subpackage_prefix = f"device-{self.codename}-kernel-"
@@ -98,7 +101,10 @@ class Device:
if kernel_name != "none":
kernels.append(kernel_name)
return kernels
if kernels:
return kernels
else:
return None
@cached_property
def deviceinfo(self) -> dict[str, Deviceinfo] | Deviceinfo:
@@ -111,7 +117,7 @@ class Device:
@property
def has_kernel_variants(self):
return len(self.kernel_variants) > 0
return len(self.kernels) > 0
@classmethod
def supported_devices(cls) -> dict[Path, Self]:
@@ -125,7 +131,7 @@ class Device:
dev = cls(device.codename)
# Ignore devices that do not have a gitlab ci fragment,
# since adding that fragment is how we mark them as DUTs
# since we won't be able to make use of them
if not dev.gitlab_ci_fragment:
continue
@@ -136,21 +142,31 @@ class Device:
class ArchTagSet(set):
supported_arches = [
Arch.x86_64,
Arch.x86,
Arch.aarch64,
Arch.armv7,
Arch.armhf,
Arch.riscv64,
Arch.ppc64le,
]
def update(self, iterable):
supported_arches = Arch.supported_binary()
# This ignores things like !armv7, that could be a follow-up optimization
if 'noarch' in iterable or 'all' in iterable:
iterable = [arch for arch in supported_arches]
super().update([Arch(arch) for arch in iterable if Arch(arch) in supported_arches])
iterable = [arch for arch in self.supported_arches]
super().update([Arch(arch) for arch in iterable if Arch(arch) in self.supported_arches])
if __name__ == "__main__":
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("--template", default=".ci/build-jobs.yaml.j2", help="Jinja2 input template")
parser.add_argument("--output", default=".ci/build-jobs.yaml", help="output pipeline")
args = parser.parse_args()
# Needs input to output if we should create the jobs
if len(sys.argv) != 3:
print("usage: generate_build_jobs.py TEMPLATE CHILD_PIPELINE")
print(sys.argv)
sys.exit(1)
template = sys.argv[1]
child_pipeline = sys.argv[2]
# pmb logging has to be initialized for later pmb commands to work, setting
# to /dev/null since we don't care about the output. Later this could
@@ -160,11 +176,10 @@ if __name__ == "__main__":
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
_ = pmb.parse.arguments()
args = pmb.parse.arguments()
# Get the list of supported devices
supported_devices = Device.supported_devices()
print(f"Supported devices: {[d for d in supported_devices.values()]}")
archs = ArchTagSet()
devices_under_test = set()
@@ -179,6 +194,8 @@ if __name__ == "__main__":
if path.name != "APKBUILD":
continue
elif not path.exists():
continue # APKBUILD was deleted
apkbuild = pmb.parse.apkbuild(path)
packages_modified.add(apkbuild['pkgname'])
archs.update(apkbuild["arch"])
@@ -203,7 +220,7 @@ if __name__ == "__main__":
print(f"Architectures to build: {archs}")
print(f"Devices under test: {devices_under_test}")
with open(args.template) as f:
with open(template) as f:
rendered = Template(f.read()).render(
archs=archs,
devices_under_test=devices_under_test,
@@ -211,13 +228,12 @@ if __name__ == "__main__":
archtag={
Arch.x86_64: "shared",
Arch.x86: "shared",
Arch.aarch64: "aarch64",
Arch.armv7: "armv7",
Arch.armhf: "armhf",
Arch.aarch64: "arm64",
Arch.armv7: "qemu",
Arch.armhf: "qemu",
Arch.riscv64: "qemu",
Arch.ppc64le: "ppc64le",
Arch.loongarch64: "loongarch64",
},
)
with open(args.output, "w") as fw:
with open(child_pipeline, "w") as fw:
fw.write(rendered)
+2 -12
View File
@@ -8,6 +8,7 @@ import sys
import common
# pmbootstrap
import add_pmbootstrap_to_import_path
import pmb.core
from pmb.core.context import get_context
@@ -36,28 +37,17 @@ if __name__ == "__main__":
# aports later. We might be given a changed aport from e.g. extra-repos/systemd when
# that repo is not enabled
buildable_pkgs = set()
archived = set()
for path in pmb.core.pkgrepo.pkgrepo_iter_package_dirs():
# Store archived packages for matching later
if os.path.split(os.path.split(path)[0])[1] == 'archived':
archived.add(os.path.basename(path))
continue
buildable_pkgs.add(os.path.basename(path))
# To store a list of packages from extra-repos/systemd for special handling
# later:
systemd_pkgs = list()
# Filter out packages are not found in enabled repos or are in archived
# Filter out packages are not found in enabled repos
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
if package not in buildable_pkgs:
# Specifically handle archived since it could include packages
# who's sources are dead
if package in archived:
print(f"{package}: archived, skipping")
packages.remove(package)
continue
print(f"{package}: not in current repo, skipping")
packages.remove(package)
# FIXME: this should probably be more generic, if other repos are added
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Description: static type checking for python scripts
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-argcomplete py3-pip py3-pytest
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
pip install --break-system-packages --no-warn-script-location mypy
# Need to change directory for pyproject.toml to be picked up.
cd .ci
python -m mypy .
-2
View File
@@ -1,2 +0,0 @@
[tool.mypy]
disable_error_code = ["import-not-found"]
+3 -3
View File
@@ -3,12 +3,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: lint with various python tests
# Options: native
# Use 'native' because it requires running pmbootstrap.
# Use 'native' because it requires pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
@@ -27,6 +27,6 @@ pmbootstrap config aports "$pmaports"
pmbootstrap -q shutdown
# Needed to import "common"
export PYTHONPATH="$PYTHONPATH:.ci/lib"
export PYTHONPATH=".ci/lib"
# Run testcases
pytest -vv --tb=native "$pmaports/.ci/testcases" "$@"
+1 -1
View File
@@ -11,4 +11,4 @@ fi
set -x
# shellcheck disable=SC2046
ruff check $(find .ci -name '*.py')
ruff check --ignore E501,F401,E722,W605 $(find .ci -name '*.py')
+2 -4
View File
@@ -16,15 +16,12 @@ fi
sh_files="
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
./main/postmarketos-duranium/rootfs-usr-bin-duranium-set-channel
./main/postmarketos-duranium/rootfs-usr-libexec-duranium-first-boot
./main/postmarketos-duranium/rootfs-usr-libexec-duranium-usb-gadget-setup
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
./main/postmarketos-installkernel/installkernel-pmos
./main/postmarketos-initramfs/init.sh
./main/postmarketos-initramfs/init_functions.sh
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
./main/postmarketos-ui-os-installer/rootfs-usr-bin-pmos_setup.sh
./main/postmarketos-usb-moded/rootfs-usr-lib-systemd-system-generators-umtprd-config-generator
./main/ttyescape/*.post-install
./main/unl0kr/unlock.sh
./device/community/soc-qcom/call_audio_idle_suspend_workaround.sh
@@ -41,6 +38,7 @@ sh_files="
$(find . -name '*.trigger')
$(find . -path './main/devicepkg-dev/*.sh')
$(find . -path './main/postmarketos-mvcfg/*.sh')
$(find . -path './.ci/**.sh')
$(find . -path '**/tests/*.sh')
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import shutil
import sys
import os
import importlib
import importlib.util
from site import getsitepackages
def path_pmbootstrap():
""" Find the pmbootstrap installation folder, so we can import the Python
code from there.
returns: pmbootstrap installation folder
"""
# This variable is set by pmbootstrap 1.52 and later
# If it's undefined, try to find 'pmbootstrap' in path
bin = os.environ.get("PMBOOTSTRAP_CMD") or shutil.which("pmbootstrap")
if not bin:
print("ERROR: 'pmbootstrap' not found in $PATH")
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
directories = getsitepackages()
for directory in directories:
if os.path.exists(directory + "/pmb/__init__.py"):
return directory
# Symlink not set up properly
print("ERROR: unable to find path to pmbootstrap.py. Try setting 'PMBOOTSTRAP_CMD'.")
sys.exit(1)
# Check if pmb module can be imported
if importlib.util.find_spec("pmb") is None:
# Add pmbootstrap dir to import path
sys.path.append(os.path.realpath(path_pmbootstrap()))
+3 -1
View File
@@ -3,11 +3,14 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.helpers.args import init as init_args
from pmb.types import PmbArgs
import pmb.config
from pmb.core.pkgrepo import pkgrepo_default_path
import pytest
import sys
import os
@pytest.fixture(scope="session", autouse=True)
@@ -24,7 +27,6 @@ def args(request):
args.offline = False
args.action = "init"
args.cross = False
args.ccache = False
args.log = None
init_args(args)
+7 -1
View File
@@ -2,10 +2,16 @@
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import fnmatch
import glob
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob, pkgrepo_relative_path
from pmb.core.arch import Arch
# Don't complain if these nicknames are the only maintainers of an APKBUILD,
+5
View File
@@ -2,8 +2,13 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import pytest
import re
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
+3 -1
View File
@@ -2,10 +2,12 @@
# Copyright 2021 Johannes Marbach
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob
def test_aports_firmware():
+5
View File
@@ -6,8 +6,13 @@
version in all packages. We scan all packages, categorize them by URL
and then compare the versions of all packages in each category. """
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.config
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs
+5
View File
@@ -2,9 +2,14 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import re
from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob, pkgrepo_relative_path
+5
View File
@@ -1,9 +1,14 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import logging
import os
import pytest
import sys
import re
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_relative_path
+3 -3
View File
@@ -6,7 +6,10 @@
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
@@ -98,9 +101,6 @@ def test_aports_unreferenced_files():
# Skip APKBUILDs and directories
if rel_file_path in ["APKBUILD", "gitlab-ci.yml.j2"] or os.path.isdir(file):
continue
# Skip kernel fragments in linux-* packages
if os.path.basename(rel_file_path).endswith(".config") and apkbuild["pkgname"].startswith("linux-"):
continue
if os.path.basename(rel_file_path) not in sources_chk \
and rel_file_path not in apkbuild["install"] \
+1 -1
View File
@@ -6,7 +6,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
+22
View File
@@ -5,6 +5,10 @@
#
set -eu
# Maximal allowed size (in bytes) of a file.
FILE_SIZE_LIMIT=262144 # 256 kiB
if ! command -v sha512sum >/dev/null; then
# macOS / BSDs (?) don't have sha512sum, but shasum.
alias sha512sum='shasum -a 512'
@@ -91,6 +95,20 @@ check_local_sources() {
return $status
}
# Checks if the file ($1) being committed is not bigger than FILE_SIZE_LIMIT.
check_file_size() {
local path="$1"
local size
size=$(git cat-file -s ":$path")
if [ $size -gt $FILE_SIZE_LIMIT ]; then
local size_kb=$(( size / 1024 ))
error "file \"$path\" is quite big ($(( size / 1024 )) kiB), better put a remote url in source="
return 1
fi
}
cleanup() {
[ -f "$_staged" ] && rm "$_staged"
}
@@ -104,4 +122,8 @@ for apkbuild in $(changed_files '**/APKBUILD'); do
cleanup
done
for path in $(changed_files); do
check_file_size "$path"
done
trap - EXIT
+1 -1
View File
@@ -67,7 +67,7 @@ instance/
# Documentation
public
docs/packaging/device-packages/deviceinfo-reference.md
docs/deviceinfo-reference.md
# PyBuilder
target/
+4 -38
View File
@@ -16,9 +16,6 @@ variables:
# seems like a reasonable balance. If this is too low, git merge-base (from ci/
# common.py) can fail
GIT_DEPTH: 100
# So that anything that runs install_pmbootstrap and tries to import pmb module
# can find it.
PYTHONPATH: "/tmp/pmbootstrap"
# This defines the rules for when a pipeline should run.
workflow:
@@ -62,18 +59,6 @@ ruff:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/ruff.sh
# testcases typechecking
mypy:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/**/*
- .gitlab-ci.yml
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/mypy.sh
# shellcheck and various grep checks
shellcheck-grep:
stage: lint
@@ -100,7 +85,7 @@ pytest-commits:
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/pytest.sh
- .ci/check-changed-versions.sh
- .ci/commits.sh
artifacts:
when: on_failure
paths:
@@ -111,9 +96,6 @@ pytest-commits:
# APKBUILD linting
aport-lint:
# alpine:latest doesn't have the most recent atools-go, which means we would
# miss some linting rules that were added upstream. Use alpine:edge instead.
image: alpine:edge
stage: lint
rules:
- if: *mr_rule
@@ -131,7 +113,6 @@ dint:
- .ci/**/*
- .gitlab-ci.yml
- device/*/device-*/deviceinfo
- deviceinfo_schema.toml
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/dint.sh
@@ -172,21 +153,9 @@ mr-settings:
before_script:
- apk -q add python3
script:
- wget -q "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/check_mr_settings.py"
- wget -q "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
- python3 ./check_mr_settings.py
pmbootstrap minimum version:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/check-pmbootstrap-min-version.sh
- .gitlab-ci.yml
- pmaports.cfg
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/check-pmbootstrap-min-version.sh
# Calculate build of changed aports using a dynamic downstream pipelines:
# https://docs.gitlab.com/ci/pipelines/downstream_pipelines/#dynamic-child-pipelines
# For those to work, we need two jobs:
@@ -203,13 +172,13 @@ generate-build-jobs:
- .ci/lib/gitlab_prepare_ci.sh
needs: []
script:
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh py3-jinja2
# HACK: Make the pmb library happy to use the currently-cloned pmaports repo
- mkdir -p /root/.local/var/pmbootstrap/cache_git/ && ln -s $PWD /root/.local/var/pmbootstrap/cache_git/pmaports
- .ci/lib/generate_build_jobs.py
- PYTHONPATH=/tmp/pmbootstrap/ .ci/lib/generate_build_jobs.py .ci/build-jobs.yaml.j2 .ci/build-jobs.yaml
artifacts:
paths:
@@ -239,8 +208,6 @@ build-docs:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .ci/build-docs.sh
- deviceinfo_schema.toml
- docs/**
deploy-docs:
@@ -251,7 +218,6 @@ deploy-docs:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "postmarketOS"
changes:
- deviceinfo_schema.toml
- docs/**
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
+3 -4
View File
@@ -26,9 +26,8 @@
<!--
Replace space inside `[ ]` with `x` to fill the checkbox
-->
* [ ] edge (`main` branch)
* [ ] `v25.12`
* [ ] `v26.06`
* [ ] edge (`master` branch)
* [ ] `v25.06`
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
@@ -36,7 +35,7 @@
#### Environments
* [ ] COSMIC
* [ ] GNOME Shell on Mobile
* [ ] Phosh (*Please attach the debug information of the Mobile settings app, see [this video](https://peertube.debian.social/w/4GwDjCJNcAmp8cb7dqXz1T) or use `phosh-mobile-settings -d`*)
* [ ] Phosh
* [ ] Plasma Mobile
* [ ] Sxmo (Wayland/Sway) **Please post the output of `sxmo_version.sh`**
* [ ] Other: **Please fill out**
@@ -1,15 +0,0 @@
<!-- Use this template to kick off the discussion for a package with (presumably)
inactive maintainers and the future for the maintainership of the package.
-->
### Information
* Package name:
* Maintainers of the package:
* MR that had no maintainer response, if applicable:
If the maintainers don't reply within two weeks of opening this issue, the
package is considered orphaned and, in the case of device packages, the devices
will be moved to the archived category.
/label ~maintainership-status
@@ -1,25 +0,0 @@
<!-- Use this template to notify community kernel maintainers that their
kernels are out-of-date and start the timer for moving them to testing.
Please title the issue:
Current community kernels not meeting version requirement (yyyy-mm-dd)
-->
Hi, as per our
[device categorization requirements for the community category](https://docs.postmarketos.org/pmaports/main/device-categorization.html#community),
devices in the community category may not use a kernel version older than 6
months.
As of today (yyyy-mm-dd), the following kernels do not meet this requirement:
* kernel-pkgname: kernel-pkgver, version-release-date (maintainers: @ ...)
This issue is an attempt to notify you (the maintainers) of the situation so
that you can update the packages. As per the rules, you have two weeks to
update the packages or reply with a request for more time, up to one month
of time from the moment this issue is opened. If that time passes and the
devices still no longer meet the requirements, they will be moved to testing.
/label ~"device-category::community"
/label ~kernel
/label ~"type::policy"
-29
View File
@@ -1,29 +0,0 @@
<!--
This template is for marking a postmarketOS stable release as EOL.
Name this issue "vYY.MM EOL".
-->
When the release has reached its EOL date:
- [ ] `postmarketos-base-ui`: let it depend on
`postmarketos-release-upgrade-notification` and bump pkgrel
- [ ] ensure it builds locally with pmbootstrap
- [ ] push it to the branch
- [ ] make sure bpo built and released the updated packages
- [ ] drop the old release from
[monitoring](https://gitlab.postmarketos.org/postmarketOS/monitoring)
- [ ] drop the "oldold -> old" release check from
[postmarketos-release-upgrade](https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/)
CI
- [ ] bpo: configure images so they don't get built for the old release anymore
- [ ] bpo: configure branches so we don't try to build packages for old
branches anymore
- e.g. on startup all branches are checked for new packages, we should keep
the amount of branches that get checked minimal
- [ ] pmaports.git channels.cfg: change description:
- "Old release (unsupported)"
- [ ] Update the [Releases](https://docs.postmarketos.org/pmaports/main/releases.html) page
- Move the release from active to old
- [ ] Consider removing images for the previous releases to save disk space
(people can build their own images with pmbootstrap if needed)
@@ -1,234 +0,0 @@
<!--
This template is for creating a new postmarketOS stable release.
Name this issue "vYY.MM Infrastructure".
-->
Person in charge of the release (doesn't have to do all the work, but has to
push it forward):
<!-- Put your usename here and assign yourself to this issue -->
### 0. Preparation
- [ ] Create the gitlab milestone for the release
- [ ] Add this infrastructure issue to the milestone
- [ ] Update the
[timeline](https://docs.postmarketos.org/policies-and-processes/development/releases/current-timeline.html)
for the next release
### 1. Pre-Build phase
This phase is to get some extra time for building packages. The branch will be rebased once in the branch phase.
#### Requirements
- [ ] Alpine's main repository must be built and published
- [ ] Alpine's community repository must be built and published
<small>Without this, bpo won't be able to build packages but steps before
that can be done already.</small>
#### pmbootstrap: adjust config
- [ ] Update `pmb/config/__init__.py:apk_tools_min_version`. This should be a
trivial change, push it directly to main.
- [ ] (can be done later, at start of test phase) make a new [pmbootstrap
release](https://wiki.postmarketos.org/wiki/Pmbootstrap_release) <small>bpo
uses the main branch, so it will be fine without a release, however users
will want to try out the new release and may not run main.</small>
#### pmaports: create branch and initial changes
- [ ] `git checkout -b vYY.MM main`
- [ ] Create a `=== Branch vYY.MM from main ===` commit
- Remove channels.cfg (should only be in main)
- Adjust `pmaports.cfg`: Change `channel=edge` to `channel=vYY.MM`
- Adjust `pmaports.cfg`: Change `supported_arches` to `x86_64,aarch64,armv7`
- Delete `.ci/build-*` scripts for other arches
<small>`pmbootstrap ci` reads these</small>
- [ ] `git push`
- [ ] Ensure the branch is protected in the
[repository settings](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/settings/repository)
#### pmaports: update main branch
- [ ] `git checkout main`
- [ ] Add the new branch to
[channels.cfg](https://wiki.postmarketos.org/wiki/Channels.cfg_reference):
- [Example](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/commit/c43571ceaf9b8155519bc9fb760bdeccd96e7e9c)
- Check if you need to set `branch_aports=master` initially if the stable
branch does not exist yet.
- [ ] `git push`
#### pmaports: update os-release / remove packages / aportgen
- [ ] `git checkout vYY.MM`
- [ ] Update `postmarketos-base`:
- [ ] Set version info for `/usr/lib/os-release` in
`main/postmarketos-base/rootfs-usr-lib-os-release`
(`PRETTY_NAME="postmarketOS vYY.MM"`, `VERSION_ID="vYY.MM"`,
`VERSION="vYY.MM"`)
- `pmbootstrap pkgrel_bump postmarketos-base`
- `pmbootstrap config mirrors.pmaports none`
- `pmbootstrap config mirrors.systemd none`
- `pmbootstrap checksum postmarketos-base`
- `git commit -s` (`Remove packages that we don't have in stable`)
- [ ] Remove packages:
- `cross/*-armhf` and other unsupported arches in cross dir (keep `gcc-x86` and `musl-dev-x86`, `systemd-boot-x86`)
- `gcc4*` and `gcc6*` from main and cross dirs
- `device/downstream`, `device/archived`
- `extra-repos/systemd/postmarketos-repo-nightly`
- [ ] Run `pmbootstrap aportgen` for packages in cross:
- `cd cross; PMB_APK_FORCE_MISSING_REPOSITORIES=1 pmbootstrap aportgen musl-* grub-efi-x86`
- `git commit -s` (`cross: regenerate for vYY.MM`)
- [ ] `git push`
#### bpo: adjust config
- [ ] Add the branch to the
[build.postmarketos.org](https://gitlab.postmarketos.org/postmarketOS/build.postmarketos.org)
config in `bpo/config/const/__init__.py:branches` below `branches["main"]`,
so it builds with lower priority than main until it's released. Set `ignore_errors` to `True`.
- [ ] Make a merge request, wait until CI passes, merge it (or if you can directly push to main that's also fine since it's a trivial change)
- [ ] Roll it out/ask somebody who can do that
- [ ] Restart bpo, it will start building `x86_64` packages
#### Bootstrap of binary packages
- [ ] Fix all failing `x86_64` packages (Remember: patches need to go through
edge first, then get backported to the stable branch!)
- Try to get build fixes merged to edge quickly, ask for reviews in
#postmarketos-devel, and consider merging trivial fixes right after they
pass CI.
- Devices in testing and archived categories that don't build: consider
trying to fix them, or just delete them from the branch
- [ ] Wait until all packages for `x86_64` (main repository, we don't need to
wait for the systemd repository before continuing) are built and
published
- [ ] Enable arm repositories in the BPO config
- [ ] Get all packages to build without errors
#### Wallpaper poll
- [ ] Team meeting: make a short list of 4 wallpapers from [the
pool](https://gitlab.postmarketos.org/postmarketOS/artwork/-/tree/main/wallpapers/2024)
- [ ] Make a poll on the wallpapers on mastodon
([example](https://fosstodon.org/@postmarketOS/113624366198561582))
- Make sure to thank the wallpaper authors (usually dikasp) for the amazing
work on the wallpapers
- Put the names of the wallpapers on top of the wallpapers for easier voting
and as alt text
- Create a comment with poll options
#### Adjust CI
- [ ] Make sure pmaports.git CI runs through on the new branch (run
`pmbootstrap ci`). Examples of why it might fail:
- One postmarketos-ui package has a package from alpine testing in their
_pmb_recommends.
- Remove the UI if it is not used much (can bring it back on demand) or
fork the package to the new branch
- Consider fixing it in edge, so we don't run into this with the next
release
- [ ] Adjust
[upstream-compat](https://gitlab.postmarketos.org/postmarketOS/continuous-testing/upstream-compat)
to run on the new release and make sure it passes
([example](https://gitlab.postmarketos.org/postmarketOS/continuous-testing/upstream-compat/-/merge_requests/10))
#### Adjust release upgrade script
- [ ] Add the new release to `upgrade.sh` in [postmarketos-release-upgrade](https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/)
- [ ] Bump `SCRIPT_VERSION`, tag a new release
- [ ] Package it for edge (make MR), backport it to the new release, but NOT to
the old release yet (otherwise users may upgrade by accident, without
realizing that the new version is not out yet!)
- [ ] Adjust CI of postmarketos-release-upgrade to test the new release too
(`git grep` for the previous release to see what needs to be adjusted)
#### Update the wallpaper
- [ ] Set the wallpaper that won in the poll in edge, backport this change to
the stable release branch
### 2. Branch phase
#### Rebase on main
- [ ] `git checkout vYY.MM`
- [ ] `git rebase -i origin/main`
- [ ] Temporarily enable force-push for the `vYY.MM` branch
- [ ] `git push --force-with-lease`
- [ ] Disable force-push for the `vYY.MM` branch again
#### Update BPO config
- [ ] Update bpo's images config to build images for the new branch for all
devices in community and main
- [ ] bpo: configure the new branch to be not WIP anymore
- [ ] Roll-out bpo changes
#### pmb release done?
- [ ] Ensure that a pmbootstrap release been made with the apk-tools min
version change
#### aports stable branch set?
* [ ] Check if a stable branch exists in `aports` for the new release, and that
it is being used in `channels.cfg` (might still be set to `master` if it
did not exist during the Pre-Branch phase).
### 3. Test phase
- [ ] Create an issue in pmaports with a checklist of devices and UIs in main
and community (see previous issue for reference)
- Tag the testers of each device and UI
- Ask to verify that the images work as expected
- Release upgrade script: when coming from the previous release, grab it from
main: `wget https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/-/raw/main/upgrade.sh`
- [ ] Announce the new phase in the testing chat - and ask them to do the
testing within one week, as in the timeline.
- Prioritize merging fixes from maintainers (they do the heavy lifting in the
testing and fixing phase, see timetable)
- Make sure to properly cherry pick fixes from MRs to edge, if they are
intended for the upcoming release
- [ ] Add new version to the pmaports gitlab issue template (.gitlab dir)
### 4. Release phase
- [ ] Did a reasonable amount of devices get tested? (we may consider dropping
devices that were not tested)
- [ ] Make sure all fixes are in
- [ ] Make sure new images are generated *with* the fixes (unless it's a fix
for something that doesn't impact the experience much and is fine to get with
the first update after installing)
- [ ] Announce the new phase in the testing chat, together with the planned
date of blog post release (and testing)
#### Write blog post
- [ ] Write a blog post for the new release in `postmarketos.org.git`:
- Look at the previous release blog post and try to make the new one
consistent with it
- Highlight major changes since the last release
(see the release notes issue)
- Mention new devices, and total list of devices
- Count devices that have their own wiki page as separate device
- E.g. OnePlus 6, 6T are two devices (two wiki pages), but variants of
"Samsung Galaxy A3 (2015)" are one device (one wiki page)
- Don't count/list devices for which we don't build images (e.g.
qemu-amd64)
- Adjust the homepage config to point to the new release in the downloads
page
- update `config/download.py`:
- `latest_release`
- update devices and categories. only list the ones where we actually build images.
- Add some cool photos
- Submit the blog post as MR to postmarketos.org.git.
- Let the blog post MR close the current release notes issue.
- Ask for reviews.
#### Release!
- [ ] Backport the new postmarketos-release-upgrade version that allows
upgrading to the new release, to the previous release (don't do this before
the release is tested and ready! During the testing phase, we can use
postmarketos-release-upgrade from main directly: `wget
https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/-/raw/main/upgrade.sh`)
- [ ] Add the branch to pkgs.postmarketos.org
- [ ] Merge the blog post
- [ ] Edit channels.cfg, change descriptions:
- New release: "Latest release / Recommended for best stability"
- Old release: "Old release (supported until YYYY-MM-DD)" (one month from date of the release)
- [ ] Create a milestone for the next release
- [ ] Create an issue for the next release notes and attach it to that milestone
- [ ] Update the [Releases](https://docs.postmarketos.org/pmaports/main/releases.html) page
- Move the new release to the list of active releases, link to the blog post
- Update the announcement and title for the release
- Add a new upcoming release below
- [ ] Update [Template:Latest stable release](https://wiki.postmarketos.org/wiki/Template:Latest_stable_release) on the wiki with the new version
- [ ] Update "Default description template for issues" in pmaports (.gitlab dir)
- In "On what postmarketOS version did you encounter the issue?", change:
- previous release: add " (supported until YYYY-MM-DD)"
- add the new release
- [ ] Put a reminder in recurring-admin-tasks to drop support for the old release
-4
View File
@@ -1,7 +1,3 @@
Casey Connolly <casey.connolly@linaro.org> <caleb.connolly@linaro.org>
Casey Connolly <kcxt@postmarketos.org> <caleb@postmarketos.org>
Achill Gilgenast <achill@achill.org> <fossdd@pwned.life>
Aelin <aelin@postmarketos.org> <adrian@postmarketos.org>
Aelin <aelin@postmarketos.org> <adrian@travitia.xyz>
Stefan Hansson <newbyte@postmarketos.org> <newbie13xd@gmail.com>
Stefan Hansson <newbyte@postmarketos.org> <newbyte@postmarketos.org>
+4 -4
View File
@@ -1,4 +1,4 @@
# Commit Style
# Policy for commits in pmaports
This document defines policy for organising and titling commits for
inclusion in pmaports.
@@ -16,9 +16,9 @@ target device.
## General policy
We follow
[Alpine's aports commit style](https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md)
with some minor exceptions and additions.
We follow Alpine's aports commit style with some minor exceptions
and additions. Alpine's commit style can be found here:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md
## Exceptions
+1 -3
View File
@@ -5,12 +5,10 @@ This repository contains the APKBUILD files for postmarketOS-specific packages,
There are many more packages defined in the [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/) on which these packages depend.
Helpful resources:
* [Issues](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/work_items)
* [How to create a package](https://wiki.postmarketos.org/wiki/Create_a_package)
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
* [pmaports commit style](./COMMITSTYLE.md)
* [Approval rules](docs/approval-rules.md)
* [Review and merging guidelines](./docs/modules/ROOT/pages/merging-rules.adoc)
* [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/)
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
+4 -10
View File
@@ -4,24 +4,18 @@ recommended=edge
[edge]
description=Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
branch_pmaports=main
branch_pmaports=master
branch_aports=master
mirrordir_alpine=edge
[v26.06]
description=Upcoming stable release (DO NOT USE)
branch_pmaports=v26.06
branch_aports=3.24-stable
mirrordir_alpine=v3.24
[v25.12]
description=Latest release / Recommended for best stability
description=Upcoming stable release (DO NOT USE)
branch_pmaports=v25.12
branch_aports=3.23-stable
branch_aports=master
mirrordir_alpine=v3.23
[v25.06]
description=Old release (unsupported)
description=Latest release / Recommended for best stability
branch_pmaports=v25.06
branch_aports=3.22-stable
mirrordir_alpine=v3.22
+1 -1
View File
@@ -2,7 +2,7 @@ cross-gcc-tests:
extends: .package-test
tags: [qemu]
before_script:
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- su pmos -c "pmbootstrap build gcc-aarch64"
+43
View File
@@ -0,0 +1,43 @@
# This package gets installed in the native and foreign arch chroots.
# It creates files like /usr/lib/arch-bin-masquerade/armhf/gcc, which
# point in the native chroot to the armhf-cross-compiler, and in the
# armhf chroot to /usr/bin/gcc. That way compilation works fine, even
# when distcc gets the absolute path to the compiler passed (ccache does
# that).
pkgname=arch-bin-masquerade
pkgver=2
pkgrel=0
pkgdesc="Wrappers for ccache + distcc (native and foreign chroots)"
url="https://postmarketOS.org"
arch="all"
license="MIT"
options="!check !tracedeps pmb:cross-native"
package() {
# Architectures and binaries
_archs="x86_64 armhf armv7 aarch64"
_bins="c++ cc cpp g++ gcc"
# Iterate over architectures
for _arch in $_archs; do
# Create the arch-specific bin folder
_hostspec="$(arch_to_hostspec $_arch)"
_bindir="$pkgdir/usr/lib/arch-bin-masquerade/$_arch"
mkdir -p "$_bindir"
cd "$_bindir"
# Iterate over binaries and create wrappers
for _bin in $_bins; do
{
echo "#!/bin/sh"
if [ "$_arch" == "$CARCH" ]; then
echo "exec /usr/bin/${_bin} \"\$@\""
else
echo "exec /usr/bin/${_hostspec}-${_bin} \"\$@\""
fi
} > "$_bin"
chmod +x "$_bin"
done
done
}
+1 -1
View File
@@ -2,7 +2,7 @@
# compiling packages in the native chroot (e.g. kernel packages), the
# cross-compiler does not get called directly, but wrapped through
# ccache, which can then cache the results.
maintainer=""
pkgname=ccache-cross-symlinks
pkgver=3
pkgrel=3
+2 -1
View File
@@ -1,3 +1,4 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# https://docs.postmarketos.org/pmbootstrap/cross_compiling.html
#
# Wrapper for the "crossdirect" compilation method.
@@ -17,7 +18,7 @@
# chroot. See crossdirect.c for implementation details of the C version (llvm,
# fakeroot, rpath). The rust version and redirect for archivers are implemented
# as simple shell wrappers.
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=crossdirect
pkgver=5.3.1
pkgrel=1
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+6 -33
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-aarch64
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=aarch64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-aarch64
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,23 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-aarch64 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-aarch64 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
subpackages="g++-aarch64:gpp libstdc++-dev-aarch64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -179,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -286,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -588,11 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -634,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -822,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-armhf
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=armhf
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-armhf
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armhf
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for armhf"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-armhf mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-armhf mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
subpackages="g++-armhf:gpp libstdc++-dev-armhf:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-armv7
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=armv7
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-armv7
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armv7
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for armv7"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-armv7 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-armv7 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armv7 binutils-armv7"
subpackages="g++-armv7:gpp libstdc++-dev-armv7:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-loongarch64
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=loongarch64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-loongarch64
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-loongarch64
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for loongarch64"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-loongarch64 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-loongarch64 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-loongarch64 binutils-loongarch64"
subpackages="g++-loongarch64:gpp libstdc++-dev-loongarch64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-ppc64le
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=ppc64le
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-ppc64le
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-ppc64le
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for ppc64le"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-ppc64le mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-ppc64le mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-ppc64le binutils-ppc64le"
subpackages="g++-ppc64le:gpp libstdc++-dev-ppc64le:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-riscv64
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=riscv64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-riscv64
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-riscv64
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for riscv64"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-riscv64 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-riscv64 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-riscv64 binutils-riscv64"
subpackages="g++-riscv64:gpp libstdc++-dev-riscv64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+7 -36
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-x86
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=x86
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-x86
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,24 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-x86
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for x86"
url="https://gcc.gnu.org"
arch="aarch64 x86_64"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-x86 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="binutils-x86 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-x86 binutils-x86"
subpackages="g++-x86:gpp libstdc++-dev-x86:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -180,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -287,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -589,12 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
x86_64) depends="$depends so:libc.musl-x86_64.so.1" ;;
esac
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -636,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -824,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -1,31 +0,0 @@
Provide struct_sock_fprog_sz on Linux, rather than on Linux+glibc.
With `#include <linux/filter.h>` `struct sock_fprog` is available when
linux headers are available. It seems that glibc is just including that header
as an implementation detail, while musl does not.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2025-08-08 08:51:45.621434001 +0200
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2026-02-25 20:29:28.519492722 +0100
@@ -74,6 +74,7 @@
#include <sys/vt.h>
#include <linux/cdrom.h>
#include <linux/fd.h>
+#include <linux/filter.h>
#if SANITIZER_ANDROID
#include <linux/fs.h>
#endif
@@ -507,6 +508,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
+ unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
#endif // SANITIZER_LINUX
#if SANITIZER_GLIBC
@@ -534,7 +536,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
# endif // SANITIZER_GLIBC
# if !SANITIZER_ANDROID && !SANITIZER_APPLE
+6 -33
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-x86_64
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=x86_64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,7 +23,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
pkgname=gcc-x86_64
pkgver=15.2.0
# i.e. 13.2.1, must match gcc/BASE-VER
@@ -34,23 +34,19 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-x86_64
pkgrel=6
pkgrel=2
pkgdesc="Stage2 cross-compiler for x86_64"
url="https://gcc.gnu.org"
arch="aarch64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-x86_64 mpc1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
esac
depends="binutils-x86_64 mpc1 so:libc.musl-aarch64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-x86_64 binutils-x86_64"
subpackages="g++-x86_64:gpp libstdc++-dev-x86_64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip !tracedeps toolchain"
options="!strip !tracedeps"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
@@ -179,10 +175,7 @@ esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
if $_libgcc; then
depends="$depends libgcc-static$_target"
subpackages="$subpackages libgcc::$CTARGET_ARCH libgcc-static$_target:libgccstatic:$CTARGET_ARCH"
fi
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
@@ -286,7 +279,6 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
0042-libsanitizer-struct_sock_fprog_sz.patch
0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
@@ -588,11 +580,7 @@ gpp() {
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
depends="$depends so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
case "$CARCH" in
aarch64) depends="$depends so:libc.musl-aarch64.so.1" ;;
esac
depends="$depends so:libc.musl-aarch64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
amove $_gcclibexec/cc1plus
amove usr/bin/*++
@@ -634,20 +622,6 @@ libgcc() {
depends=
amove usr/lib/libgcc_s.so.*
# Symlink for Clang to find the library. Gets overwritten by the real
# library if gcc is installed.
ln -s /usr/lib/libgcc_s.so.1 \
"$subpkgdir"/usr/lib/libgcc_s.so
}
libgccstatic() {
pkgdesc="GNU C compiler runtime libraries"
depends=
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbegin.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtbeginS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/crtendS.o
amove usr/lib/gcc/"$CTARGET"/"$pkgver"/libgcc.a
}
libgomp() {
@@ -822,7 +796,6 @@ eecc77e2a9cf956fd752693ad7f8ff8253a7bb557e00564bb488bbc1deac895e63104cc1182a0bdd
9f4c3fa0d17cfcd72626bdbaf51992ff3018f878d673ab19b9056047ee2630b581e5a5a4d4857444f08ba9bcdb0fc94f90dcda6180816e39690d1652843f0d8a 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch
d166475e340c91bbb24cf257240aab37129b04f2609e5ce323b530ab83853a4c34c525e0072c15732717f1681db07e6b3b0a4d268720c31f460435ccf4c99b7f 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch
c717764ef52c0226a23cbf434654cdefa6cbf38ec625648575d9143c5513b16d8914c25015db743033b8a46ac5b2c33ab75e1b67076128d67bb1319e5a83dd85 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch
5dd452a80c496a587a8826b04a4917045e4028631606e85cabd8e87e0460642d188a2156c4e0cf37a5d88e66ebd08a08393d48a6065045178c69eaba2edd063e 0042-libsanitizer-struct_sock_fprog_sz.patch
c3b64b05332bd4dd7fad3fff3cacd4f9de0512943f1548c6f1205fab1a74c83622024f30471805f57d625198cc32f647b32172914528fd5605d0bf61cb0c3ff1 0001-tree-object-size.cc-Fix-assert-constant-offset-in-ch.patch
e91873055550eba051d9297bec5c6acd27abb9ee6ce8911cdd04b5faf37d77b6b2a7607ec588d2863f13f14b48af9398cb4ac42443d8567bfa5037dc6bd50404 0001-LoongArch-Only-allow-valid-binary-op-when-optimize-c.patch
"
@@ -0,0 +1,31 @@
Enable -D_FORTIFY_SOURCE=2 by default.
Original patch from:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default w/optimization. */
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
Please note the warning under '-fgcse' about invoking '-O2' on
programs that use computed gotos.
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-Os' or `-O1' or higher is used. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',
+17 -63
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc4-aarch64
# Based on: main/gcc4 (from postmarketOS)
CTARGET_ARCH=aarch64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,22 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc4-aarch64
pkgver=9999
_pkgver=4.9.4
pkgrel=10
_pkgver=4.9.2
pkgrel=7
pkgdesc="Stage2 cross-compiler for aarch64"
url="http://gcc.gnu.org"
# loongarch64: not supported
# ppc64le, riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-aarch64 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-aarch64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -69,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -93,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -133,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -228,6 +176,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
40_all_gcc49_config_esp.patch
41_all_gcc49_config_esp_alpine.patch
10_all_default-fortify-source.patch
12_all_default-warn-trampolines.patch
15_all_libgfortran-Werror.patch
16_all_libgomp-Werror.patch
@@ -244,6 +193,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-4.9-musl.patch
gcc-4.8-musl-fix-iteratephdr.patch
gcc-4.8-musl-libssp.patch
gcc-4.9-musl-fortify.patch
boehm-gc-uclibc.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -251,6 +201,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
fix-gcj-iconv-musl.patch
musl-posix_memalign-c++.patch
pr63740.patch
pr64037.patch
gcc-4.8-build-args.patch
fix-cxxflags-passing.patch
@@ -484,7 +435,7 @@ package() {
}
sha512sums="
ca0f589f33987755195e81a9c7a83f797cfe5775fca908d025eb3ddbe8857edd666d272c2e97088c1808b268c5785326b72f2a340a277f6aa2c9bfe22c02ad69 gcc-4.9.4.tar.gz
35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
@@ -497,6 +448,7 @@ dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
@@ -512,6 +464,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
@@ -519,6 +472,7 @@ f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d45
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
+83
View File
@@ -0,0 +1,83 @@
https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=0817dc6f0e6b973e0e3671eb72d3758a8f042324
(changelog changes removed)
From 0817dc6f0e6b973e0e3671eb72d3758a8f042324 Mon Sep 17 00:00:00 2001
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 14 Dec 2014 16:07:03 +0000
Subject: [PATCH] Pass unpromoted argument to promote_function_mode
This patch updates setup_incoming_promotions in combine.c to match what
is actually passed in assign_parm_setup_reg in function.c.
Backported from mainline:
gcc/
PR rtl-optimization/64037
* combine.c (setup_incoming_promotions): Pass the argument
before any promotions happen to promote_function_mode.
gcc/testsuite/
PR rtl-optimization/64037
* g++.dg/pr64037.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@218721 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/combine.c | 4 ++--
gcc/testsuite/g++.dg/pr64037.C | 27 +++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/pr64037.C
diff --git a/gcc/combine.c b/gcc/combine.c
index 7c00452..adea2c1 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1529,8 +1529,8 @@ setup_incoming_promotions (rtx first)
uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg));
/* The mode and signedness of the argument as it is actually passed,
- after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */
- mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3,
+ see assign_parm_setup_reg in function.c. */
+ mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3,
TREE_TYPE (cfun->decl), 0);
/* The mode of the register in which the argument is being passed. */
diff --git a/gcc/testsuite/g++.dg/pr64037.C b/gcc/testsuite/g++.dg/pr64037.C
new file mode 100644
index 0000000..e5cd0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr64037.C
@@ -0,0 +1,27 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-std=c++11 -Os" }
+
+enum class X : unsigned char {
+ V = 2,
+};
+
+static void
+__attribute__((noinline,noclone))
+foo(unsigned &out, unsigned a, X b)
+{
+ out = static_cast<unsigned>(b);
+}
+
+int main()
+{
+ unsigned deadbeef = 0xDEADBEEF;
+ asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef));
+
+ unsigned out;
+ foo(out, 2, X::V);
+
+ if (out != 2)
+ __builtin_abort ();
+
+ return 0;
+}
--
1.7.1
@@ -0,0 +1,31 @@
Enable -D_FORTIFY_SOURCE=2 by default.
Original patch from:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default w/optimization. */
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
Please note the warning under '-fgcse' about invoking '-O2' on
programs that use computed gotos.
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-Os' or `-O1' or higher is used. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',
+17 -63
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc4-armhf
# Based on: main/gcc4 (from postmarketOS)
CTARGET_ARCH=armhf
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,22 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc4-armhf
pkgver=9999
_pkgver=4.9.4
pkgrel=10
_pkgver=4.9.2
pkgrel=7
pkgdesc="Stage2 cross-compiler for armhf"
url="http://gcc.gnu.org"
# loongarch64: not supported
# ppc64le, riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-armhf mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-armhf mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -69,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -93,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -133,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -228,6 +176,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
40_all_gcc49_config_esp.patch
41_all_gcc49_config_esp_alpine.patch
10_all_default-fortify-source.patch
12_all_default-warn-trampolines.patch
15_all_libgfortran-Werror.patch
16_all_libgomp-Werror.patch
@@ -244,6 +193,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-4.9-musl.patch
gcc-4.8-musl-fix-iteratephdr.patch
gcc-4.8-musl-libssp.patch
gcc-4.9-musl-fortify.patch
boehm-gc-uclibc.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -251,6 +201,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
fix-gcj-iconv-musl.patch
musl-posix_memalign-c++.patch
pr63740.patch
pr64037.patch
gcc-4.8-build-args.patch
fix-cxxflags-passing.patch
@@ -484,7 +435,7 @@ package() {
}
sha512sums="
ca0f589f33987755195e81a9c7a83f797cfe5775fca908d025eb3ddbe8857edd666d272c2e97088c1808b268c5785326b72f2a340a277f6aa2c9bfe22c02ad69 gcc-4.9.4.tar.gz
35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
@@ -497,6 +448,7 @@ dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
@@ -512,6 +464,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
@@ -519,6 +472,7 @@ f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d45
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
+83
View File
@@ -0,0 +1,83 @@
https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=0817dc6f0e6b973e0e3671eb72d3758a8f042324
(changelog changes removed)
From 0817dc6f0e6b973e0e3671eb72d3758a8f042324 Mon Sep 17 00:00:00 2001
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 14 Dec 2014 16:07:03 +0000
Subject: [PATCH] Pass unpromoted argument to promote_function_mode
This patch updates setup_incoming_promotions in combine.c to match what
is actually passed in assign_parm_setup_reg in function.c.
Backported from mainline:
gcc/
PR rtl-optimization/64037
* combine.c (setup_incoming_promotions): Pass the argument
before any promotions happen to promote_function_mode.
gcc/testsuite/
PR rtl-optimization/64037
* g++.dg/pr64037.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@218721 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/combine.c | 4 ++--
gcc/testsuite/g++.dg/pr64037.C | 27 +++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/pr64037.C
diff --git a/gcc/combine.c b/gcc/combine.c
index 7c00452..adea2c1 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1529,8 +1529,8 @@ setup_incoming_promotions (rtx first)
uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg));
/* The mode and signedness of the argument as it is actually passed,
- after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */
- mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3,
+ see assign_parm_setup_reg in function.c. */
+ mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3,
TREE_TYPE (cfun->decl), 0);
/* The mode of the register in which the argument is being passed. */
diff --git a/gcc/testsuite/g++.dg/pr64037.C b/gcc/testsuite/g++.dg/pr64037.C
new file mode 100644
index 0000000..e5cd0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr64037.C
@@ -0,0 +1,27 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-std=c++11 -Os" }
+
+enum class X : unsigned char {
+ V = 2,
+};
+
+static void
+__attribute__((noinline,noclone))
+foo(unsigned &out, unsigned a, X b)
+{
+ out = static_cast<unsigned>(b);
+}
+
+int main()
+{
+ unsigned deadbeef = 0xDEADBEEF;
+ asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef));
+
+ unsigned out;
+ foo(out, 2, X::V);
+
+ if (out != 2)
+ __builtin_abort ();
+
+ return 0;
+}
--
1.7.1
@@ -0,0 +1,31 @@
Enable -D_FORTIFY_SOURCE=2 by default.
Original patch from:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default w/optimization. */
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
Please note the warning under '-fgcse' about invoking '-O2' on
programs that use computed gotos.
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-Os' or `-O1' or higher is used. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',
+17 -63
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc4-armv7
# Based on: main/gcc4 (from postmarketOS)
CTARGET_ARCH=armv7
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,22 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc4-armv7
pkgver=9999
_pkgver=4.9.4
pkgrel=10
_pkgver=4.9.2
pkgrel=7
pkgdesc="Stage2 cross-compiler for armv7"
url="http://gcc.gnu.org"
# loongarch64: not supported
# ppc64le, riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-armv7 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-armv7 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armv7 binutils-armv7"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -69,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -93,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -133,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 4
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -228,6 +176,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
40_all_gcc49_config_esp.patch
41_all_gcc49_config_esp_alpine.patch
10_all_default-fortify-source.patch
12_all_default-warn-trampolines.patch
15_all_libgfortran-Werror.patch
16_all_libgomp-Werror.patch
@@ -244,6 +193,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-4.9-musl.patch
gcc-4.8-musl-fix-iteratephdr.patch
gcc-4.8-musl-libssp.patch
gcc-4.9-musl-fortify.patch
boehm-gc-uclibc.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -251,6 +201,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
fix-gcj-iconv-musl.patch
musl-posix_memalign-c++.patch
pr63740.patch
pr64037.patch
gcc-4.8-build-args.patch
fix-cxxflags-passing.patch
@@ -484,7 +435,7 @@ package() {
}
sha512sums="
ca0f589f33987755195e81a9c7a83f797cfe5775fca908d025eb3ddbe8857edd666d272c2e97088c1808b268c5785326b72f2a340a277f6aa2c9bfe22c02ad69 gcc-4.9.4.tar.gz
35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
@@ -497,6 +448,7 @@ dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
@@ -512,6 +464,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
@@ -519,6 +472,7 @@ f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d45
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
+83
View File
@@ -0,0 +1,83 @@
https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=0817dc6f0e6b973e0e3671eb72d3758a8f042324
(changelog changes removed)
From 0817dc6f0e6b973e0e3671eb72d3758a8f042324 Mon Sep 17 00:00:00 2001
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 14 Dec 2014 16:07:03 +0000
Subject: [PATCH] Pass unpromoted argument to promote_function_mode
This patch updates setup_incoming_promotions in combine.c to match what
is actually passed in assign_parm_setup_reg in function.c.
Backported from mainline:
gcc/
PR rtl-optimization/64037
* combine.c (setup_incoming_promotions): Pass the argument
before any promotions happen to promote_function_mode.
gcc/testsuite/
PR rtl-optimization/64037
* g++.dg/pr64037.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@218721 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/combine.c | 4 ++--
gcc/testsuite/g++.dg/pr64037.C | 27 +++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/pr64037.C
diff --git a/gcc/combine.c b/gcc/combine.c
index 7c00452..adea2c1 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1529,8 +1529,8 @@ setup_incoming_promotions (rtx first)
uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg));
/* The mode and signedness of the argument as it is actually passed,
- after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */
- mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3,
+ see assign_parm_setup_reg in function.c. */
+ mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3,
TREE_TYPE (cfun->decl), 0);
/* The mode of the register in which the argument is being passed. */
diff --git a/gcc/testsuite/g++.dg/pr64037.C b/gcc/testsuite/g++.dg/pr64037.C
new file mode 100644
index 0000000..e5cd0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr64037.C
@@ -0,0 +1,27 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-std=c++11 -Os" }
+
+enum class X : unsigned char {
+ V = 2,
+};
+
+static void
+__attribute__((noinline,noclone))
+foo(unsigned &out, unsigned a, X b)
+{
+ out = static_cast<unsigned>(b);
+}
+
+int main()
+{
+ unsigned deadbeef = 0xDEADBEEF;
+ asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef));
+
+ unsigned out;
+ foo(out, 2, X::V);
+
+ if (out != 2)
+ __builtin_abort ();
+
+ return 0;
+}
--
1.7.1
@@ -0,0 +1,40 @@
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
# DP: if the optimization level is > 0
---
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 3 +
2 files changed, 9 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7840,6 +7840,12 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
Index: b/gcc/c-family/c-cppbuiltin.c
===================================================================
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
+13 -65
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc6-aarch64
# Based on: main/gcc6 (from postmarketOS)
CTARGET_ARCH=aarch64
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,23 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc6-aarch64
pkgver=9999
_pkgver=6.4.0
pkgrel=15
pkgrel=12
pkgdesc="Stage2 cross-compiler for aarch64"
url="http://gcc.gnu.org"
# loongarch64: not relevant
# ppc64le: not relevant
# riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-aarch64 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-aarch64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -70,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -94,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -134,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -219,6 +166,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
001_all_default-ssp-strong.patch
002_all_default-relro.patch
003_all_default-fortify-source.patch
005_all_default-as-needed.patch
011_all_default-warn-format-security.patch
012_all_default-warn-trampolines.patch
@@ -236,6 +184,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
207-static-pie.patch
libgcc-always-build-gcceh.a.patch
gcc-4.9-musl-fortify.patch
gcc-6.1-musl-libssp.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -259,8 +208,6 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-pure64-mips.patch
ada-mips64.patch
gcc-6.4-isl.patch
0001-i386-Move-struct-ix86_frame-to-machine_function.patch
0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -499,6 +446,7 @@ sha512sums="
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
51282fea54c7e616367bbeb2479ba13fec6f24eb47bd04e2071907b3b36273b2ff24676f46ef8d22f241c8ab4857307861eee076eab66797c3a50a8ecaa1809a 005_all_default-as-needed.patch
3398386dd1e079d6545dd9799adc799c6b80e3984fac6899d0e1a7ee21b66d0c7e53cddf17a65d590c883db750f9f79aaedd857355a8b9f7fb9476c906237919 011_all_default-warn-format-security.patch
9adb0d2b9b67dd957df6c609b8714c7c078efb52cd88770905c37c67827be8fc83d1125037b9c29d77db21ce78756aa2bb0bacdb0b98d869ac126da76a298e21 012_all_default-warn-trampolines.patch
@@ -514,6 +462,7 @@ fc0de05b36613b732a0222ea005c90653c6a40d6761b6894af2419272f4e74875f37e26af33a9b99
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
3287d5b443bea8ec64132bcabe869c738ae98ea8f1a86df1c5d18c927f8816edbfcefeefc47792dbbb2bcacf50319af00e01b3735d34525913b64350770ad453 207-static-pie.patch
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
@@ -533,7 +482,6 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
34a818d5be67eb1f34e44a80b83c28a9b9c17d37fc9fac639f490d6bb5b53ebe3318140d09c236a17d7c98f5a7792ae3d6cefccda8067a5e942d6305b9d1f87c fix-linux-header-use-in-libgcc.patch
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
508f3bca214d88531d739d761d07affc953689b1540905c73420b34c246e1e6b72588cf89f0e1462752633f8ddc88da8c0238be2a1b6e1c213829cecee7924cf ada-mips64.patch
80084d4f5984ea1c62f813c3c1fe7ce033d41d6cd5e6df3b10c649c0bbc2544ad0a58e7076fa28bf71d691df0211b07fc11eb0d5c9f462ef28eed4c3fbeeb9ee gcc-6.4-isl.patch
7912964bf3a985e9f870250d6e068f715582a4fb04270849d697a50e6aad0cf50df3d483ff80a0eb777d9940fd85526dd8d0b85da9bc71a5f2fbc07616263866 0001-i386-Move-struct-ix86_frame-to-machine_function.patch
baa27a4b912d8e27cd65a556b09cf45289a0e00e86dae3925f2923d1f3752080e80d80e159c996ef4156c4df1dfc3069114810a846672170ef3ae461ae0ab7e1 0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
6701d15000bdd7c4c98a8fece8c814f5e4e73603eecf84fe4dc5ac10f79b3074afba7c2cc9e51d08b2abade1c34cb0c944c08ead7a85db94e97158c752fd1aac 0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
-251
View File
@@ -1,251 +0,0 @@
From cc46a51d4ff8bc1c42b7e6ae472494733bed5c49 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Thu, 16 Feb 2017 07:53:53 +0000
Subject: [PATCH] graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
2017-02-16 Richard Biener <rguenther@suse.de>
* graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
* graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
(gcc_expression_from_isl_expr_int): Use generic isl_val interface.
* graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
(isl_val_int_from_wi): New function.
(extract_affine_gmp): Rename to ...
(extract_affine_wi): ... this, take a widest_int.
(extract_affine_int): Just wrap extract_affine_wi.
(add_param_constraints): Use isl_val_int_from_wi.
(add_loop_constraints): Likewise, and extract_affine_wi.
From-SVN: r245501
---
gcc/ChangeLog | 14 ++++++++
gcc/graphite-isl-ast-to-gimple.c | 30 +++++------------
gcc/graphite-sese-to-poly.c | 58 ++++++++++++++------------------
gcc/graphite.h | 2 +-
4 files changed, 50 insertions(+), 54 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24d9c1589f456..5fc6142eaa03f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2017-02-16 Richard Biener <rguenther@suse.de>
+
+ * graphite.h: Do not include isl/isl_val_gmp.h, instead include
+ isl/isl_val.h.
+ * graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
+ (gcc_expression_from_isl_expr_int): Use generic isl_val interface.
+ * graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
+ (isl_val_int_from_wi): New function.
+ (extract_affine_gmp): Rename to ...
+ (extract_affine_wi): ... this, take a widest_int.
+ (extract_affine_int): Just wrap extract_affine_wi.
+ (add_param_constraints): Use isl_val_int_from_wi.
+ (add_loop_constraints): Likewise, and extract_affine_wi.
+
2017-02-15 Jeff Law <law@redhat.com>
PR middle-end/79521
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index dbdae7a7c155d..ec5fb73d9b2bc 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -73,22 +73,6 @@ struct ast_build_info
bool is_parallelizable;
};
-/* Converts a GMP constant VAL to a tree and returns it. */
-
-static tree
-gmp_cst_to_tree (tree type, mpz_t val)
-{
- tree t = type ? type : integer_type_node;
- mpz_t tmp;
-
- mpz_init (tmp);
- mpz_set (tmp, val);
- wide_int wi = wi::from_mpz (t, tmp, true);
- mpz_clear (tmp);
-
- return wide_int_to_tree (t, wi);
-}
-
/* Verifies properties that GRAPHITE should maintain during translation. */
static inline void
@@ -325,16 +309,20 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
isl_val *val = isl_ast_expr_get_val (expr);
- mpz_t val_mpz_t;
- mpz_init (val_mpz_t);
+ size_t n = isl_val_n_abs_num_chunks (val, sizeof (HOST_WIDE_INT));
+ HOST_WIDE_INT *chunks = XALLOCAVEC (HOST_WIDE_INT, n);
tree res;
- if (isl_val_get_num_gmp (val, val_mpz_t) == -1)
+ if (isl_val_get_abs_num_chunks (val, sizeof (HOST_WIDE_INT), chunks) == -1)
res = NULL_TREE;
else
- res = gmp_cst_to_tree (type, val_mpz_t);
+ {
+ widest_int wi = widest_int::from_array (chunks, n, true);
+ if (isl_val_is_neg (val))
+ wi = -wi;
+ res = wide_int_to_tree (type, wi);
+ }
isl_val_free (val);
isl_ast_expr_free (expr);
- mpz_clear (val_mpz_t);
return res;
}
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ede96e5a3c299..8ff9a22e12916 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -55,7 +55,6 @@ along with GCC; see the file COPYING3. If not see
#include <isl/constraint.h>
#include <isl/aff.h>
#include <isl/val.h>
-#include <isl/val_gmp.h>
#include "graphite.h"
@@ -154,16 +153,32 @@ extract_affine_name (scop_p s, tree e, __isl_take isl_space *space)
return isl_pw_aff_alloc (dom, aff);
}
+/* Convert WI to a isl_val with CTX. */
+
+static __isl_give isl_val *
+isl_val_int_from_wi (isl_ctx *ctx, const widest_int &wi)
+{
+ if (wi::neg_p (wi, SIGNED))
+ {
+ widest_int mwi = -wi;
+ return isl_val_neg (isl_val_int_from_chunks (ctx, mwi.get_len (),
+ sizeof (HOST_WIDE_INT),
+ mwi.get_val ()));
+ }
+ return isl_val_int_from_chunks (ctx, wi.get_len (), sizeof (HOST_WIDE_INT),
+ wi.get_val ());
+}
+
/* Extract an affine expression from the gmp constant G. */
static isl_pw_aff *
-extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
+extract_affine_wi (const widest_int &g, __isl_take isl_space *space)
{
isl_local_space *ls = isl_local_space_from_space (isl_space_copy (space));
isl_aff *aff = isl_aff_zero_on_domain (ls);
isl_set *dom = isl_set_universe (space);
isl_ctx *ct = isl_aff_get_ctx (aff);
- isl_val *v = isl_val_int_from_gmp (ct, g);
+ isl_val *v = isl_val_int_from_wi (ct, g);
aff = isl_aff_add_constant_val (aff, v);
return isl_pw_aff_alloc (dom, aff);
@@ -174,13 +189,7 @@ extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
static isl_pw_aff *
extract_affine_int (tree e, __isl_take isl_space *space)
{
- mpz_t g;
-
- mpz_init (g);
- tree_int_to_gmp (e, g);
- isl_pw_aff *res = extract_affine_gmp (g, space);
- mpz_clear (g);
-
+ isl_pw_aff *res = extract_affine_wi (wi::to_widest (e), space);
return res;
}
@@ -411,15 +420,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (lb, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (lb));
v = isl_val_neg (v);
- mpz_clear (g);
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, 1);
@@ -431,15 +436,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (ub, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (ub));
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1);
@@ -773,11 +774,8 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
isl_local_space *ls = isl_local_space_from_space (space);
isl_constraint *c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- mpz_t g;
- mpz_init (g);
- tree_int_to_gmp (nb_iters, g);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v
+ = isl_val_int_from_wi (scop->isl_context, wi::to_widest (nb_iters));
c = isl_constraint_set_constant_val (c, v);
return isl_set_add_constraint (domain, c);
}
@@ -817,12 +815,9 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
/* NIT is an upper bound to NB_ITERS: "NIT >= NB_ITERS", although we
do not know whether the loop executes at least once. */
- mpz_t g;
- mpz_init (g);
- wi::to_mpz (nit, g, SIGNED);
- mpz_sub_ui (g, g, 1);
+ --nit;
- isl_pw_aff *approx = extract_affine_gmp (g, isl_space_copy (space));
+ isl_pw_aff *approx = extract_affine_wi (nit, isl_space_copy (space));
isl_set *x = isl_pw_aff_ge_set (approx, aff_nb_iters);
x = isl_set_project_out (x, isl_dim_set, 0,
isl_set_dim (x, isl_dim_set));
@@ -831,8 +826,7 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
ls = isl_local_space_from_space (space);
c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v = isl_val_int_from_wi (scop->isl_context, nit);
c = isl_constraint_set_constant_val (c, v);
if (dump_file)
diff --git a/gcc/graphite.h b/gcc/graphite.h
index 5103c614ff140..d22c4f2693f52 100644
--- a/gcc/graphite.h
+++ b/gcc/graphite.h
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#include <isl/options.h>
#include <isl/ctx.h>
-#include <isl/val_gmp.h>
+#include <isl/val.h>
#include <isl/set.h>
#include <isl/union_set.h>
#include <isl/map.h>
@@ -0,0 +1,40 @@
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
# DP: if the optimization level is > 0
---
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 3 +
2 files changed, 9 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7840,6 +7840,12 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
Index: b/gcc/c-family/c-cppbuiltin.c
===================================================================
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
+13 -65
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc6-armhf
# Based on: main/gcc6 (from postmarketOS)
CTARGET_ARCH=armhf
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,23 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc6-armhf
pkgver=9999
_pkgver=6.4.0
pkgrel=15
pkgrel=12
pkgdesc="Stage2 cross-compiler for armhf"
url="http://gcc.gnu.org"
# loongarch64: not relevant
# ppc64le: not relevant
# riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-armhf mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-armhf mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -70,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -94,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -134,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -219,6 +166,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
001_all_default-ssp-strong.patch
002_all_default-relro.patch
003_all_default-fortify-source.patch
005_all_default-as-needed.patch
011_all_default-warn-format-security.patch
012_all_default-warn-trampolines.patch
@@ -236,6 +184,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
207-static-pie.patch
libgcc-always-build-gcceh.a.patch
gcc-4.9-musl-fortify.patch
gcc-6.1-musl-libssp.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -259,8 +208,6 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-pure64-mips.patch
ada-mips64.patch
gcc-6.4-isl.patch
0001-i386-Move-struct-ix86_frame-to-machine_function.patch
0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -499,6 +446,7 @@ sha512sums="
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
51282fea54c7e616367bbeb2479ba13fec6f24eb47bd04e2071907b3b36273b2ff24676f46ef8d22f241c8ab4857307861eee076eab66797c3a50a8ecaa1809a 005_all_default-as-needed.patch
3398386dd1e079d6545dd9799adc799c6b80e3984fac6899d0e1a7ee21b66d0c7e53cddf17a65d590c883db750f9f79aaedd857355a8b9f7fb9476c906237919 011_all_default-warn-format-security.patch
9adb0d2b9b67dd957df6c609b8714c7c078efb52cd88770905c37c67827be8fc83d1125037b9c29d77db21ce78756aa2bb0bacdb0b98d869ac126da76a298e21 012_all_default-warn-trampolines.patch
@@ -514,6 +462,7 @@ fc0de05b36613b732a0222ea005c90653c6a40d6761b6894af2419272f4e74875f37e26af33a9b99
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
3287d5b443bea8ec64132bcabe869c738ae98ea8f1a86df1c5d18c927f8816edbfcefeefc47792dbbb2bcacf50319af00e01b3735d34525913b64350770ad453 207-static-pie.patch
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
@@ -533,7 +482,6 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
34a818d5be67eb1f34e44a80b83c28a9b9c17d37fc9fac639f490d6bb5b53ebe3318140d09c236a17d7c98f5a7792ae3d6cefccda8067a5e942d6305b9d1f87c fix-linux-header-use-in-libgcc.patch
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
508f3bca214d88531d739d761d07affc953689b1540905c73420b34c246e1e6b72588cf89f0e1462752633f8ddc88da8c0238be2a1b6e1c213829cecee7924cf ada-mips64.patch
80084d4f5984ea1c62f813c3c1fe7ce033d41d6cd5e6df3b10c649c0bbc2544ad0a58e7076fa28bf71d691df0211b07fc11eb0d5c9f462ef28eed4c3fbeeb9ee gcc-6.4-isl.patch
7912964bf3a985e9f870250d6e068f715582a4fb04270849d697a50e6aad0cf50df3d483ff80a0eb777d9940fd85526dd8d0b85da9bc71a5f2fbc07616263866 0001-i386-Move-struct-ix86_frame-to-machine_function.patch
baa27a4b912d8e27cd65a556b09cf45289a0e00e86dae3925f2923d1f3752080e80d80e159c996ef4156c4df1dfc3069114810a846672170ef3ae461ae0ab7e1 0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
6701d15000bdd7c4c98a8fece8c814f5e4e73603eecf84fe4dc5ac10f79b3074afba7c2cc9e51d08b2abade1c34cb0c944c08ead7a85db94e97158c752fd1aac 0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
-251
View File
@@ -1,251 +0,0 @@
From cc46a51d4ff8bc1c42b7e6ae472494733bed5c49 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Thu, 16 Feb 2017 07:53:53 +0000
Subject: [PATCH] graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
2017-02-16 Richard Biener <rguenther@suse.de>
* graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
* graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
(gcc_expression_from_isl_expr_int): Use generic isl_val interface.
* graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
(isl_val_int_from_wi): New function.
(extract_affine_gmp): Rename to ...
(extract_affine_wi): ... this, take a widest_int.
(extract_affine_int): Just wrap extract_affine_wi.
(add_param_constraints): Use isl_val_int_from_wi.
(add_loop_constraints): Likewise, and extract_affine_wi.
From-SVN: r245501
---
gcc/ChangeLog | 14 ++++++++
gcc/graphite-isl-ast-to-gimple.c | 30 +++++------------
gcc/graphite-sese-to-poly.c | 58 ++++++++++++++------------------
gcc/graphite.h | 2 +-
4 files changed, 50 insertions(+), 54 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24d9c1589f456..5fc6142eaa03f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2017-02-16 Richard Biener <rguenther@suse.de>
+
+ * graphite.h: Do not include isl/isl_val_gmp.h, instead include
+ isl/isl_val.h.
+ * graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
+ (gcc_expression_from_isl_expr_int): Use generic isl_val interface.
+ * graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
+ (isl_val_int_from_wi): New function.
+ (extract_affine_gmp): Rename to ...
+ (extract_affine_wi): ... this, take a widest_int.
+ (extract_affine_int): Just wrap extract_affine_wi.
+ (add_param_constraints): Use isl_val_int_from_wi.
+ (add_loop_constraints): Likewise, and extract_affine_wi.
+
2017-02-15 Jeff Law <law@redhat.com>
PR middle-end/79521
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index dbdae7a7c155d..ec5fb73d9b2bc 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -73,22 +73,6 @@ struct ast_build_info
bool is_parallelizable;
};
-/* Converts a GMP constant VAL to a tree and returns it. */
-
-static tree
-gmp_cst_to_tree (tree type, mpz_t val)
-{
- tree t = type ? type : integer_type_node;
- mpz_t tmp;
-
- mpz_init (tmp);
- mpz_set (tmp, val);
- wide_int wi = wi::from_mpz (t, tmp, true);
- mpz_clear (tmp);
-
- return wide_int_to_tree (t, wi);
-}
-
/* Verifies properties that GRAPHITE should maintain during translation. */
static inline void
@@ -325,16 +309,20 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
isl_val *val = isl_ast_expr_get_val (expr);
- mpz_t val_mpz_t;
- mpz_init (val_mpz_t);
+ size_t n = isl_val_n_abs_num_chunks (val, sizeof (HOST_WIDE_INT));
+ HOST_WIDE_INT *chunks = XALLOCAVEC (HOST_WIDE_INT, n);
tree res;
- if (isl_val_get_num_gmp (val, val_mpz_t) == -1)
+ if (isl_val_get_abs_num_chunks (val, sizeof (HOST_WIDE_INT), chunks) == -1)
res = NULL_TREE;
else
- res = gmp_cst_to_tree (type, val_mpz_t);
+ {
+ widest_int wi = widest_int::from_array (chunks, n, true);
+ if (isl_val_is_neg (val))
+ wi = -wi;
+ res = wide_int_to_tree (type, wi);
+ }
isl_val_free (val);
isl_ast_expr_free (expr);
- mpz_clear (val_mpz_t);
return res;
}
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ede96e5a3c299..8ff9a22e12916 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -55,7 +55,6 @@ along with GCC; see the file COPYING3. If not see
#include <isl/constraint.h>
#include <isl/aff.h>
#include <isl/val.h>
-#include <isl/val_gmp.h>
#include "graphite.h"
@@ -154,16 +153,32 @@ extract_affine_name (scop_p s, tree e, __isl_take isl_space *space)
return isl_pw_aff_alloc (dom, aff);
}
+/* Convert WI to a isl_val with CTX. */
+
+static __isl_give isl_val *
+isl_val_int_from_wi (isl_ctx *ctx, const widest_int &wi)
+{
+ if (wi::neg_p (wi, SIGNED))
+ {
+ widest_int mwi = -wi;
+ return isl_val_neg (isl_val_int_from_chunks (ctx, mwi.get_len (),
+ sizeof (HOST_WIDE_INT),
+ mwi.get_val ()));
+ }
+ return isl_val_int_from_chunks (ctx, wi.get_len (), sizeof (HOST_WIDE_INT),
+ wi.get_val ());
+}
+
/* Extract an affine expression from the gmp constant G. */
static isl_pw_aff *
-extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
+extract_affine_wi (const widest_int &g, __isl_take isl_space *space)
{
isl_local_space *ls = isl_local_space_from_space (isl_space_copy (space));
isl_aff *aff = isl_aff_zero_on_domain (ls);
isl_set *dom = isl_set_universe (space);
isl_ctx *ct = isl_aff_get_ctx (aff);
- isl_val *v = isl_val_int_from_gmp (ct, g);
+ isl_val *v = isl_val_int_from_wi (ct, g);
aff = isl_aff_add_constant_val (aff, v);
return isl_pw_aff_alloc (dom, aff);
@@ -174,13 +189,7 @@ extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
static isl_pw_aff *
extract_affine_int (tree e, __isl_take isl_space *space)
{
- mpz_t g;
-
- mpz_init (g);
- tree_int_to_gmp (e, g);
- isl_pw_aff *res = extract_affine_gmp (g, space);
- mpz_clear (g);
-
+ isl_pw_aff *res = extract_affine_wi (wi::to_widest (e), space);
return res;
}
@@ -411,15 +420,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (lb, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (lb));
v = isl_val_neg (v);
- mpz_clear (g);
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, 1);
@@ -431,15 +436,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (ub, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (ub));
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1);
@@ -773,11 +774,8 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
isl_local_space *ls = isl_local_space_from_space (space);
isl_constraint *c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- mpz_t g;
- mpz_init (g);
- tree_int_to_gmp (nb_iters, g);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v
+ = isl_val_int_from_wi (scop->isl_context, wi::to_widest (nb_iters));
c = isl_constraint_set_constant_val (c, v);
return isl_set_add_constraint (domain, c);
}
@@ -817,12 +815,9 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
/* NIT is an upper bound to NB_ITERS: "NIT >= NB_ITERS", although we
do not know whether the loop executes at least once. */
- mpz_t g;
- mpz_init (g);
- wi::to_mpz (nit, g, SIGNED);
- mpz_sub_ui (g, g, 1);
+ --nit;
- isl_pw_aff *approx = extract_affine_gmp (g, isl_space_copy (space));
+ isl_pw_aff *approx = extract_affine_wi (nit, isl_space_copy (space));
isl_set *x = isl_pw_aff_ge_set (approx, aff_nb_iters);
x = isl_set_project_out (x, isl_dim_set, 0,
isl_set_dim (x, isl_dim_set));
@@ -831,8 +826,7 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
ls = isl_local_space_from_space (space);
c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v = isl_val_int_from_wi (scop->isl_context, nit);
c = isl_constraint_set_constant_val (c, v);
if (dump_file)
diff --git a/gcc/graphite.h b/gcc/graphite.h
index 5103c614ff140..d22c4f2693f52 100644
--- a/gcc/graphite.h
+++ b/gcc/graphite.h
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#include <isl/options.h>
#include <isl/ctx.h>
-#include <isl/val_gmp.h>
+#include <isl/val.h>
#include <isl/set.h>
#include <isl/union_set.h>
#include <isl/map.h>
@@ -0,0 +1,40 @@
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
# DP: if the optimization level is > 0
---
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 3 +
2 files changed, 9 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7840,6 +7840,12 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
Index: b/gcc/c-family/c-cppbuiltin.c
===================================================================
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
+13 -65
View File
@@ -1,6 +1,7 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc6-armv7
# Based on: main/gcc6 (from postmarketOS)
CTARGET_ARCH=armv7
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
@@ -22,23 +23,19 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
maintainer=""
pkgname=gcc6-armv7
pkgver=9999
_pkgver=6.4.0
pkgrel=15
pkgrel=12
pkgdesc="Stage2 cross-compiler for armv7"
url="http://gcc.gnu.org"
# loongarch64: not relevant
# ppc64le: not relevant
# riscv64: doesn't build
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="binutils-armv7 mpc1 so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
depends="binutils-armv7 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armv7 binutils-armv7"
options="!strip !tracedeps toolchain"
options="!strip"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
@@ -70,23 +67,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
LIBATOMIC=false
LIBITM=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -94,23 +79,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS"
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
@@ -134,31 +106,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CFLAGS="${CFLAGS/-Werror=format-security/}"
CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fstack-clash-protection is not known to GCC 6
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/}"
CPPFLAGS="${CPPFLAGS/-fstack-clash-protection/}"
# and neither is -fno-plt
CFLAGS="${CFLAGS/-fno-plt/}"
CXXFLAGS="${CXXFLAGS/-fno-plt/}"
CPPFLAGS="${CPPFLAGS/-fno-plt/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS -g0 $CFLAGS -O2"
export CXXFLAGS="$CPPFLAGS -g0 $CXXFLAGS -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
# Go needs {set,make,swap}context, unimplemented in musl
@@ -219,6 +166,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
001_all_default-ssp-strong.patch
002_all_default-relro.patch
003_all_default-fortify-source.patch
005_all_default-as-needed.patch
011_all_default-warn-format-security.patch
012_all_default-warn-trampolines.patch
@@ -236,6 +184,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
207-static-pie.patch
libgcc-always-build-gcceh.a.patch
gcc-4.9-musl-fortify.patch
gcc-6.1-musl-libssp.patch
boehm-gc-musl.patch
gcc-pure64.patch
@@ -259,8 +208,6 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg
gcc-pure64-mips.patch
ada-mips64.patch
gcc-6.4-isl.patch
0001-i386-Move-struct-ix86_frame-to-machine_function.patch
0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -499,6 +446,7 @@ sha512sums="
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
51282fea54c7e616367bbeb2479ba13fec6f24eb47bd04e2071907b3b36273b2ff24676f46ef8d22f241c8ab4857307861eee076eab66797c3a50a8ecaa1809a 005_all_default-as-needed.patch
3398386dd1e079d6545dd9799adc799c6b80e3984fac6899d0e1a7ee21b66d0c7e53cddf17a65d590c883db750f9f79aaedd857355a8b9f7fb9476c906237919 011_all_default-warn-format-security.patch
9adb0d2b9b67dd957df6c609b8714c7c078efb52cd88770905c37c67827be8fc83d1125037b9c29d77db21ce78756aa2bb0bacdb0b98d869ac126da76a298e21 012_all_default-warn-trampolines.patch
@@ -514,6 +462,7 @@ fc0de05b36613b732a0222ea005c90653c6a40d6761b6894af2419272f4e74875f37e26af33a9b99
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
3287d5b443bea8ec64132bcabe869c738ae98ea8f1a86df1c5d18c927f8816edbfcefeefc47792dbbb2bcacf50319af00e01b3735d34525913b64350770ad453 207-static-pie.patch
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
@@ -533,7 +482,6 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
34a818d5be67eb1f34e44a80b83c28a9b9c17d37fc9fac639f490d6bb5b53ebe3318140d09c236a17d7c98f5a7792ae3d6cefccda8067a5e942d6305b9d1f87c fix-linux-header-use-in-libgcc.patch
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
508f3bca214d88531d739d761d07affc953689b1540905c73420b34c246e1e6b72588cf89f0e1462752633f8ddc88da8c0238be2a1b6e1c213829cecee7924cf ada-mips64.patch
80084d4f5984ea1c62f813c3c1fe7ce033d41d6cd5e6df3b10c649c0bbc2544ad0a58e7076fa28bf71d691df0211b07fc11eb0d5c9f462ef28eed4c3fbeeb9ee gcc-6.4-isl.patch
7912964bf3a985e9f870250d6e068f715582a4fb04270849d697a50e6aad0cf50df3d483ff80a0eb777d9940fd85526dd8d0b85da9bc71a5f2fbc07616263866 0001-i386-Move-struct-ix86_frame-to-machine_function.patch
baa27a4b912d8e27cd65a556b09cf45289a0e00e86dae3925f2923d1f3752080e80d80e159c996ef4156c4df1dfc3069114810a846672170ef3ae461ae0ab7e1 0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
6701d15000bdd7c4c98a8fece8c814f5e4e73603eecf84fe4dc5ac10f79b3074afba7c2cc9e51d08b2abade1c34cb0c944c08ead7a85db94e97158c752fd1aac 0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
@@ -0,0 +1,11 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
-251
View File
@@ -1,251 +0,0 @@
From cc46a51d4ff8bc1c42b7e6ae472494733bed5c49 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Thu, 16 Feb 2017 07:53:53 +0000
Subject: [PATCH] graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
2017-02-16 Richard Biener <rguenther@suse.de>
* graphite.h: Do not include isl/isl_val_gmp.h, instead include
isl/isl_val.h.
* graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
(gcc_expression_from_isl_expr_int): Use generic isl_val interface.
* graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
(isl_val_int_from_wi): New function.
(extract_affine_gmp): Rename to ...
(extract_affine_wi): ... this, take a widest_int.
(extract_affine_int): Just wrap extract_affine_wi.
(add_param_constraints): Use isl_val_int_from_wi.
(add_loop_constraints): Likewise, and extract_affine_wi.
From-SVN: r245501
---
gcc/ChangeLog | 14 ++++++++
gcc/graphite-isl-ast-to-gimple.c | 30 +++++------------
gcc/graphite-sese-to-poly.c | 58 ++++++++++++++------------------
gcc/graphite.h | 2 +-
4 files changed, 50 insertions(+), 54 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24d9c1589f456..5fc6142eaa03f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2017-02-16 Richard Biener <rguenther@suse.de>
+
+ * graphite.h: Do not include isl/isl_val_gmp.h, instead include
+ isl/isl_val.h.
+ * graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove.
+ (gcc_expression_from_isl_expr_int): Use generic isl_val interface.
+ * graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h.
+ (isl_val_int_from_wi): New function.
+ (extract_affine_gmp): Rename to ...
+ (extract_affine_wi): ... this, take a widest_int.
+ (extract_affine_int): Just wrap extract_affine_wi.
+ (add_param_constraints): Use isl_val_int_from_wi.
+ (add_loop_constraints): Likewise, and extract_affine_wi.
+
2017-02-15 Jeff Law <law@redhat.com>
PR middle-end/79521
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index dbdae7a7c155d..ec5fb73d9b2bc 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -73,22 +73,6 @@ struct ast_build_info
bool is_parallelizable;
};
-/* Converts a GMP constant VAL to a tree and returns it. */
-
-static tree
-gmp_cst_to_tree (tree type, mpz_t val)
-{
- tree t = type ? type : integer_type_node;
- mpz_t tmp;
-
- mpz_init (tmp);
- mpz_set (tmp, val);
- wide_int wi = wi::from_mpz (t, tmp, true);
- mpz_clear (tmp);
-
- return wide_int_to_tree (t, wi);
-}
-
/* Verifies properties that GRAPHITE should maintain during translation. */
static inline void
@@ -325,16 +309,20 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
isl_val *val = isl_ast_expr_get_val (expr);
- mpz_t val_mpz_t;
- mpz_init (val_mpz_t);
+ size_t n = isl_val_n_abs_num_chunks (val, sizeof (HOST_WIDE_INT));
+ HOST_WIDE_INT *chunks = XALLOCAVEC (HOST_WIDE_INT, n);
tree res;
- if (isl_val_get_num_gmp (val, val_mpz_t) == -1)
+ if (isl_val_get_abs_num_chunks (val, sizeof (HOST_WIDE_INT), chunks) == -1)
res = NULL_TREE;
else
- res = gmp_cst_to_tree (type, val_mpz_t);
+ {
+ widest_int wi = widest_int::from_array (chunks, n, true);
+ if (isl_val_is_neg (val))
+ wi = -wi;
+ res = wide_int_to_tree (type, wi);
+ }
isl_val_free (val);
isl_ast_expr_free (expr);
- mpz_clear (val_mpz_t);
return res;
}
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ede96e5a3c299..8ff9a22e12916 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -55,7 +55,6 @@ along with GCC; see the file COPYING3. If not see
#include <isl/constraint.h>
#include <isl/aff.h>
#include <isl/val.h>
-#include <isl/val_gmp.h>
#include "graphite.h"
@@ -154,16 +153,32 @@ extract_affine_name (scop_p s, tree e, __isl_take isl_space *space)
return isl_pw_aff_alloc (dom, aff);
}
+/* Convert WI to a isl_val with CTX. */
+
+static __isl_give isl_val *
+isl_val_int_from_wi (isl_ctx *ctx, const widest_int &wi)
+{
+ if (wi::neg_p (wi, SIGNED))
+ {
+ widest_int mwi = -wi;
+ return isl_val_neg (isl_val_int_from_chunks (ctx, mwi.get_len (),
+ sizeof (HOST_WIDE_INT),
+ mwi.get_val ()));
+ }
+ return isl_val_int_from_chunks (ctx, wi.get_len (), sizeof (HOST_WIDE_INT),
+ wi.get_val ());
+}
+
/* Extract an affine expression from the gmp constant G. */
static isl_pw_aff *
-extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
+extract_affine_wi (const widest_int &g, __isl_take isl_space *space)
{
isl_local_space *ls = isl_local_space_from_space (isl_space_copy (space));
isl_aff *aff = isl_aff_zero_on_domain (ls);
isl_set *dom = isl_set_universe (space);
isl_ctx *ct = isl_aff_get_ctx (aff);
- isl_val *v = isl_val_int_from_gmp (ct, g);
+ isl_val *v = isl_val_int_from_wi (ct, g);
aff = isl_aff_add_constant_val (aff, v);
return isl_pw_aff_alloc (dom, aff);
@@ -174,13 +189,7 @@ extract_affine_gmp (mpz_t g, __isl_take isl_space *space)
static isl_pw_aff *
extract_affine_int (tree e, __isl_take isl_space *space)
{
- mpz_t g;
-
- mpz_init (g);
- tree_int_to_gmp (e, g);
- isl_pw_aff *res = extract_affine_gmp (g, space);
- mpz_clear (g);
-
+ isl_pw_aff *res = extract_affine_wi (wi::to_widest (e), space);
return res;
}
@@ -411,15 +420,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (lb, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (lb));
v = isl_val_neg (v);
- mpz_clear (g);
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, 1);
@@ -431,15 +436,11 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
{
isl_space *space = isl_set_get_space (scop->param_context);
isl_constraint *c;
- mpz_t g;
isl_val *v;
c = isl_inequality_alloc (isl_local_space_from_space (space));
- mpz_init (g);
- tree_int_to_gmp (ub, g);
- v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ v = isl_val_int_from_wi (scop->isl_context, wi::to_widest (ub));
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1);
@@ -773,11 +774,8 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
isl_local_space *ls = isl_local_space_from_space (space);
isl_constraint *c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- mpz_t g;
- mpz_init (g);
- tree_int_to_gmp (nb_iters, g);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v
+ = isl_val_int_from_wi (scop->isl_context, wi::to_widest (nb_iters));
c = isl_constraint_set_constant_val (c, v);
return isl_set_add_constraint (domain, c);
}
@@ -817,12 +815,9 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
/* NIT is an upper bound to NB_ITERS: "NIT >= NB_ITERS", although we
do not know whether the loop executes at least once. */
- mpz_t g;
- mpz_init (g);
- wi::to_mpz (nit, g, SIGNED);
- mpz_sub_ui (g, g, 1);
+ --nit;
- isl_pw_aff *approx = extract_affine_gmp (g, isl_space_copy (space));
+ isl_pw_aff *approx = extract_affine_wi (nit, isl_space_copy (space));
isl_set *x = isl_pw_aff_ge_set (approx, aff_nb_iters);
x = isl_set_project_out (x, isl_dim_set, 0,
isl_set_dim (x, isl_dim_set));
@@ -831,8 +826,7 @@ add_loop_constraints (scop_p scop, __isl_take isl_set *domain, loop_p loop,
ls = isl_local_space_from_space (space);
c = isl_inequality_alloc (ls);
c = isl_constraint_set_coefficient_si (c, isl_dim_set, loop_index, -1);
- isl_val *v = isl_val_int_from_gmp (scop->isl_context, g);
- mpz_clear (g);
+ isl_val *v = isl_val_int_from_wi (scop->isl_context, nit);
c = isl_constraint_set_constant_val (c, v);
if (dump_file)
diff --git a/gcc/graphite.h b/gcc/graphite.h
index 5103c614ff140..d22c4f2693f52 100644
--- a/gcc/graphite.h
+++ b/gcc/graphite.h
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#include <isl/options.h>
#include <isl/ctx.h>
-#include <isl/val_gmp.h>
+#include <isl/val.h>
#include <isl/set.h>
#include <isl/union_set.h>
#include <isl/map.h>
+3 -4
View File
@@ -1,10 +1,9 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen grub-efi-x86
maintainer=""
pkgname=grub-efi-x86
pkgver=2.14
pkgrel=0
pkgver=2.12
pkgrel=8
_arch="x86"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -23,5 +22,5 @@ package() {
}
sha512sums="
a092d829a6726702f7c21047c2b3bc27b5ef50ab928f60831a4107659a0ea0d670cc81e0d5b7ed047e06f990bffa9c032633b4f0b15a6920c9fcff37cd39e465 grub-efi-2.14-r0-x86-edge.apk
cca57dbed340ff4f9cc0f12c509c8213e8c83edbf80c8ace9ab5a46e7d48c19a7c8cb57a1c86bab3324dcfc071e289045e13ddf3b5011923e1a1a27713e86e0f grub-efi-2.12-r8-x86-edge.apk
"
-1
View File
@@ -1,4 +1,3 @@
maintainer=""
pkgname=grub-x86
pkgver=1
pkgrel=2
+4 -5
View File
@@ -6,10 +6,9 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-aarch64
pkgver=1.2.6
pkgrel=2
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-aarch64:package_dev"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
03134d5e7b840db09a10f1f34254840dd86d69f960f3eb38a0944df06d897cc603a1a82af380f0ee975a10708c51430d77618debc8ae500d1bbef705fd77681b musl-1.2.6-r2-aarch64-edge.apk
d95f9907bd7c0e818ffde40481bf0a8c23ca038e83f260f4ecb583fe164a581c978f76df3623be312400d75e23e2ca4b0742d59855cd908a9d411829ac017de7 musl-dev-1.2.6-r2-aarch64-edge.apk
dce3b131910f7596f8f1d7c2662805b619a151313c7822cf56a7529b6a8b3baf708bfab649be42d920b173dbd7caf33c667ab120779728b9c271439e1190d4ce musl-1.2.5-r21-aarch64-edge.apk
e635424ca037e3d949f793de68218e43fc25f0633aa27d1c330d96d97a8473643683f37bd545022bcb25c8298b8ed54288cf48ccc9633b6dda849cfa187d1019 musl-dev-1.2.5-r21-aarch64-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-armhf
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-armhf:package_dev"
_arch="armhf"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
0f2a24ee0f23612adfb578ccda1b9dccd24a37f78c90d1ba655cdcf0e094dd95f4ec34288c87f98804714cb8fc0865bf0fe079c7a1902b39c4d992bb46e10e64 musl-1.2.6-r2-armhf-edge.apk
8b5175848776267bee95be058595e538eaa06cb63522d519b6760920faac40c16fa59a57a6be545c121f1e4d1c7cd2e4b2b8fdded57cbdb7e8585b08ca349d86 musl-dev-1.2.6-r2-armhf-edge.apk
b5411d6b4e03c1c8767906733d091e3438b5ca61959395e5de969a311c131d460052d6ad0c776740bce51a57ea7956ceb11e76355ddc9cc7b045804dfea9927e musl-1.2.5-r21-armhf-edge.apk
cb52d3a273cfe102f1c782412d0fa5cb24d735527c99e6702aa456d04655bb09f2939c8c64db86c7e256579cc4179c5fbf1f56b6461596a5e298494c4464c35d musl-dev-1.2.5-r21-armhf-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-armv7
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-armv7:package_dev"
_arch="armv7"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
a5847eb6b71a52d8b348e8ef09953bf9df858f3d3a141a75bba8db7525a83b3143e7ead4b00bdddffad0a21af6a9c01e4d4c8bb27aa8d69ce13dceb58eb43309 musl-1.2.6-r2-armv7-edge.apk
01ed9d094bee237e8794678572769ec456709e9f58511be2e301f495518ab82f86ceedc2ad03727fe43925c5e3a5a0f18a1d7b244f57107c3f7593edd14e84c4 musl-dev-1.2.6-r2-armv7-edge.apk
440fa575b03ca4253d9d25fbe5a59ae3164ba945c012d12224ef829786afa14c654a2ff3868fedbd200bbbadd5789539f6d88def7831ca207e63a1d753021e5e musl-1.2.5-r21-armv7-edge.apk
3b7ce82a7ab3c02cb302614898ca68356ed18512f37f3632b1ef8df44b242b40b528c60c42cc19cb6b31c1e197019bf712713eb3b7998b4efbf96dc2aac29723 musl-dev-1.2.5-r21-armv7-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-loongarch64
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-loongarch64:package_dev"
_arch="loongarch64"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
112265a3a4c20cbc03a67fe23c69338332e127d51d3a4ad137547fcc8554a8878425f74f46765a032ba1c36c2782a1f3dcf3102e7bbb3c93a671fb85eba4e000 musl-1.2.6-r2-loongarch64-edge.apk
45a0953693e6eaa3434e799bc79608dccedfb711cf816ac7dc1bb7ab15ed4a934dfbd0b2ad0b286ac8b8b00f901b99c8e4b06b9f7e50fb69e2d96cc83bbc0304 musl-dev-1.2.6-r2-loongarch64-edge.apk
ec3cafd077ad5d07aadd75fdefadb6bcb625979eec47f2ac4ac675471c4d57c956c563bbcb1a455fe30b72212047cff8a1d7f4e4d143ad681a1f3c71c98614fd musl-1.2.5-r21-loongarch64-edge.apk
6bfff1beebaa45f409e414e3213c1260a98fc6a1345e11f41d23dcc1a7d37380ae21c538e28e72ab1c4ce5370f3e776dad6e827f741358ce85888bf5ab4e027c musl-dev-1.2.5-r21-loongarch64-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-ppc64le
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-ppc64le:package_dev"
_arch="ppc64le"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
fa1484bf04b70b27bf6540d8b3f506a334623a160c7d86dd5c58f418dd751eb641c35a0166b485c8ba1bba57f4e929b277352eae5e55cd740a0b73e741f72cc7 musl-1.2.6-r2-ppc64le-edge.apk
4ea8db19500bcc05e31c1e9c37e43742b150e9218ba585f98b4cde918abd1896431797921f19ff6a82f42d2db245ccfe368ab552c01637d17f19a8ff33db0396 musl-dev-1.2.6-r2-ppc64le-edge.apk
0e2720a11cd9c4417c96301d71f97dcc65ebe990e0115628aa30fe95debce12db75a716def86b4326074110c5e515f5f6876691c693c72ae211d641a43ba73cf musl-1.2.5-r21-ppc64le-edge.apk
fcea40a1616b49350f90fb1f0ba99ea8e7cf40544044133553ef4d70f24376d489fa5ff85c15aa4550e4283915eb172c14429ef439a51cd1ec7e08f3a231ce04 musl-dev-1.2.5-r21-ppc64le-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-riscv64
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-riscv64:package_dev"
_arch="riscv64"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
3113c288563199b52e9fbb93a34e16eb87bfe4b7e0872ba0349eec1fc532ea8583565f862b82130fcf416fc006ff661afad1bf549e25d688aa6b055287089c39 musl-1.2.6-r2-riscv64-edge.apk
8bf4503998a50581af7965407bd25aa41c2716526e6db7683dfb9cce134d9cf401bdeeafd060fd6e5d83ac52852e745c6eafdd406dd59d8f5eea256445f21a3d musl-dev-1.2.6-r2-riscv64-edge.apk
c3f9b76c99bd9c1426f4f87b1d60405e3b4fc6c93451d08b72338496b4cefae6692ef0b0ab9f09b78317d944289060b38c0a7072737d92b3f75fbb0fd8e81132 musl-1.2.5-r21-riscv64-edge.apk
2b28646a759b54c3b2846499c04df7d9b8195da8892a004cbefb69625bbbb874bbc1748ce3d49738931e1e321ab5d90482b08783d07efe28f55d8d1657d451dd musl-dev-1.2.5-r21-riscv64-edge.apk
"
+5 -6
View File
@@ -6,11 +6,10 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
maintainer=""
pkgname=musl-x86
pkgver=1.2.6
pkgrel=2
arch="aarch64 x86_64"
pkgver=1.2.5
pkgrel=21
arch="x86_64"
subpackages="musl-dev-x86:package_dev"
_arch="x86"
@@ -58,6 +57,6 @@ package_dev() {
}
sha512sums="
f731bafa153e7b3ea212cc4e13d5c843227374a13530188131184c32f13907057f66af65ff7889a01f7c2b46bae7087f712b09e97ff879e2ed263ebec37432bf musl-1.2.6-r2-x86-edge.apk
afc7894a31de08bcfa6b28604625ad7e6cf8cd61394d34bd2ed50ea07c9d4e7ad212cb668439f51599ce2c946a326e196ee01503fe196a4a8dce973ae51d57ef musl-dev-1.2.6-r2-x86-edge.apk
6b0da8df450dc4f9b15851a0cdcfc8249f5cc6bedf91ce0d04d6b810b6d2970337345bb8ea83d6b66927be24b88395779b0f660c3511ac2adedbbae76e5c2dc2 musl-1.2.5-r21-x86-edge.apk
771c4002ede113c134bc00586dcafba4004c3860ca715723d680c5d8916d42a0a888094276d24405a8e6a39ff79e4690f0021fff075909398ae3f7379cdb6c25 musl-dev-1.2.5-r21-x86-edge.apk
"
Loaded 100 of 3973 files, more files were not shown because too many files have changed in this diff. Show more