Compare commits
51 Commits
8c7e99acd9
...
248fe447bd
Author | SHA1 | Date |
---|---|---|
Oliver Smith | 248fe447bd | |
Oliver Smith | 40679f7126 | |
Oliver Smith | aaeff96d23 | |
Oliver Smith | 54268b72e1 | |
Oliver Smith | 550b9b3466 | |
Oliver Smith | dac8b27738 | |
David Wronek | 8385e8db8f | |
David Wronek | b9e7a98c07 | |
Oliver Smith | b262609199 | |
Oliver Smith | 22e0f64095 | |
Oliver Smith | 4c7d2459f5 | |
Oliver Smith | b9ab935e42 | |
Luca Weiss | d20fc49170 | |
Luca Weiss | f7fb1fe078 | |
Luca Weiss | e468fc518e | |
Luca Weiss | 1fee644dce | |
Oliver Smith | 0c18c664aa | |
Song Fuchang | d650ed4a14 | |
Luca Weiss | 52530caaf8 | |
Oliver Smith | 0132af72b5 | |
Oliver Smith | b41e4a418f | |
Raymond Hackley | e5d580e98a | |
Salvatore Stella | 3567b7c123 | |
Oliver Smith | 21b86f7f64 | |
Oliver Smith | c88a18d3f6 | |
Oliver Smith | 8d736c5fcc | |
Newbyte | b9485902cf | |
Jami Kettunen | bd4a7d5d3f | |
Jami Kettunen | 5b3cd7a7a6 | |
Jami Kettunen | de890c83e7 | |
Jami Kettunen | 255e69be5e | |
alikates | c36e4a43ac | |
Newbyte | fe28a39f79 | |
Oliver Smith | e527a159ad | |
Luca Weiss | 58c39f2cb2 | |
Shinjo Park | 87f7520e51 | |
Jami Kettunen | c0cec06df8 | |
Newbyte | 22117de4bd | |
Anton Bambura | dc1433ead0 | |
Minecrell | f1cbcb7b3b | |
Oliver Smith | cc90bc81f0 | |
Oliver Smith | 7b09cc7546 | |
Oliver Smith | 6a74109154 | |
Oliver Smith | 903ed4ee30 | |
Oliver Smith | 682ee74ea6 | |
Oliver Smith | 12948eeb3d | |
Oliver Smith | e91dbefd16 | |
Oliver Smith | c898b13296 | |
Oliver Smith | 6b520d2d26 | |
Oliver Smith | 03303ef7bc | |
Bart Ribbers | 741be5f521 |
|
@ -219,6 +219,7 @@ set_alias_make() {
|
||||||
# Build make command
|
# Build make command
|
||||||
cmd="echo '*** pmbootstrap envkernel.sh active for $PWD! ***';"
|
cmd="echo '*** pmbootstrap envkernel.sh active for $PWD! ***';"
|
||||||
cmd="$cmd pmbootstrap -q chroot --user --"
|
cmd="$cmd pmbootstrap -q chroot --user --"
|
||||||
|
cmd="$cmd CCACHE_DISABLE=1"
|
||||||
cmd="$cmd ARCH=$arch"
|
cmd="$cmd ARCH=$arch"
|
||||||
if [ "$need_cross_compiler" = 1 ]; then
|
if [ "$need_cross_compiler" = 1 ]; then
|
||||||
cmd="$cmd CROSS_COMPILE=$cross_compiler"
|
cmd="$cmd CROSS_COMPILE=$cross_compiler"
|
||||||
|
|
|
@ -16,45 +16,12 @@ def generate(args, pkgname):
|
||||||
"pkgname": pkgname,
|
"pkgname": pkgname,
|
||||||
"pkgdesc": f"Tools necessary to build programs for {arch} targets",
|
"pkgdesc": f"Tools necessary to build programs for {arch} targets",
|
||||||
"arch": pmb.config.arch_native,
|
"arch": pmb.config.arch_native,
|
||||||
"makedepends_build": "",
|
|
||||||
"makedepends_host": "",
|
|
||||||
"makedepends": "gettext libtool autoconf automake bison texinfo",
|
|
||||||
"subpackages": "",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_functions = {
|
below_header = """
|
||||||
"build": """
|
CTARGET_ARCH=""" + arch + """
|
||||||
_target="$(arch_to_hostspec """ + arch + """)"
|
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||||
"$builddir"/configure \\
|
"""
|
||||||
--build="$CBUILD" \\
|
|
||||||
--target=$_target \\
|
|
||||||
--with-lib-path=/usr/lib \\
|
|
||||||
--prefix=/usr \\
|
|
||||||
--with-sysroot=/usr/$_target \\
|
|
||||||
--enable-ld=default \\
|
|
||||||
--enable-gold=yes \\
|
|
||||||
--enable-plugins \\
|
|
||||||
--enable-deterministic-archives \\
|
|
||||||
--disable-multilib \\
|
|
||||||
--disable-werror \\
|
|
||||||
--disable-nls
|
|
||||||
make
|
|
||||||
""",
|
|
||||||
"package": """
|
|
||||||
make install DESTDIR="$pkgdir"
|
|
||||||
|
|
||||||
# remove man, info folders
|
|
||||||
rm -rf "$pkgdir"/usr/share
|
|
||||||
|
|
||||||
# remove files that conflict with non-cross binutils
|
|
||||||
rm -rf "$pkgdir"/usr/lib/bfd-plugins
|
|
||||||
""",
|
|
||||||
"libs": None,
|
|
||||||
"gold": None,
|
|
||||||
}
|
|
||||||
|
|
||||||
replace_simple = {"\tsubpackages=*": "\tsubpackages=\"\""}
|
|
||||||
|
|
||||||
pmb.aportgen.core.rewrite(args, pkgname, "main/binutils", fields,
|
pmb.aportgen.core.rewrite(args, pkgname, "main/binutils", fields,
|
||||||
"binutils", replace_functions, replace_simple,
|
"binutils", below_header=below_header)
|
||||||
remove_indent=8)
|
|
||||||
|
|
|
@ -142,7 +142,14 @@ def generate_deviceinfo_fastboot_content(bootimg=None):
|
||||||
content += f"""\
|
content += f"""\
|
||||||
deviceinfo_header_version="{bootimg["header_version"]}"
|
deviceinfo_header_version="{bootimg["header_version"]}"
|
||||||
"""
|
"""
|
||||||
else:
|
|
||||||
|
if bootimg["header_version"] == "2":
|
||||||
|
content += f"""\
|
||||||
|
deviceinfo_append_dtb="false"
|
||||||
|
deviceinfo_flash_offset_dtb="{bootimg["dtb_offset"]}"
|
||||||
|
"""
|
||||||
|
|
||||||
|
if "base" in bootimg.keys():
|
||||||
content += f"""\
|
content += f"""\
|
||||||
deviceinfo_flash_offset_base="{bootimg["base"]}"
|
deviceinfo_flash_offset_base="{bootimg["base"]}"
|
||||||
deviceinfo_flash_offset_kernel="{bootimg["kernel_offset"]}"
|
deviceinfo_flash_offset_kernel="{bootimg["kernel_offset"]}"
|
||||||
|
|
|
@ -29,16 +29,16 @@ def generate(args, pkgname):
|
||||||
"pkgname": pkgname,
|
"pkgname": pkgname,
|
||||||
"pkgdesc": f"Stage2 cross-compiler for {arch}",
|
"pkgdesc": f"Stage2 cross-compiler for {arch}",
|
||||||
"arch": pmb.config.arch_native,
|
"arch": pmb.config.arch_native,
|
||||||
"depends": f"isl binutils-{arch} mpc1",
|
"depends": f"binutils-{arch} mpc1",
|
||||||
"makedepends_build": "gcc g++ bison flex texinfo gawk zip"
|
"makedepends_build": "gcc g++ bison flex texinfo gawk zip"
|
||||||
" gmp-dev mpfr-dev mpc1-dev zlib-dev",
|
" gmp-dev mpfr-dev mpc1-dev zlib-dev",
|
||||||
"makedepends_host": "linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev"
|
"makedepends_host": "linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev"
|
||||||
f" zlib-dev musl-dev-{arch} binutils-{arch}",
|
f" zlib-dev musl-dev-{arch} binutils-{arch}",
|
||||||
"subpackages": f"g++-{arch}:gpp" if prefix == "gcc" else "",
|
"subpackages": "",
|
||||||
|
|
||||||
# gcc6: options is already there, so we need to replace it and not only
|
# gcc6: options is already there, so we need to replace it and not only
|
||||||
# set it below the header like done below.
|
# set it below the header like done below.
|
||||||
"options": "!strip !tracedeps",
|
"options": "!strip",
|
||||||
|
|
||||||
"LIBGOMP": "false",
|
"LIBGOMP": "false",
|
||||||
"LIBGCC": "false",
|
"LIBGCC": "false",
|
||||||
|
@ -46,6 +46,11 @@ def generate(args, pkgname):
|
||||||
"LIBITM": "false",
|
"LIBITM": "false",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Latest gcc only, not gcc4 and gcc6
|
||||||
|
if prefix == "gcc":
|
||||||
|
fields["subpackages"] = f"g++-{arch}:gpp" \
|
||||||
|
f" libstdc++-dev-{arch}:libcxx_dev"
|
||||||
|
|
||||||
below_header = "CTARGET_ARCH=" + arch + """
|
below_header = "CTARGET_ARCH=" + arch + """
|
||||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||||
LANG_D=false
|
LANG_D=false
|
||||||
|
@ -54,7 +59,7 @@ def generate(args, pkgname):
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
options="!strip !tracedeps"
|
options="!strip"
|
||||||
|
|
||||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||||
# when this variable matches "no*"
|
# when this variable matches "no*"
|
||||||
|
@ -78,6 +83,9 @@ def generate(args, pkgname):
|
||||||
# use CBUILDROOT as sysroot. In the original APKBUILD this is a local
|
# use CBUILDROOT as sysroot. In the original APKBUILD this is a local
|
||||||
# variable, but we make it a global one.
|
# variable, but we make it a global one.
|
||||||
'*_cross_configure=*': None,
|
'*_cross_configure=*': None,
|
||||||
|
|
||||||
|
# Do not build foreign arch libgcc, we use the one from Alpine (#2168)
|
||||||
|
'_libgcc=true*': '_libgcc=false',
|
||||||
}
|
}
|
||||||
|
|
||||||
pmb.aportgen.core.rewrite(args, pkgname, based_on, fields,
|
pmb.aportgen.core.rewrite(args, pkgname, based_on, fields,
|
||||||
|
|
|
@ -22,6 +22,12 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches):
|
||||||
downstreamkernel_package "$builddir" "$pkgdir" "$_carch\" \\
|
downstreamkernel_package "$builddir" "$pkgdir" "$_carch\" \\
|
||||||
"$_flavor" "$_outdir\""""
|
"$_flavor" "$_outdir\""""
|
||||||
|
|
||||||
|
if deviceinfo.get("header_version") == "2":
|
||||||
|
package += """
|
||||||
|
|
||||||
|
make dtbs_install O="$_outdir" ARCH="$_carch" \\
|
||||||
|
INSTALL_DTBS_PATH="$pkgdir\"/boot/dtbs"""
|
||||||
|
|
||||||
if deviceinfo["bootimg_qcdt"] == "true":
|
if deviceinfo["bootimg_qcdt"] == "true":
|
||||||
build += """\n
|
build += """\n
|
||||||
# Master DTB (deviceinfo_bootimg_qcdt)"""
|
# Master DTB (deviceinfo_bootimg_qcdt)"""
|
||||||
|
|
|
@ -227,6 +227,14 @@ def init_buildenv(args, apkbuild, arch, strict=False, force=False, cross=None,
|
||||||
pmb.chroot.distccd.start(args, arch)
|
pmb.chroot.distccd.start(args, arch)
|
||||||
if cross == "crossdirect":
|
if cross == "crossdirect":
|
||||||
pmb.chroot.mount_native_into_foreign(args, suffix)
|
pmb.chroot.mount_native_into_foreign(args, suffix)
|
||||||
|
# Workaround: this specific version currently in pmaports.git master
|
||||||
|
# was built with !tracedeps, so it doesn't pull in the isl dependency
|
||||||
|
# and we need to install it manually. Doing this is easier than bumping
|
||||||
|
# the pkgrel and going out of sync with Alpine's gcc package. This
|
||||||
|
# workaround can be removed once a newer gcc is in Alpine and we
|
||||||
|
# rebuild our cross gcc based on the new APKBUILD. See pmaports#1732.
|
||||||
|
if get_gcc_version(args, arch) == "12.2.1_git20220924-r2":
|
||||||
|
pmb.chroot.apk.install(args, ["isl25"], build=False)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -153,10 +153,12 @@ def menuconfig(args, pkgname, use_oldconfig):
|
||||||
pmb.build.checksum.update(args, pkgname)
|
pmb.build.checksum.update(args, pkgname)
|
||||||
|
|
||||||
# Check config
|
# Check config
|
||||||
pmb.parse.kconfig.check(args, apkbuild["_flavor"], force_anbox_check=False,
|
pmb.parse.kconfig.check(args, apkbuild["_flavor"],
|
||||||
|
force_waydroid_check=False,
|
||||||
force_nftables_check=False,
|
force_nftables_check=False,
|
||||||
force_containers_check=False,
|
force_containers_check=False,
|
||||||
force_zram_check=False,
|
force_zram_check=False,
|
||||||
force_netboot_check=False,
|
force_netboot_check=False,
|
||||||
|
force_community_check=False,
|
||||||
force_uefi_check=False,
|
force_uefi_check=False,
|
||||||
details=True)
|
details=True)
|
||||||
|
|
|
@ -87,166 +87,110 @@ def check_min_version(args, suffix="native"):
|
||||||
pmb.helpers.other.cache["apk_min_version_checked"].append(suffix)
|
pmb.helpers.other.cache["apk_min_version_checked"].append(suffix)
|
||||||
|
|
||||||
|
|
||||||
def install_is_necessary(args, build, arch, package, packages_installed):
|
def install_build(args, package, arch):
|
||||||
"""
|
"""
|
||||||
This function optionally builds an out of date package, and checks if the
|
Build an outdated package unless pmbootstrap was invoked with
|
||||||
version installed inside a chroot is up to date.
|
"pmbootstrap install" and the option to build packages during pmb install
|
||||||
:param build: Set to true to build the package, if the binary packages are
|
is disabled.
|
||||||
out of date, and it is in the aports folder.
|
|
||||||
:param packages_installed: Return value from installed().
|
|
||||||
:returns: True if the package needs to be installed/updated,
|
|
||||||
False otherwise.
|
|
||||||
"""
|
|
||||||
# For packages to be removed we can do the test immediately
|
|
||||||
if package.startswith("!"):
|
|
||||||
return package[1:] in packages_installed
|
|
||||||
|
|
||||||
# User may have disabled buiding packages during "pmbootstrap install"
|
:param package: name of the package to build
|
||||||
build_disabled = False
|
:param arch: architecture of the package to build
|
||||||
|
"""
|
||||||
|
# User may have disabled building packages during "pmbootstrap install"
|
||||||
if args.action == "install" and not args.build_pkgs_on_install:
|
if args.action == "install" and not args.build_pkgs_on_install:
|
||||||
build_disabled = True
|
if not pmb.parse.apkindex.package(args, package, arch, False):
|
||||||
|
|
||||||
# Build package
|
|
||||||
if build and not build_disabled:
|
|
||||||
pmb.build.package(args, package, arch)
|
|
||||||
|
|
||||||
# No further checks when not installed
|
|
||||||
if package not in packages_installed:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# Make sure that we really have a binary package
|
|
||||||
data_repo = pmb.parse.apkindex.package(args, package, arch, False)
|
|
||||||
if not data_repo:
|
|
||||||
if build_disabled:
|
|
||||||
raise RuntimeError(f"{package}: no binary package found for"
|
raise RuntimeError(f"{package}: no binary package found for"
|
||||||
f" {arch}, and compiling packages during"
|
f" {arch}, and compiling packages during"
|
||||||
" 'pmbootstrap install' has been disabled."
|
" 'pmbootstrap install' has been disabled."
|
||||||
" Consider changing this option in"
|
" Consider changing this option in"
|
||||||
" 'pmbootstrap init'.")
|
" 'pmbootstrap init'.")
|
||||||
logging.warning("WARNING: Internal error in pmbootstrap,"
|
# Use the existing binary package
|
||||||
f" package '{package}' for {arch}"
|
return
|
||||||
" has not been built yet, but it should have"
|
|
||||||
" been. Rebuilding it with force. Please "
|
|
||||||
" report this, if there is no ticket about this"
|
|
||||||
" yet!")
|
|
||||||
pmb.build.package(args, package, arch, True)
|
|
||||||
return install_is_necessary(args, build, arch, package,
|
|
||||||
packages_installed)
|
|
||||||
|
|
||||||
# Compare the installed version vs. the version in the repos
|
# Build the package if it's in pmaports and there is no binary package
|
||||||
data_installed = packages_installed[package]
|
# with the same pkgver and pkgrel. This check is done in
|
||||||
compare = pmb.parse.version.compare(data_installed["version"],
|
# pmb.build.is_necessary, which gets called in pmb.build.package.
|
||||||
data_repo["version"])
|
return pmb.build.package(args, package, arch)
|
||||||
# a) Installed newer (should not happen normally)
|
|
||||||
if compare == 1:
|
|
||||||
logging.info(f"WARNING: {arch} package '{package}'"
|
|
||||||
f" installed version {data_installed['version']}"
|
|
||||||
" is newer, than the version in the repositories:"
|
|
||||||
f" {data_repo['version']}"
|
|
||||||
" See also: <https://postmarketos.org/warning-repo>")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# b) Repo newer
|
|
||||||
elif compare == -1:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# c) Same version, look at last modified
|
|
||||||
elif compare == 0:
|
|
||||||
time_installed = float(data_installed["timestamp"])
|
|
||||||
time_repo = float(data_repo["timestamp"])
|
|
||||||
return time_repo > time_installed
|
|
||||||
|
|
||||||
|
|
||||||
def replace_aports_packages_with_path(args, packages, suffix, arch):
|
def packages_split_to_add_del(packages):
|
||||||
"""
|
"""
|
||||||
apk will only re-install packages with the same pkgname,
|
Sort packages into "to_add" and "to_del" lists depending on their pkgname
|
||||||
pkgver and pkgrel, when you give it the absolute path to the package.
|
starting with an exclamation mark.
|
||||||
This function replaces all packages that were built locally,
|
|
||||||
with the absolute path to the package.
|
:param packages: list of pkgnames
|
||||||
|
:returns: (to_add, to_del) - tuple of lists of pkgnames, e.g.
|
||||||
|
(["hello-world", ...], ["some-conflict-pkg", ...])
|
||||||
"""
|
"""
|
||||||
ret = []
|
to_add = []
|
||||||
|
to_del = []
|
||||||
|
|
||||||
for package in packages:
|
for package in packages:
|
||||||
aport = pmb.helpers.pmaports.find(args, package, False)
|
if package.startswith("!"):
|
||||||
if aport:
|
to_del.append(package.lstrip("!"))
|
||||||
data_repo = pmb.parse.apkindex.package(args, package, arch, False)
|
else:
|
||||||
if not data_repo:
|
to_add.append(package)
|
||||||
raise RuntimeError(f"{package}: could not find binary"
|
|
||||||
" package, although it should exist for"
|
return (to_add, to_del)
|
||||||
" sure at this point in the code."
|
|
||||||
" Probably an APKBUILD subpackage parsing"
|
|
||||||
" bug. Related: https://gitlab.com/"
|
def packages_get_locally_built_apks(args, packages, arch):
|
||||||
"postmarketOS/build.postmarketos.org/"
|
"""
|
||||||
"issues/61")
|
Iterate over packages and if existing, get paths to locally built packages.
|
||||||
apk_path = (f"/mnt/pmbootstrap-packages/{arch}/"
|
This is used to force apk to upgrade packages to newer local versions, even
|
||||||
f"{package}-{data_repo['version']}.apk")
|
if the pkgver and pkgrel did not change.
|
||||||
if os.path.exists(f"{args.work}/chroot_{suffix}{apk_path}"):
|
|
||||||
package = apk_path
|
:param packages: list of pkgnames
|
||||||
ret.append(package)
|
:param arch: architecture that the locally built packages should have
|
||||||
|
:returns: list of apk file paths that are valid inside the chroots, e.g.
|
||||||
|
["/mnt/pmbootstrap-packages/x86_64/hello-world-1-r6.apk", ...]
|
||||||
|
"""
|
||||||
|
channel = pmb.config.pmaports.read_config(args)["channel"]
|
||||||
|
ret = []
|
||||||
|
|
||||||
|
for package in packages:
|
||||||
|
data_repo = pmb.parse.apkindex.package(args, package, arch, False)
|
||||||
|
if not data_repo:
|
||||||
|
continue
|
||||||
|
|
||||||
|
apk_file = f"{package}-{data_repo['version']}.apk"
|
||||||
|
if not os.path.exists(f"{args.work}/packages/{channel}/{arch}/{apk_file}"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
ret.append(f"/mnt/pmbootstrap-packages/{arch}/{apk_file}")
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def install(args, packages, suffix="native", build=True):
|
def install_run_apk(args, to_add, to_add_local, to_del, suffix):
|
||||||
"""
|
"""
|
||||||
:param build: automatically build the package, when it does not exist yet
|
Run apk to add packages, and ensure only the desired packages get
|
||||||
or needs to be updated, and it is inside the pm-aports
|
explicitly marked as installed.
|
||||||
folder. Checking this is expensive - if you know that all
|
|
||||||
packages are provides by upstream repos, set this to False!
|
:param to_add: list of pkgnames to install, without their dependencies
|
||||||
|
:param to_add_local: return of packages_get_locally_built_apks()
|
||||||
|
:param to_del: list of pkgnames to be deleted, this should be set to
|
||||||
|
conflicting dependencies in any of the packages to be
|
||||||
|
installed or their dependencies (e.g. ["osk-sdl"])
|
||||||
|
:param suffix: the chroot suffix, e.g. "native" or "rootfs_qemu-amd64"
|
||||||
"""
|
"""
|
||||||
# Initialize chroot
|
|
||||||
check_min_version(args, suffix)
|
|
||||||
pmb.chroot.init(args, suffix)
|
|
||||||
|
|
||||||
# Add depends to packages
|
|
||||||
arch = pmb.parse.arch.from_chroot_suffix(args, suffix)
|
|
||||||
packages_with_depends = pmb.parse.depends.recurse(args, packages, suffix)
|
|
||||||
|
|
||||||
# Filter outdated packages (build them if required)
|
|
||||||
packages_installed = installed(args, suffix)
|
|
||||||
packages_toadd = []
|
|
||||||
packages_todel = []
|
|
||||||
for package in packages_with_depends:
|
|
||||||
if not install_is_necessary(
|
|
||||||
args, build, arch, package, packages_installed):
|
|
||||||
continue
|
|
||||||
if package.startswith("!"):
|
|
||||||
packages_todel.append(package.lstrip("!"))
|
|
||||||
else:
|
|
||||||
packages_toadd.append(package)
|
|
||||||
if not len(packages_toadd) and not len(packages_todel):
|
|
||||||
return
|
|
||||||
|
|
||||||
# Sanitize packages: don't allow '--allow-untrusted' and other options
|
# Sanitize packages: don't allow '--allow-untrusted' and other options
|
||||||
# to be passed to apk!
|
# to be passed to apk!
|
||||||
for package in packages_toadd + packages_todel:
|
for package in to_add + to_add_local + to_del:
|
||||||
if package.startswith("-"):
|
if package.startswith("-"):
|
||||||
raise ValueError(f"Invalid package name: {package}")
|
raise ValueError(f"Invalid package name: {package}")
|
||||||
|
|
||||||
# Readable install message without dependencies
|
commands = [["add"] + to_add]
|
||||||
message = f"({suffix}) install"
|
|
||||||
for pkgname in packages:
|
|
||||||
if pkgname not in packages_installed:
|
|
||||||
message += f" {pkgname}"
|
|
||||||
logging.info(message)
|
|
||||||
|
|
||||||
# Local packages: Using the path instead of pkgname makes apk update
|
|
||||||
# packages of the same version if the build date is different
|
|
||||||
packages_toadd = replace_aports_packages_with_path(args, packages_toadd,
|
|
||||||
suffix, arch)
|
|
||||||
|
|
||||||
# Split off conflicts
|
|
||||||
packages_without_conflicts = list(
|
|
||||||
filter(lambda p: not p.startswith("!"), packages))
|
|
||||||
|
|
||||||
# Use a virtual package to mark only the explicitly requested packages as
|
# Use a virtual package to mark only the explicitly requested packages as
|
||||||
# explicitly installed, not their dependencies or specific paths (#1212)
|
# explicitly installed, not the ones in to_add_local
|
||||||
commands = [["add"] + packages_without_conflicts]
|
if to_add_local:
|
||||||
if len(packages_toadd) and packages_without_conflicts != packages_toadd:
|
commands += [["add", "-u", "--virtual", ".pmbootstrap"] + to_add_local,
|
||||||
commands = [["add", "-u", "--virtual", ".pmbootstrap"] +
|
["del", ".pmbootstrap"]]
|
||||||
packages_toadd,
|
|
||||||
["add"] + packages_without_conflicts,
|
if to_del:
|
||||||
["del", ".pmbootstrap"]]
|
commands += [["del"] + to_del]
|
||||||
if len(packages_todel):
|
|
||||||
commands.append(["del"] + packages_todel)
|
|
||||||
for (i, command) in enumerate(commands):
|
for (i, command) in enumerate(commands):
|
||||||
if args.offline:
|
if args.offline:
|
||||||
command = ["--no-network"] + command
|
command = ["--no-network"] + command
|
||||||
|
@ -261,6 +205,44 @@ def install(args, packages, suffix="native", build=True):
|
||||||
suffix=suffix)
|
suffix=suffix)
|
||||||
|
|
||||||
|
|
||||||
|
def install(args, packages, suffix="native", build=True):
|
||||||
|
"""
|
||||||
|
Install packages from pmbootstrap's local package index or the pmOS/Alpine
|
||||||
|
binary package mirrors. Iterate over all dependencies recursively, and
|
||||||
|
build missing packages as necessary.
|
||||||
|
|
||||||
|
:param packages: list of pkgnames to be installed
|
||||||
|
:param suffix: the chroot suffix, e.g. "native" or "rootfs_qemu-amd64"
|
||||||
|
:param build: automatically build the package, when it does not exist yet
|
||||||
|
or needs to be updated, and it is inside pmaports. For the
|
||||||
|
special case that all packages are expected to be in Alpine's
|
||||||
|
repositories, set this to False for performance optimization.
|
||||||
|
"""
|
||||||
|
arch = pmb.parse.arch.from_chroot_suffix(args, suffix)
|
||||||
|
|
||||||
|
if not packages:
|
||||||
|
logging.verbose("pmb.chroot.apk.install called with empty packages list,"
|
||||||
|
" ignoring")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Initialize chroot
|
||||||
|
check_min_version(args, suffix)
|
||||||
|
pmb.chroot.init(args, suffix)
|
||||||
|
|
||||||
|
packages_with_depends = pmb.parse.depends.recurse(args, packages, suffix)
|
||||||
|
to_add, to_del = packages_split_to_add_del(packages_with_depends)
|
||||||
|
|
||||||
|
if build:
|
||||||
|
for package in to_add:
|
||||||
|
install_build(args, package, arch)
|
||||||
|
|
||||||
|
to_add_local = packages_get_locally_built_apks(args, to_add, arch)
|
||||||
|
to_add_no_deps, _ = packages_split_to_add_del(packages)
|
||||||
|
|
||||||
|
logging.info(f"({suffix}) install {' '.join(to_add_no_deps)}")
|
||||||
|
install_run_apk(args, to_add_no_deps, to_add_local, to_del, suffix)
|
||||||
|
|
||||||
|
|
||||||
def installed(args, suffix="native"):
|
def installed(args, suffix="native"):
|
||||||
"""
|
"""
|
||||||
Read the list of installed packages (which has almost the same format, as
|
Read the list of installed packages (which has almost the same format, as
|
||||||
|
|
|
@ -55,15 +55,22 @@ def root(args, cmd, suffix="native", working_dir="/", output="log",
|
||||||
|
|
||||||
# Merge env with defaults into env_all
|
# Merge env with defaults into env_all
|
||||||
env_all = {"CHARSET": "UTF-8",
|
env_all = {"CHARSET": "UTF-8",
|
||||||
"LANG": "UTF-8",
|
|
||||||
"HISTFILE": "~/.ash_history",
|
"HISTFILE": "~/.ash_history",
|
||||||
"HOME": "/root",
|
"HOME": "/root",
|
||||||
|
"LANG": "UTF-8",
|
||||||
"PATH": pmb.config.chroot_path,
|
"PATH": pmb.config.chroot_path,
|
||||||
|
"PYTHONUNBUFFERED": "1",
|
||||||
"SHELL": "/bin/ash",
|
"SHELL": "/bin/ash",
|
||||||
"TERM": "xterm"}
|
"TERM": "xterm"}
|
||||||
for key, value in env.items():
|
for key, value in env.items():
|
||||||
env_all[key] = value
|
env_all[key] = value
|
||||||
|
|
||||||
|
# Preserve proxy environment variables
|
||||||
|
for var in ["FTP_PROXY", "ftp_proxy", "HTTP_PROXY", "http_proxy",
|
||||||
|
"HTTPS_PROXY", "https_proxy", "HTTP_PROXY_AUTH"]:
|
||||||
|
if var in os.environ:
|
||||||
|
env_all[var] = os.environ[var]
|
||||||
|
|
||||||
# Build the command in steps and run it, e.g.:
|
# Build the command in steps and run it, e.g.:
|
||||||
# cmd: ["echo", "test"]
|
# cmd: ["echo", "test"]
|
||||||
# cmd_chroot: ["/sbin/chroot", "/..._native", "/bin/sh", "-c", "echo test"]
|
# cmd_chroot: ["/sbin/chroot", "/..._native", "/bin/sh", "-c", "echo test"]
|
||||||
|
|
|
@ -17,7 +17,7 @@ from pmb.config.sudo import which_sudo
|
||||||
#
|
#
|
||||||
# Exported variables (internal configuration)
|
# Exported variables (internal configuration)
|
||||||
#
|
#
|
||||||
version = "1.43.1"
|
version = "1.47.1"
|
||||||
pmb_src = os.path.normpath(os.path.realpath(__file__) + "/../../..")
|
pmb_src = os.path.normpath(os.path.realpath(__file__) + "/../../..")
|
||||||
apk_keys_path = pmb_src + "/pmb/data/keys"
|
apk_keys_path = pmb_src + "/pmb/data/keys"
|
||||||
arch_native = pmb.parse.arch.alpine_native()
|
arch_native = pmb.parse.arch.alpine_native()
|
||||||
|
@ -27,7 +27,8 @@ arch_native = pmb.parse.arch.alpine_native()
|
||||||
# Update this frequently to prevent a MITM attack with an outdated version
|
# Update this frequently to prevent a MITM attack with an outdated version
|
||||||
# (which may contain a vulnerable apk/openssl, and allows an attacker to
|
# (which may contain a vulnerable apk/openssl, and allows an attacker to
|
||||||
# exploit the system!)
|
# exploit the system!)
|
||||||
apk_tools_min_version = {"edge": "2.12.9-r3",
|
apk_tools_min_version = {"edge": "2.12.9-r7",
|
||||||
|
"v3.16": "2.12.9-r3",
|
||||||
"v3.15": "2.12.7-r3",
|
"v3.15": "2.12.7-r3",
|
||||||
"v3.14": "2.12.7-r0",
|
"v3.14": "2.12.7-r0",
|
||||||
"v3.13": "2.12.7-r0",
|
"v3.13": "2.12.7-r0",
|
||||||
|
@ -328,8 +329,8 @@ necessary_kconfig_options = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Necessary anbox/waydroid kernel config options (android app support)
|
# Necessary waydroid kernel config options (android app support)
|
||||||
necessary_kconfig_options_anbox = {
|
necessary_kconfig_options_waydroid = {
|
||||||
">=0.0.0": { # all versions
|
">=0.0.0": { # all versions
|
||||||
"all": { # all arches
|
"all": { # all arches
|
||||||
"SQUASHFS": True,
|
"SQUASHFS": True,
|
||||||
|
@ -338,7 +339,7 @@ necessary_kconfig_options_anbox = {
|
||||||
"TMPFS_XATTR": True,
|
"TMPFS_XATTR": True,
|
||||||
"ANDROID_BINDER_IPC": True,
|
"ANDROID_BINDER_IPC": True,
|
||||||
"ANDROID_BINDERFS": False,
|
"ANDROID_BINDERFS": False,
|
||||||
"ANDROID_BINDER_DEVICES": ["binder", "hwbinder"],
|
"ANDROID_BINDER_DEVICES": ["binder", "hwbinder", "vndbinder"],
|
||||||
"NETFILTER_XTABLES": True,
|
"NETFILTER_XTABLES": True,
|
||||||
"NETFILTER_XT_MATCH_COMMENT": True,
|
"NETFILTER_XT_MATCH_COMMENT": True,
|
||||||
"IP_NF_MANGLE": True,
|
"IP_NF_MANGLE": True,
|
||||||
|
@ -353,12 +354,12 @@ necessary_kconfig_options_anbox = {
|
||||||
},
|
},
|
||||||
">=3.5": {
|
">=3.5": {
|
||||||
"all": {
|
"all": {
|
||||||
"CROSS_MEMORY_ATTACH": True, # required by Waydroid
|
"CROSS_MEMORY_ATTACH": True,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
">=4.20.0": {
|
">=4.20.0": {
|
||||||
"all": {
|
"all": {
|
||||||
"PSI": True, # required by userspace OOM killer in Waydroid
|
"PSI": True, # required by userspace OOM killer
|
||||||
"PSI_DEFAULT_DISABLED": False,
|
"PSI_DEFAULT_DISABLED": False,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -369,26 +370,6 @@ necessary_kconfig_options_anbox = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Necessary apparmor kernel config options (mandatory access control)
|
|
||||||
# LSM: the value that "config LSM" sets in security/Kconfig, if
|
|
||||||
# DEFAULT_SECURITY_APPARMOR is set (and other DEFAULT_SECURITY_* are unset).
|
|
||||||
necessary_kconfig_options_apparmor = {
|
|
||||||
">=0.0.0": { # all versions
|
|
||||||
"all": { # all arches
|
|
||||||
"AUDIT": True,
|
|
||||||
"DEFAULT_SECURITY_APPARMOR": True,
|
|
||||||
"LSM": "landlock,lockdown,yama,loadpin,safesetid,integrity,"
|
|
||||||
"apparmor,selinux,smack,tomoyo,bpf",
|
|
||||||
"SECURITY_APPARMOR": True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"<5.1": {
|
|
||||||
"all": {
|
|
||||||
"SECURITY_APPARMOR_BOOTPARAM_VALUE": True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
# Necessary iwd kernel config options (inet wireless daemon)
|
# Necessary iwd kernel config options (inet wireless daemon)
|
||||||
# Obtained from 'grep ADD_MISSING src/main.c' in iwd.git
|
# Obtained from 'grep ADD_MISSING src/main.c' in iwd.git
|
||||||
necessary_kconfig_options_iwd = {
|
necessary_kconfig_options_iwd = {
|
||||||
|
@ -469,7 +450,7 @@ necessary_kconfig_options_containers = {
|
||||||
"CPUSETS": True,
|
"CPUSETS": True,
|
||||||
"KEYS": True,
|
"KEYS": True,
|
||||||
"VETH": True,
|
"VETH": True,
|
||||||
"BRIDGE": True, # (also needed for anbox)
|
"BRIDGE": True, # (also needed for waydroid)
|
||||||
"BRIDGE_NETFILTER": True,
|
"BRIDGE_NETFILTER": True,
|
||||||
"IP_NF_FILTER": True,
|
"IP_NF_FILTER": True,
|
||||||
"IP_NF_TARGET_MASQUERADE": True,
|
"IP_NF_TARGET_MASQUERADE": True,
|
||||||
|
@ -518,7 +499,7 @@ necessary_kconfig_options_containers = {
|
||||||
"DM_THIN_PROVISIONING": True, # Storage Drivers
|
"DM_THIN_PROVISIONING": True, # Storage Drivers
|
||||||
},
|
},
|
||||||
"x86 x86_64": { # only for x86, x86_64 (and sparc64, ia64)
|
"x86 x86_64": { # only for x86, x86_64 (and sparc64, ia64)
|
||||||
"CONFIG_HUGETLB_PAGE": True,
|
"HUGETLB_PAGE": True,
|
||||||
"CGROUP_HUGETLB": True, # Optional section
|
"CGROUP_HUGETLB": True, # Optional section
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -536,7 +517,7 @@ necessary_kconfig_options_containers = {
|
||||||
},
|
},
|
||||||
">=3.9": {
|
">=3.9": {
|
||||||
"all": { # all arches
|
"all": { # all arches
|
||||||
"BRIDGE_VLAN_FILTERING": True, # Network Drivers (also for anbox)
|
"BRIDGE_VLAN_FILTERING": True, # Network Drivers (also for waydroid)
|
||||||
"MACVLAN": True, # Network Drivers
|
"MACVLAN": True, # Network Drivers
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -612,6 +593,7 @@ apkbuild_package_attributes = {
|
||||||
"provides": {"array": True},
|
"provides": {"array": True},
|
||||||
"provider_priority": {"int": True},
|
"provider_priority": {"int": True},
|
||||||
"install": {"array": True},
|
"install": {"array": True},
|
||||||
|
"triggers": {"array": True},
|
||||||
|
|
||||||
# UI meta-packages can specify apps in "_pmb_recommends" to be explicitly
|
# UI meta-packages can specify apps in "_pmb_recommends" to be explicitly
|
||||||
# installed by default, and not implicitly as dependency of the UI meta-
|
# installed by default, and not implicitly as dependency of the UI meta-
|
||||||
|
@ -667,13 +649,17 @@ apkbuild_attributes = {
|
||||||
# git commit
|
# git commit
|
||||||
"_commit": {},
|
"_commit": {},
|
||||||
"source": {"array": True},
|
"source": {"array": True},
|
||||||
|
|
||||||
|
# gcc
|
||||||
|
"_pkgbase": {},
|
||||||
|
"_pkgsnap": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reference: https://postmarketos.org/apkbuild-options
|
# Reference: https://postmarketos.org/apkbuild-options
|
||||||
apkbuild_custom_valid_options = [
|
apkbuild_custom_valid_options = [
|
||||||
"!pmb:crossdirect",
|
"!pmb:crossdirect",
|
||||||
"!pmb:kconfig-check",
|
"!pmb:kconfig-check",
|
||||||
"pmb:kconfigcheck-anbox",
|
"pmb:kconfigcheck-waydroid",
|
||||||
"pmb:kconfigcheck-containers",
|
"pmb:kconfigcheck-containers",
|
||||||
"pmb:kconfigcheck-nftables",
|
"pmb:kconfigcheck-nftables",
|
||||||
"pmb:cross-native",
|
"pmb:cross-native",
|
||||||
|
@ -720,10 +706,13 @@ deviceinfo_attributes = [
|
||||||
"generate_legacy_uboot_initfs",
|
"generate_legacy_uboot_initfs",
|
||||||
"kernel_cmdline",
|
"kernel_cmdline",
|
||||||
"generate_bootimg",
|
"generate_bootimg",
|
||||||
|
"header_version",
|
||||||
"bootimg_qcdt",
|
"bootimg_qcdt",
|
||||||
"bootimg_mtk_mkimage",
|
"bootimg_mtk_mkimage",
|
||||||
"bootimg_dtb_second",
|
"bootimg_dtb_second",
|
||||||
|
"bootimg_custom_args",
|
||||||
"flash_offset_base",
|
"flash_offset_base",
|
||||||
|
"flash_offset_dtb",
|
||||||
"flash_offset_kernel",
|
"flash_offset_kernel",
|
||||||
"flash_offset_ramdisk",
|
"flash_offset_ramdisk",
|
||||||
"flash_offset_second",
|
"flash_offset_second",
|
||||||
|
|
|
@ -64,10 +64,12 @@ def ask_for_work_path(args):
|
||||||
if not exists:
|
if not exists:
|
||||||
os.makedirs(work, 0o700, True)
|
os.makedirs(work, 0o700, True)
|
||||||
|
|
||||||
if not os.listdir(work):
|
# If the version file doesn't exists yet because we either just
|
||||||
# Directory is empty, either because we just created it or
|
# created the work directory or the user has deleted it for
|
||||||
# because user created it before running pmbootstrap init
|
# whatever reason then we need to write initialize it.
|
||||||
with open(f"{work}/version", "w") as handle:
|
work_version_file = f"{work}/version"
|
||||||
|
if not os.path.isfile(work_version_file):
|
||||||
|
with open(work_version_file, "w") as handle:
|
||||||
handle.write(f"{pmb.config.work_version}\n")
|
handle.write(f"{pmb.config.work_version}\n")
|
||||||
|
|
||||||
# Create cache_git dir, so it is owned by the host system's user
|
# Create cache_git dir, so it is owned by the host system's user
|
||||||
|
|
|
@ -19,6 +19,12 @@ def odin(args, flavor, folder):
|
||||||
pmb.flasher.init(args)
|
pmb.flasher.init(args)
|
||||||
suffix = "rootfs_" + args.device
|
suffix = "rootfs_" + args.device
|
||||||
|
|
||||||
|
# Backwards compatibility with old mkinitfs (pma#660)
|
||||||
|
suffix_flavor = f"-{flavor}"
|
||||||
|
pmaports_cfg = pmb.config.pmaports.read_config(args)
|
||||||
|
if pmaports_cfg.get("supported_mkinitfs_without_flavors", False):
|
||||||
|
suffix_flavor = ""
|
||||||
|
|
||||||
# Validate method
|
# Validate method
|
||||||
method = args.deviceinfo["flash_method"]
|
method = args.deviceinfo["flash_method"]
|
||||||
if not method.startswith("heimdall-"):
|
if not method.startswith("heimdall-"):
|
||||||
|
@ -54,16 +60,16 @@ def odin(args, flavor, folder):
|
||||||
if method == "heimdall-isorec":
|
if method == "heimdall-isorec":
|
||||||
handle.write(
|
handle.write(
|
||||||
# Kernel: copy and append md5
|
# Kernel: copy and append md5
|
||||||
f"cp /boot/vmlinuz-{flavor} {odin_kernel_md5}\n"
|
f"cp /boot/vmlinuz{suffix_flavor} {odin_kernel_md5}\n"
|
||||||
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n"
|
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n"
|
||||||
# Initramfs: recompress with lzop, append md5
|
# Initramfs: recompress with lzop, append md5
|
||||||
f"gunzip -c /boot/initramfs-{flavor}"
|
f"gunzip -c /boot/initramfs{suffix_flavor}"
|
||||||
f" | lzop > {odin_initfs_md5}\n"
|
f" | lzop > {odin_initfs_md5}\n"
|
||||||
f"md5sum -t {odin_initfs_md5} >> {odin_initfs_md5}\n")
|
f"md5sum -t {odin_initfs_md5} >> {odin_initfs_md5}\n")
|
||||||
elif method == "heimdall-bootimg":
|
elif method == "heimdall-bootimg":
|
||||||
handle.write(
|
handle.write(
|
||||||
# boot.img: copy and append md5
|
# boot.img: copy and append md5
|
||||||
f"cp /boot/boot.img-{flavor} {odin_kernel_md5}\n"
|
f"cp /boot/boot.img{suffix_flavor} {odin_kernel_md5}\n"
|
||||||
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n")
|
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n")
|
||||||
handle.write(
|
handle.write(
|
||||||
# Create tar, remove included files and append md5
|
# Create tar, remove included files and append md5
|
||||||
|
|
|
@ -20,7 +20,7 @@ def kernel(args):
|
||||||
pmb.chroot.initfs.build(args, flavor, "rootfs_" + args.device)
|
pmb.chroot.initfs.build(args, flavor, "rootfs_" + args.device)
|
||||||
|
|
||||||
# Check kernel config
|
# Check kernel config
|
||||||
pmb.parse.kconfig.check(args, flavor)
|
pmb.parse.kconfig.check(args, flavor, must_exist=False)
|
||||||
|
|
||||||
# Generate the paths and run the flasher
|
# Generate the paths and run the flasher
|
||||||
if args.action_flasher == "boot":
|
if args.action_flasher == "boot":
|
||||||
|
|
|
@ -379,11 +379,12 @@ def kconfig(args):
|
||||||
# Handle passing a file directly
|
# Handle passing a file directly
|
||||||
if args.file:
|
if args.file:
|
||||||
if pmb.parse.kconfig.check_file(args.package,
|
if pmb.parse.kconfig.check_file(args.package,
|
||||||
anbox=args.anbox,
|
waydroid=args.waydroid,
|
||||||
nftables=args.nftables,
|
nftables=args.nftables,
|
||||||
containers=args.containers,
|
containers=args.containers,
|
||||||
zram=args.zram,
|
zram=args.zram,
|
||||||
netboot=args.netboot,
|
netboot=args.netboot,
|
||||||
|
community=args.community,
|
||||||
uefi=args.uefi,
|
uefi=args.uefi,
|
||||||
details=True):
|
details=True):
|
||||||
logging.info("kconfig check succeeded!")
|
logging.info("kconfig check succeeded!")
|
||||||
|
@ -414,13 +415,13 @@ def kconfig(args):
|
||||||
continue
|
continue
|
||||||
if not pmb.parse.kconfig.check(
|
if not pmb.parse.kconfig.check(
|
||||||
args, package,
|
args, package,
|
||||||
force_anbox_check=args.anbox,
|
force_waydroid_check=args.waydroid,
|
||||||
force_apparmor_check=args.apparmor,
|
|
||||||
force_iwd_check=args.iwd,
|
force_iwd_check=args.iwd,
|
||||||
force_nftables_check=args.nftables,
|
force_nftables_check=args.nftables,
|
||||||
force_containers_check=args.containers,
|
force_containers_check=args.containers,
|
||||||
force_zram_check=args.zram,
|
force_zram_check=args.zram,
|
||||||
force_netboot_check=args.netboot,
|
force_netboot_check=args.netboot,
|
||||||
|
force_community_check=args.community,
|
||||||
force_uefi_check=args.uefi,
|
force_uefi_check=args.uefi,
|
||||||
details=True):
|
details=True):
|
||||||
error = True
|
error = True
|
||||||
|
|
|
@ -34,7 +34,7 @@ def package(args, pkgname, reason="", dry=False):
|
||||||
pmb.helpers.file.replace(path, old, new)
|
pmb.helpers.file.replace(path, old, new)
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
del(pmb.helpers.other.cache["apkbuild"][path])
|
del pmb.helpers.other.cache["apkbuild"][path]
|
||||||
apkbuild = pmb.parse.apkbuild(path)
|
apkbuild = pmb.parse.apkbuild(path)
|
||||||
if int(apkbuild["pkgrel"]) != pkgrel_new:
|
if int(apkbuild["pkgrel"]) != pkgrel_new:
|
||||||
raise RuntimeError("Failed to bump pkgrel for package '" + pkgname +
|
raise RuntimeError("Failed to bump pkgrel for package '" + pkgname +
|
||||||
|
|
|
@ -46,6 +46,7 @@ def background(cmd, working_dir=None):
|
||||||
def pipe(cmd, working_dir=None):
|
def pipe(cmd, working_dir=None):
|
||||||
""" Run a subprocess in background and redirect its output to a pipe. """
|
""" Run a subprocess in background and redirect its output to a pipe. """
|
||||||
ret = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
ret = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
|
stdin=subprocess.DEVNULL,
|
||||||
stderr=pmb.helpers.logging.logfd, cwd=working_dir)
|
stderr=pmb.helpers.logging.logfd, cwd=working_dir)
|
||||||
logging.verbose(f"New background process: pid={ret.pid}, output=pipe")
|
logging.verbose(f"New background process: pid={ret.pid}, output=pipe")
|
||||||
return ret
|
return ret
|
||||||
|
@ -125,7 +126,7 @@ def kill_command(args, pid, sudo):
|
||||||
|
|
||||||
def foreground_pipe(args, cmd, working_dir=None, output_to_stdout=False,
|
def foreground_pipe(args, cmd, working_dir=None, output_to_stdout=False,
|
||||||
output_return=False, output_timeout=True,
|
output_return=False, output_timeout=True,
|
||||||
sudo=False):
|
sudo=False, stdin=None):
|
||||||
"""
|
"""
|
||||||
Run a subprocess in foreground with redirected output and optionally kill
|
Run a subprocess in foreground with redirected output and optionally kill
|
||||||
it after being silent for too long.
|
it after being silent for too long.
|
||||||
|
@ -145,7 +146,8 @@ def foreground_pipe(args, cmd, working_dir=None, output_to_stdout=False,
|
||||||
"""
|
"""
|
||||||
# Start process in background (stdout and stderr combined)
|
# Start process in background (stdout and stderr combined)
|
||||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT, cwd=working_dir)
|
stderr=subprocess.STDOUT, cwd=working_dir,
|
||||||
|
stdin=stdin)
|
||||||
|
|
||||||
# Make process.stdout non-blocking
|
# Make process.stdout non-blocking
|
||||||
handle = process.stdout.fileno()
|
handle = process.stdout.fileno()
|
||||||
|
@ -283,14 +285,14 @@ def core(args, log_message, cmd, working_dir=None, output="log",
|
||||||
their properties. "wait" indicates that we wait for the
|
their properties. "wait" indicates that we wait for the
|
||||||
process to complete.
|
process to complete.
|
||||||
|
|
||||||
output value | timeout | out to log | out to stdout | wait
|
output value | timeout | out to log | out to stdout | wait | pass stdin
|
||||||
-----------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
"log" | x | x | | x
|
"log" | x | x | | x |
|
||||||
"stdout" | x | x | x | x
|
"stdout" | x | x | x | x | x
|
||||||
"interactive" | | x | x | x
|
"interactive" | | x | x | x | x
|
||||||
"tui" | | | x | x
|
"tui" | | | x | x | x
|
||||||
"background" | | x | |
|
"background" | | x | | |
|
||||||
"pipe" | | | |
|
"pipe" | | | | |
|
||||||
|
|
||||||
:param output_return: in addition to writing the program's output to the
|
:param output_return: in addition to writing the program's output to the
|
||||||
destinations above in real time, write to a buffer
|
destinations above in real time, write to a buffer
|
||||||
|
@ -336,11 +338,13 @@ def core(args, log_message, cmd, working_dir=None, output="log",
|
||||||
|
|
||||||
output_timeout = output in ["log", "stdout"] and not disable_timeout
|
output_timeout = output in ["log", "stdout"] and not disable_timeout
|
||||||
|
|
||||||
|
stdin = subprocess.DEVNULL if output == "log" else None
|
||||||
|
|
||||||
(code, output_after_run) = foreground_pipe(args, cmd, working_dir,
|
(code, output_after_run) = foreground_pipe(args, cmd, working_dir,
|
||||||
output_to_stdout,
|
output_to_stdout,
|
||||||
output_return,
|
output_return,
|
||||||
output_timeout,
|
output_timeout,
|
||||||
sudo)
|
sudo, stdin)
|
||||||
|
|
||||||
# Check the return code
|
# Check the return code
|
||||||
if check is not False:
|
if check is not False:
|
||||||
|
|
|
@ -163,7 +163,7 @@ def partition_cgpt(args, layout, size_boot, size_reserve):
|
||||||
"-t", "kernel",
|
"-t", "kernel",
|
||||||
"-b", cgpt['kpart_start'],
|
"-b", cgpt['kpart_start'],
|
||||||
"-s", cgpt['kpart_size'],
|
"-s", cgpt['kpart_size'],
|
||||||
"-l", "Kernel",
|
"-l", "pmOS_kernel",
|
||||||
"-S", "1", # Successful flag
|
"-S", "1", # Successful flag
|
||||||
"-T", "5", # Tries flag
|
"-T", "5", # Tries flag
|
||||||
"-P", "10", # Priority flag
|
"-P", "10", # Priority flag
|
||||||
|
|
|
@ -464,10 +464,8 @@ def arguments_kconfig(subparser):
|
||||||
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
||||||
check.add_argument("--file", action="store_true", help="check a file"
|
check.add_argument("--file", action="store_true", help="check a file"
|
||||||
" directly instead of a config in a package")
|
" directly instead of a config in a package")
|
||||||
check.add_argument("--anbox", action="store_true", help="check"
|
check.add_argument("--waydroid", action="store_true", help="check"
|
||||||
" options needed for anbox too")
|
" options needed for waydroid too")
|
||||||
check.add_argument("--apparmor", action="store_true", help="check"
|
|
||||||
" options needed for apparmor too")
|
|
||||||
check.add_argument("--iwd", action="store_true", help="check"
|
check.add_argument("--iwd", action="store_true", help="check"
|
||||||
" options needed for iwd too")
|
" options needed for iwd too")
|
||||||
check.add_argument("--nftables", action="store_true", help="check"
|
check.add_argument("--nftables", action="store_true", help="check"
|
||||||
|
@ -478,6 +476,9 @@ def arguments_kconfig(subparser):
|
||||||
" options needed for zram support too")
|
" options needed for zram support too")
|
||||||
check.add_argument("--netboot", action="store_true", help="check"
|
check.add_argument("--netboot", action="store_true", help="check"
|
||||||
" options needed for netbooting too")
|
" options needed for netbooting too")
|
||||||
|
check.add_argument("--community", action="store_true", help="check"
|
||||||
|
" options needed for various features, required for"
|
||||||
|
" community/main devices")
|
||||||
check.add_argument("--uefi", action="store_true", help="check"
|
check.add_argument("--uefi", action="store_true", help="check"
|
||||||
" options needed for uefi too")
|
" options needed for uefi too")
|
||||||
add_kernel_arg(check)
|
add_kernel_arg(check)
|
||||||
|
|
|
@ -119,15 +119,15 @@ def bootimg(args, path):
|
||||||
working_dir=temp_path)
|
working_dir=temp_path)
|
||||||
|
|
||||||
output = {}
|
output = {}
|
||||||
header_version = None
|
header_version = 0
|
||||||
# Get base, offsets, pagesize, cmdline and qcdt info
|
# Get base, offsets, pagesize, cmdline and qcdt info
|
||||||
# This file does not exist for example for qcdt images
|
# This file does not exist for example for qcdt images
|
||||||
if os.path.isfile(f"{bootimg_path}-header_version"):
|
if os.path.isfile(f"{bootimg_path}-header_version"):
|
||||||
with open(f"{bootimg_path}-header_version", 'r') as f:
|
with open(f"{bootimg_path}-header_version", 'r') as f:
|
||||||
header_version = int(f.read().replace('\n', ''))
|
header_version = int(f.read().replace('\n', ''))
|
||||||
|
output["header_version"] = str(header_version)
|
||||||
|
|
||||||
if header_version is not None and header_version >= 3:
|
if header_version >= 3:
|
||||||
output["header_version"] = str(header_version)
|
|
||||||
output["pagesize"] = "4096"
|
output["pagesize"] = "4096"
|
||||||
else:
|
else:
|
||||||
with open(f"{bootimg_path}-base", 'r') as f:
|
with open(f"{bootimg_path}-base", 'r') as f:
|
||||||
|
@ -147,6 +147,11 @@ def bootimg(args, path):
|
||||||
with open(f"{bootimg_path}-pagesize", 'r') as f:
|
with open(f"{bootimg_path}-pagesize", 'r') as f:
|
||||||
output["pagesize"] = f.read().replace('\n', '')
|
output["pagesize"] = f.read().replace('\n', '')
|
||||||
|
|
||||||
|
if header_version == 2:
|
||||||
|
with open(f"{bootimg_path}-dtb_offset", 'r') as f:
|
||||||
|
output["dtb_offset"] = ("0x%08x"
|
||||||
|
% int(f.read().replace('\n', ''), 16))
|
||||||
|
|
||||||
output["qcdt"] = ("true" if os.path.isfile(f"{bootimg_path}-dt") and
|
output["qcdt"] = ("true" if os.path.isfile(f"{bootimg_path}-dt") and
|
||||||
os.path.getsize(f"{bootimg_path}-dt") > 0 else "false")
|
os.path.getsize(f"{bootimg_path}-dt") > 0 else "false")
|
||||||
output["mtk_mkimage"] = ("true" if check_mtk_bootimg(bootimg_path)
|
output["mtk_mkimage"] = ("true" if check_mtk_bootimg(bootimg_path)
|
||||||
|
|
|
@ -106,7 +106,7 @@ def parse_kernel_suffix(args, info, device, kernel):
|
||||||
# Move ret[key_kernel] to ret[key]
|
# Move ret[key_kernel] to ret[key]
|
||||||
logging.verbose(f"parse_kernel_suffix: {key_kernel} => {key}")
|
logging.verbose(f"parse_kernel_suffix: {key_kernel} => {key}")
|
||||||
ret[key] = ret[key_kernel]
|
ret[key] = ret[key_kernel]
|
||||||
del(ret[key_kernel])
|
del ret[key_kernel]
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -85,13 +85,13 @@ def check_option(component, details, config, config_path_pretty, option,
|
||||||
|
|
||||||
|
|
||||||
def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
anbox=False,
|
waydroid=False,
|
||||||
apparmor=False,
|
|
||||||
iwd=False,
|
iwd=False,
|
||||||
nftables=False,
|
nftables=False,
|
||||||
containers=False,
|
containers=False,
|
||||||
zram=False,
|
zram=False,
|
||||||
netboot=False,
|
netboot=False,
|
||||||
|
community=False,
|
||||||
uefi=False,
|
uefi=False,
|
||||||
details=False):
|
details=False):
|
||||||
logging.debug(f"Check kconfig: {config_path}")
|
logging.debug(f"Check kconfig: {config_path}")
|
||||||
|
@ -99,10 +99,8 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
config = handle.read()
|
config = handle.read()
|
||||||
|
|
||||||
components = {"postmarketOS": pmb.config.necessary_kconfig_options}
|
components = {"postmarketOS": pmb.config.necessary_kconfig_options}
|
||||||
if anbox:
|
if waydroid:
|
||||||
components["anbox"] = pmb.config.necessary_kconfig_options_anbox
|
components["waydroid"] = pmb.config.necessary_kconfig_options_waydroid
|
||||||
if apparmor:
|
|
||||||
components["apparmor"] = pmb.config.necessary_kconfig_options_apparmor
|
|
||||||
if iwd:
|
if iwd:
|
||||||
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
||||||
if nftables:
|
if nftables:
|
||||||
|
@ -114,6 +112,14 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
components["zram"] = pmb.config.necessary_kconfig_options_zram
|
components["zram"] = pmb.config.necessary_kconfig_options_zram
|
||||||
if netboot:
|
if netboot:
|
||||||
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
|
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
|
||||||
|
if community:
|
||||||
|
components["waydroid"] = pmb.config.necessary_kconfig_options_waydroid
|
||||||
|
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
||||||
|
components["nftables"] = pmb.config.necessary_kconfig_options_nftables
|
||||||
|
components["containers"] = \
|
||||||
|
pmb.config.necessary_kconfig_options_containers
|
||||||
|
components["zram"] = pmb.config.necessary_kconfig_options_zram
|
||||||
|
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
|
||||||
if uefi:
|
if uefi:
|
||||||
components["uefi"] = pmb.config.necessary_kconfig_options_uefi
|
components["uefi"] = pmb.config.necessary_kconfig_options_uefi
|
||||||
|
|
||||||
|
@ -159,19 +165,21 @@ def check_config_options_set(config, config_path_pretty, config_arch, options,
|
||||||
|
|
||||||
|
|
||||||
def check(args, pkgname,
|
def check(args, pkgname,
|
||||||
force_anbox_check=False,
|
force_waydroid_check=False,
|
||||||
force_apparmor_check=False,
|
|
||||||
force_iwd_check=False,
|
force_iwd_check=False,
|
||||||
force_nftables_check=False,
|
force_nftables_check=False,
|
||||||
force_containers_check=False,
|
force_containers_check=False,
|
||||||
force_zram_check=False,
|
force_zram_check=False,
|
||||||
force_netboot_check=False,
|
force_netboot_check=False,
|
||||||
|
force_community_check=False,
|
||||||
force_uefi_check=False,
|
force_uefi_check=False,
|
||||||
details=False):
|
details=False,
|
||||||
|
must_exist=True):
|
||||||
"""
|
"""
|
||||||
Check for necessary kernel config options in a package.
|
Check for necessary kernel config options in a package.
|
||||||
|
|
||||||
:returns: True when the check was successful, False otherwise
|
:returns: True when the check was successful, False otherwise
|
||||||
|
None if the aport cannot be found (only if must_exist=False)
|
||||||
"""
|
"""
|
||||||
# Pkgname: allow omitting "linux-" prefix
|
# Pkgname: allow omitting "linux-" prefix
|
||||||
if pkgname.startswith("linux-"):
|
if pkgname.startswith("linux-"):
|
||||||
|
@ -181,13 +189,13 @@ def check(args, pkgname,
|
||||||
|
|
||||||
# Read all kernel configs in the aport
|
# Read all kernel configs in the aport
|
||||||
ret = True
|
ret = True
|
||||||
aport = pmb.helpers.pmaports.find(args, "linux-" + flavor)
|
aport = pmb.helpers.pmaports.find(args, "linux-" + flavor, must_exist=must_exist)
|
||||||
|
if aport is None:
|
||||||
|
return None
|
||||||
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
|
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
|
||||||
pkgver = apkbuild["pkgver"]
|
pkgver = apkbuild["pkgver"]
|
||||||
check_anbox = force_anbox_check or (
|
check_waydroid = force_waydroid_check or (
|
||||||
"pmb:kconfigcheck-anbox" in apkbuild["options"])
|
"pmb:kconfigcheck-waydroid" in apkbuild["options"])
|
||||||
check_apparmor = force_apparmor_check or (
|
|
||||||
"pmb:kconfigcheck-apparmor" in apkbuild["options"])
|
|
||||||
check_iwd = force_iwd_check or (
|
check_iwd = force_iwd_check or (
|
||||||
"pmb:kconfigcheck-iwd" in apkbuild["options"])
|
"pmb:kconfigcheck-iwd" in apkbuild["options"])
|
||||||
check_nftables = force_nftables_check or (
|
check_nftables = force_nftables_check or (
|
||||||
|
@ -198,6 +206,8 @@ def check(args, pkgname,
|
||||||
"pmb:kconfigcheck-zram" in apkbuild["options"])
|
"pmb:kconfigcheck-zram" in apkbuild["options"])
|
||||||
check_netboot = force_netboot_check or (
|
check_netboot = force_netboot_check or (
|
||||||
"pmb:kconfigcheck-netboot" in apkbuild["options"])
|
"pmb:kconfigcheck-netboot" in apkbuild["options"])
|
||||||
|
check_community = force_community_check or (
|
||||||
|
"pmb:kconfigcheck-community" in apkbuild["options"])
|
||||||
check_uefi = force_uefi_check or (
|
check_uefi = force_uefi_check or (
|
||||||
"pmb:kconfigcheck-uefi" in apkbuild["options"])
|
"pmb:kconfigcheck-uefi" in apkbuild["options"])
|
||||||
for config_path in glob.glob(aport + "/config-*"):
|
for config_path in glob.glob(aport + "/config-*"):
|
||||||
|
@ -218,13 +228,13 @@ def check(args, pkgname,
|
||||||
config_path_pretty = f"linux-{flavor}/{os.path.basename(config_path)}"
|
config_path_pretty = f"linux-{flavor}/{os.path.basename(config_path)}"
|
||||||
ret &= check_config(config_path, config_path_pretty, config_arch,
|
ret &= check_config(config_path, config_path_pretty, config_arch,
|
||||||
pkgver,
|
pkgver,
|
||||||
anbox=check_anbox,
|
waydroid=check_waydroid,
|
||||||
apparmor=check_apparmor,
|
|
||||||
iwd=check_iwd,
|
iwd=check_iwd,
|
||||||
nftables=check_nftables,
|
nftables=check_nftables,
|
||||||
containers=check_containers,
|
containers=check_containers,
|
||||||
zram=check_zram,
|
zram=check_zram,
|
||||||
netboot=check_netboot,
|
netboot=check_netboot,
|
||||||
|
community=check_community,
|
||||||
uefi=check_uefi,
|
uefi=check_uefi,
|
||||||
details=details)
|
details=details)
|
||||||
return ret
|
return ret
|
||||||
|
@ -262,9 +272,9 @@ def extract_version(config_file):
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|
||||||
|
|
||||||
def check_file(config_file, anbox=False, nftables=False,
|
def check_file(config_file, waydroid=False, nftables=False,
|
||||||
containers=False, zram=False, netboot=False, uefi=False,
|
containers=False, zram=False, netboot=False,
|
||||||
details=False):
|
community=False, uefi=False, details=False):
|
||||||
"""
|
"""
|
||||||
Check for necessary kernel config options in a kconfig file.
|
Check for necessary kernel config options in a kconfig file.
|
||||||
|
|
||||||
|
@ -275,10 +285,11 @@ def check_file(config_file, anbox=False, nftables=False,
|
||||||
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
|
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
|
||||||
f"file: {config_file}")
|
f"file: {config_file}")
|
||||||
return check_config(config_file, config_file, arch, version,
|
return check_config(config_file, config_file, arch, version,
|
||||||
anbox=anbox,
|
waydroid=waydroid,
|
||||||
nftables=nftables,
|
nftables=nftables,
|
||||||
containers=containers,
|
containers=containers,
|
||||||
zram=zram,
|
zram=zram,
|
||||||
netboot=netboot,
|
netboot=netboot,
|
||||||
|
community=community,
|
||||||
uefi=uefi,
|
uefi=uefi,
|
||||||
details=details)
|
details=details)
|
||||||
|
|
|
@ -177,7 +177,7 @@ def get_token(previous, rest):
|
||||||
value = -1
|
value = -1
|
||||||
|
|
||||||
# Get the next token (for non-leading zeros)
|
# Get the next token (for non-leading zeros)
|
||||||
if(not len(rest)):
|
if not len(rest):
|
||||||
next = "end"
|
next = "end"
|
||||||
elif next == "invalid" and not invalid_suffix:
|
elif next == "invalid" and not invalid_suffix:
|
||||||
(next, rest) = next_token(previous, rest)
|
(next, rest) = next_token(previous, rest)
|
||||||
|
|
|
@ -277,7 +277,6 @@ def install_depends(args, arch):
|
||||||
Install any necessary qemu dependencies in native chroot
|
Install any necessary qemu dependencies in native chroot
|
||||||
"""
|
"""
|
||||||
depends = [
|
depends = [
|
||||||
"mesa-dri-classic",
|
|
||||||
"mesa-dri-gallium",
|
"mesa-dri-gallium",
|
||||||
"mesa-egl",
|
"mesa-egl",
|
||||||
"mesa-gl",
|
"mesa-gl",
|
||||||
|
|
|
@ -56,7 +56,7 @@ def ssh_install_apks(args, user, host, port, paths):
|
||||||
add_cmd = pmb.helpers.run.flat_cmd(add_cmd)
|
add_cmd = pmb.helpers.run.flat_cmd(add_cmd)
|
||||||
clean_cmd = pmb.helpers.run.flat_cmd(['rm'] + remote_paths)
|
clean_cmd = pmb.helpers.run.flat_cmd(['rm'] + remote_paths)
|
||||||
command = ['ssh', '-t', '-p', port, f'{user}@{host}',
|
command = ['ssh', '-t', '-p', port, f'{user}@{host}',
|
||||||
f'{add_cmd}; {clean_cmd}']
|
f'{add_cmd}; rc=$?; {clean_cmd}; exit $rc']
|
||||||
pmb.helpers.run.user(args, command, output="tui")
|
pmb.helpers.run.user(args, command, output="tui")
|
||||||
|
|
||||||
|
|
||||||
|
|
144
test/test_apk.py
144
test/test_apk.py
|
@ -1,9 +1,11 @@
|
||||||
# Copyright 2022 Oliver Smith
|
# Copyright 2022 Oliver Smith
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
import fnmatch
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import pmb_test # noqa
|
import pmb_test # noqa
|
||||||
|
import pmb.build
|
||||||
import pmb.chroot.apk
|
import pmb.chroot.apk
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,15 +20,135 @@ def args(tmpdir, request):
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
def test_install_is_necessary(args):
|
def test_install_build(monkeypatch, args):
|
||||||
# osk-sdl not installed, nothing to do
|
func = pmb.chroot.apk.install_build
|
||||||
ret = pmb.chroot.apk.install_is_necessary(args, False, "aarch64",
|
ret_apkindex_package = None
|
||||||
"!osk-sdl",
|
|
||||||
{"unl0kr": {"unl0kr": {}}})
|
|
||||||
assert not ret
|
|
||||||
|
|
||||||
# osk-sdl installed, (un)install necessary
|
def fake_build_package(args, package, arch):
|
||||||
ret = pmb.chroot.apk.install_is_necessary(args, False, "aarch64",
|
return "build-pkg"
|
||||||
"!osk-sdl",
|
monkeypatch.setattr(pmb.build, "package", fake_build_package)
|
||||||
{"osk-sdl": {"osk-sdl": {}}})
|
|
||||||
assert ret
|
def fake_apkindex_package(args, package, arch, must_exist):
|
||||||
|
return ret_apkindex_package
|
||||||
|
monkeypatch.setattr(pmb.parse.apkindex, "package", fake_apkindex_package)
|
||||||
|
|
||||||
|
package = "hello-world"
|
||||||
|
arch = "x86_64"
|
||||||
|
|
||||||
|
# invoked as pmb install, build_pkgs_on_install disabled
|
||||||
|
args.action = "install"
|
||||||
|
args.build_pkgs_on_install = False
|
||||||
|
with pytest.raises(RuntimeError) as e:
|
||||||
|
func(args, package, arch)
|
||||||
|
assert "no binary package found" in str(e.value)
|
||||||
|
|
||||||
|
# invoked as pmb install, build_pkgs_on_install disabled, binary exists
|
||||||
|
args.action = "install"
|
||||||
|
args.build_pkgs_on_install = False
|
||||||
|
ret_apkindex_package = {"pkgname": "hello-world"}
|
||||||
|
assert func(args, package, arch) is None
|
||||||
|
|
||||||
|
# invoked as pmb install, build_pkgs_on_install enabled
|
||||||
|
args.action = "install"
|
||||||
|
args.build_pkgs_on_install = True
|
||||||
|
assert func(args, package, arch) == "build-pkg"
|
||||||
|
|
||||||
|
# invoked as not pmb install
|
||||||
|
args.action = "chroot"
|
||||||
|
args.build_pkgs_on_install = False
|
||||||
|
assert func(args, package, arch) == "build-pkg"
|
||||||
|
|
||||||
|
|
||||||
|
def test_packages_split_to_add_del():
|
||||||
|
packages = ["hello", "!test", "hello2", "test2", "!test3"]
|
||||||
|
|
||||||
|
to_add, to_del = pmb.chroot.apk.packages_split_to_add_del(packages)
|
||||||
|
assert to_add == ["hello", "hello2", "test2"]
|
||||||
|
assert to_del == ["test", "test3"]
|
||||||
|
|
||||||
|
|
||||||
|
def test_packages_get_locally_built_apks(monkeypatch, args):
|
||||||
|
args.assume_yes = True
|
||||||
|
|
||||||
|
arch = pmb.config.arch_native
|
||||||
|
packages = ["hello-world", # will exist in repo and locally
|
||||||
|
"postmarketos-base", # will exist in repo only
|
||||||
|
"package-that-does-not-exist"] # will not exist at all
|
||||||
|
|
||||||
|
pmb.chroot.zap(args, pkgs_local=True)
|
||||||
|
pmb.build.package(args, "hello-world", force=True)
|
||||||
|
|
||||||
|
ret = pmb.chroot.apk.packages_get_locally_built_apks(args, packages, arch)
|
||||||
|
assert len(ret) == 1
|
||||||
|
assert fnmatch.fnmatch(ret[0], "*/hello-world-*.apk")
|
||||||
|
|
||||||
|
|
||||||
|
def test_install_run_apk(monkeypatch, args):
|
||||||
|
global cmds_progress
|
||||||
|
global cmds
|
||||||
|
|
||||||
|
func = pmb.chroot.apk.install_run_apk
|
||||||
|
suffix = "chroot_native"
|
||||||
|
|
||||||
|
def fake_chroot_root(args, command, suffix):
|
||||||
|
global cmds
|
||||||
|
cmds += [command]
|
||||||
|
monkeypatch.setattr(pmb.chroot, "root", fake_chroot_root)
|
||||||
|
|
||||||
|
def fake_apk_progress(args, command, chroot, suffix):
|
||||||
|
global cmds_progress
|
||||||
|
cmds_progress += [command]
|
||||||
|
monkeypatch.setattr(pmb.helpers.apk, "apk_with_progress", fake_apk_progress)
|
||||||
|
|
||||||
|
def reset_cmds():
|
||||||
|
global cmds_progress, cmds
|
||||||
|
cmds = []
|
||||||
|
cmds_progress = []
|
||||||
|
|
||||||
|
# Simple add
|
||||||
|
reset_cmds()
|
||||||
|
to_add = ["postmarketos-base", "device-ppp"]
|
||||||
|
to_add_local = []
|
||||||
|
to_del = []
|
||||||
|
func(args, to_add, to_add_local, to_del, suffix)
|
||||||
|
assert cmds_progress == [["apk", "add", "postmarketos-base", "device-ppp"]]
|
||||||
|
assert cmds == []
|
||||||
|
|
||||||
|
# Add and delete
|
||||||
|
reset_cmds()
|
||||||
|
to_add = ["postmarketos-base", "device-ppp"]
|
||||||
|
to_add_local = []
|
||||||
|
to_del = ["osk-sdl"]
|
||||||
|
func(args, to_add, to_add_local, to_del, suffix)
|
||||||
|
assert cmds_progress == [["apk", "add", "postmarketos-base", "device-ppp"]]
|
||||||
|
assert cmds == [["apk", "--no-progress", "del", "osk-sdl"]]
|
||||||
|
|
||||||
|
# Add with local package
|
||||||
|
reset_cmds()
|
||||||
|
to_add = ["postmarketos-base", "device-ppp"]
|
||||||
|
to_add_local = ["/tmp/device-ppp.apk"]
|
||||||
|
to_del = []
|
||||||
|
func(args, to_add, to_add_local, to_del, suffix)
|
||||||
|
assert cmds_progress == [["apk", "add", "postmarketos-base", "device-ppp"]]
|
||||||
|
assert cmds == [["apk", "--no-progress", "add", "-u", "--virtual",
|
||||||
|
".pmbootstrap", "/tmp/device-ppp.apk"],
|
||||||
|
["apk", "--no-progress", "del", ".pmbootstrap"]]
|
||||||
|
|
||||||
|
# Add with --no-network
|
||||||
|
reset_cmds()
|
||||||
|
args.offline = True
|
||||||
|
to_add = ["hello-world"]
|
||||||
|
to_add_local = []
|
||||||
|
to_del = []
|
||||||
|
func(args, to_add, to_add_local, to_del, suffix)
|
||||||
|
assert cmds_progress == [["apk", "--no-network", "add", "hello-world"]]
|
||||||
|
assert cmds == []
|
||||||
|
|
||||||
|
# Package name starting with '-'
|
||||||
|
reset_cmds()
|
||||||
|
to_add = ["hello-world", "--allow-untrusted"]
|
||||||
|
to_add_local = []
|
||||||
|
to_del = []
|
||||||
|
with pytest.raises(ValueError) as e:
|
||||||
|
func(args, to_add, to_add_local, to_del, suffix)
|
||||||
|
assert "Invalid package name" in str(e.value)
|
||||||
|
|
|
@ -43,7 +43,8 @@ def test_bootimg_invalid_file(args):
|
||||||
|
|
||||||
def test_bootimg_normal(args):
|
def test_bootimg_normal(args):
|
||||||
path = pmb_test.const.testdata + "/bootimg/normal-boot.img"
|
path = pmb_test.const.testdata + "/bootimg/normal-boot.img"
|
||||||
output = {"base": "0x80000000",
|
output = {"header_version": "0",
|
||||||
|
"base": "0x80000000",
|
||||||
"kernel_offset": "0x00008000",
|
"kernel_offset": "0x00008000",
|
||||||
"ramdisk_offset": "0x04000000",
|
"ramdisk_offset": "0x04000000",
|
||||||
"second_offset": "0x00f00000",
|
"second_offset": "0x00f00000",
|
||||||
|
@ -73,7 +74,8 @@ def test_bootimg_qcdt(args):
|
||||||
|
|
||||||
def test_bootimg_mtk_mkimage(args):
|
def test_bootimg_mtk_mkimage(args):
|
||||||
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot.img"
|
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot.img"
|
||||||
output = {"base": "0x10000000",
|
output = {"header_version": "0",
|
||||||
|
"base": "0x10000000",
|
||||||
"kernel_offset": "0x00008000",
|
"kernel_offset": "0x00008000",
|
||||||
"ramdisk_offset": "0x01000000",
|
"ramdisk_offset": "0x01000000",
|
||||||
"second_offset": "0x00f00000",
|
"second_offset": "0x00f00000",
|
||||||
|
@ -88,7 +90,8 @@ def test_bootimg_mtk_mkimage(args):
|
||||||
|
|
||||||
def test_bootimg_mtk_mkimage_recovery(args):
|
def test_bootimg_mtk_mkimage_recovery(args):
|
||||||
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot-recovery.img"
|
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot-recovery.img"
|
||||||
output = {"base": "0x80000000",
|
output = {"header_version": "0",
|
||||||
|
"base": "0x80000000",
|
||||||
"kernel_offset": "0x00008000",
|
"kernel_offset": "0x00008000",
|
||||||
"ramdisk_offset": "0x04000000",
|
"ramdisk_offset": "0x04000000",
|
||||||
"second_offset": "0x00f00000",
|
"second_offset": "0x00f00000",
|
||||||
|
@ -103,7 +106,8 @@ def test_bootimg_mtk_mkimage_recovery(args):
|
||||||
|
|
||||||
def test_bootimg_dtb_second(args):
|
def test_bootimg_dtb_second(args):
|
||||||
path = pmb_test.const.testdata + "/bootimg/dtb-second-boot.img"
|
path = pmb_test.const.testdata + "/bootimg/dtb-second-boot.img"
|
||||||
output = {"base": "0x00000000",
|
output = {"header_version": "0",
|
||||||
|
"base": "0x00000000",
|
||||||
"kernel_offset": "0x00008000",
|
"kernel_offset": "0x00008000",
|
||||||
"ramdisk_offset": "0x02000000",
|
"ramdisk_offset": "0x02000000",
|
||||||
"second_offset": "0x00f00000",
|
"second_offset": "0x00f00000",
|
||||||
|
@ -116,6 +120,23 @@ def test_bootimg_dtb_second(args):
|
||||||
assert pmb.parse.bootimg(args, path) == output
|
assert pmb.parse.bootimg(args, path) == output
|
||||||
|
|
||||||
|
|
||||||
|
def test_bootimg_v2(args):
|
||||||
|
path = pmb_test.const.testdata + "/bootimg/boot-header-v2.img"
|
||||||
|
output = {"header_version": "2",
|
||||||
|
"base": "0x40078000",
|
||||||
|
"kernel_offset": "0x00008000",
|
||||||
|
"ramdisk_offset": "0x07c08000",
|
||||||
|
"second_offset": "0x00e10000",
|
||||||
|
"tags_offset": "0x0bc08000",
|
||||||
|
"pagesize": "2048",
|
||||||
|
"dtb_offset": "0x0bc08000",
|
||||||
|
"cmdline": "bootopt=64S3,32N2,64N2 systempart=/dev/mapper/system",
|
||||||
|
"qcdt": "false",
|
||||||
|
"mtk_mkimage": "false",
|
||||||
|
"dtb_second": "false"}
|
||||||
|
assert pmb.parse.bootimg(args, path) == output
|
||||||
|
|
||||||
|
|
||||||
def test_bootimg_v3(args):
|
def test_bootimg_v3(args):
|
||||||
path = pmb_test.const.testdata + "/bootimg/boot-header-v3.img"
|
path = pmb_test.const.testdata + "/bootimg/boot-header-v3.img"
|
||||||
output = {"header_version": "3",
|
output = {"header_version": "3",
|
||||||
|
|
|
@ -21,17 +21,21 @@ def args(tmpdir, request):
|
||||||
|
|
||||||
|
|
||||||
def test_kconfig_check(args):
|
def test_kconfig_check(args):
|
||||||
|
# non-existing package
|
||||||
|
assert pmb.parse.kconfig.check(args, "non-existing-kernel-package",
|
||||||
|
must_exist=False) is None
|
||||||
|
|
||||||
# basic checks, from easiers to hard-ish
|
# basic checks, from easiers to hard-ish
|
||||||
dir = f"{pmb_test.const.testdata}/kconfig_check/"
|
dir = f"{pmb_test.const.testdata}/kconfig_check/"
|
||||||
assert not pmb.parse.kconfig.check_file(dir +
|
assert not pmb.parse.kconfig.check_file(dir +
|
||||||
"bad-missing-required-option")
|
"bad-missing-required-option")
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good")
|
assert pmb.parse.kconfig.check_file(dir + "good")
|
||||||
assert not pmb.parse.kconfig.check_file(dir + "bad-wrong-option-set")
|
assert not pmb.parse.kconfig.check_file(dir + "bad-wrong-option-set")
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good-anbox",
|
assert pmb.parse.kconfig.check_file(dir + "good-waydroid",
|
||||||
anbox=True)
|
waydroid=True)
|
||||||
assert not pmb.parse.kconfig.check_file(dir +
|
assert not pmb.parse.kconfig.check_file(dir +
|
||||||
"bad-array-missing-some-options",
|
"bad-array-missing-some-options",
|
||||||
anbox=True)
|
waydroid=True)
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good-nftables",
|
assert pmb.parse.kconfig.check_file(dir + "good-nftables",
|
||||||
nftables=True)
|
nftables=True)
|
||||||
assert not pmb.parse.kconfig.check_file(dir + "bad-nftables",
|
assert not pmb.parse.kconfig.check_file(dir + "bad-nftables",
|
||||||
|
@ -52,12 +56,12 @@ def test_kconfig_check(args):
|
||||||
# supports nftables (with pmb:kconfigcheck-nftables)
|
# supports nftables (with pmb:kconfigcheck-nftables)
|
||||||
assert pmb.parse.kconfig.check(args, "nokia-n900")
|
assert pmb.parse.kconfig.check(args, "nokia-n900")
|
||||||
|
|
||||||
# supports Anbox (with pmb:kconfigcheck-anbox)
|
# supports Waydroid (with pmb:kconfigcheck-waydroid)
|
||||||
assert pmb.parse.kconfig.check(args, "postmarketos-allwinner")
|
assert pmb.parse.kconfig.check(args, "postmarketos-allwinner")
|
||||||
|
|
||||||
# testing the force param: nokia-n900 will never have anbox support
|
# testing the force param: nokia-n900 will never need the uefi options
|
||||||
assert not pmb.parse.kconfig.check(args, "nokia-n900",
|
assert not pmb.parse.kconfig.check(args, "nokia-n900",
|
||||||
force_anbox_check=True)
|
force_uefi_check=True)
|
||||||
|
|
||||||
# supports zram (with pmb:kconfigcheck-zram), nftables
|
# supports zram (with pmb:kconfigcheck-zram), nftables
|
||||||
assert pmb.parse.kconfig.check(args, "linux-purism-librem5")
|
assert pmb.parse.kconfig.check(args, "linux-purism-librem5")
|
||||||
|
|
|
@ -91,7 +91,8 @@ def test_questions_bootimg(args, monkeypatch):
|
||||||
|
|
||||||
bootimg_path = pmb_test.const.testdata + "/bootimg/normal-boot.img"
|
bootimg_path = pmb_test.const.testdata + "/bootimg/normal-boot.img"
|
||||||
fake_answers(monkeypatch, [bootimg_path])
|
fake_answers(monkeypatch, [bootimg_path])
|
||||||
output = {"base": "0x80000000",
|
output = {"header_version": "0",
|
||||||
|
"base": "0x80000000",
|
||||||
"kernel_offset": "0x00008000",
|
"kernel_offset": "0x00008000",
|
||||||
"ramdisk_offset": "0x04000000",
|
"ramdisk_offset": "0x04000000",
|
||||||
"second_offset": "0x00f00000",
|
"second_offset": "0x00f00000",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
|
||||||
|
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
|
||||||
pkgname=binutils
|
pkgname=binutils
|
||||||
pkgver=2.35.2
|
pkgver=2.39
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Tools necessary to build programs"
|
pkgdesc="Tools necessary to build programs"
|
||||||
url="https://www.gnu.org/software/binutils/"
|
url="https://www.gnu.org/software/binutils/"
|
||||||
|
@ -15,7 +16,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||||
gold-mips.patch
|
gold-mips.patch
|
||||||
ld-bfd-mips.patch
|
ld-bfd-mips.patch
|
||||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
CVE-2021-3487.patch
|
binutils-mips-disable-assert.patch
|
||||||
"
|
"
|
||||||
builddir="$srcdir/$pkgname-$pkgver"
|
builddir="$srcdir/$pkgname-$pkgver"
|
||||||
|
|
||||||
|
@ -45,10 +46,12 @@ build() {
|
||||||
local _cross_configure="--enable-install-libiberty --enable-shared"
|
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||||
local _arch_configure=""
|
local _arch_configure=""
|
||||||
local _gold_configure="--disable-gold"
|
local _gold_configure="--disable-gold"
|
||||||
|
local _plugin_configure="--enable-plugins"
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
_sysroot="$CBUILDROOT"
|
_sysroot="$CBUILDROOT"
|
||||||
_cross_configure="--disable-install-libiberty"
|
_cross_configure="--disable-install-libiberty"
|
||||||
|
_plugin_configure="--disable-plugins"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||||
|
@ -78,12 +81,14 @@ build() {
|
||||||
--mandir=/usr/share/man \
|
--mandir=/usr/share/man \
|
||||||
--infodir=/usr/share/info \
|
--infodir=/usr/share/info \
|
||||||
--disable-multilib \
|
--disable-multilib \
|
||||||
|
--disable-gprofng \
|
||||||
--enable-ld=default \
|
--enable-ld=default \
|
||||||
$_gold_configure \
|
$_gold_configure \
|
||||||
--enable-64-bit-bfd \
|
--enable-64-bit-bfd \
|
||||||
--enable-plugins \
|
$_plugin_configure \
|
||||||
--enable-relro \
|
--enable-relro \
|
||||||
--enable-deterministic-archives \
|
--enable-deterministic-archives \
|
||||||
|
--enable-default-execstack=no \
|
||||||
$_cross_configure \
|
$_cross_configure \
|
||||||
$_arch_configure \
|
$_arch_configure \
|
||||||
$_hash_style_configure \
|
$_hash_style_configure \
|
||||||
|
@ -106,6 +111,7 @@ package() {
|
||||||
# with the native tools, or other cross tools
|
# with the native tools, or other cross tools
|
||||||
rm -r "${pkgdir:?}"/usr/share
|
rm -r "${pkgdir:?}"/usr/share
|
||||||
rm -f "$pkgdir"/usr/lib/libiberty.a
|
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||||
|
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,9 +133,11 @@ gold() {
|
||||||
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz
|
sha512sums="
|
||||||
|
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
b08384ed124a74ad3a424db370c107230f09a54378502ca4385deb738f7cf799857f2af0db52709c7eeab8fa6c0a3d972f891396cce1e2834a21f67682fc4355 CVE-2021-3487.patch"
|
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||||
|
"
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
|
||||||
|
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
|
||||||
|
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
|
||||||
pkgname=gcc
|
pkgname=gcc
|
||||||
pkgver=8.2.0
|
_pkgbase=12.2.1 # must match gcc/BASE-VER
|
||||||
|
_pkgsnap=20220924
|
||||||
|
pkgver=${_pkgbase}_git${_pkgsnap}
|
||||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||||
|
@ -8,33 +12,35 @@ pkgver=8.2.0
|
||||||
pkgname="$pkgname$_target"
|
pkgname="$pkgname$_target"
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="The GNU Compiler Collection"
|
pkgdesc="The GNU Compiler Collection"
|
||||||
url="http://gcc.gnu.org"
|
url="https://gcc.gnu.org"
|
||||||
arch="all"
|
arch="all"
|
||||||
license="GPL LGPL"
|
license="GPL-2.0-or-later LGPL-2.1-or-later"
|
||||||
_gccrel=$pkgver-r$pkgrel
|
_gccrel=$pkgver-r$pkgrel
|
||||||
depends="binutils$_target isl"
|
depends="binutils$_target"
|
||||||
makedepends_build="gcc$_cross g++$_cross paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
makedepends_build="gcc$_cross g++$_cross 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 !gettext-dev"
|
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev !gettext-dev libucontext-dev"
|
||||||
subpackages=" "
|
subpackages=" "
|
||||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
||||||
replaces="libstdc++ binutils"
|
replaces="libstdc++ binutils"
|
||||||
|
|
||||||
: ${LANG_CXX:=true}
|
: "${LANG_CXX:=true}"
|
||||||
: ${LANG_OBJC:=true}
|
: "${LANG_D:=true}"
|
||||||
: ${LANG_GO:=true}
|
: "${LANG_OBJC:=true}"
|
||||||
: ${LANG_FORTRAN:=true}
|
: "${LANG_GO:=true}"
|
||||||
: ${LANG_ADA:=true}
|
: "${LANG_FORTRAN:=true}"
|
||||||
|
: "${LANG_ADA:=true}"
|
||||||
|
: "${LANG_JIT:=true}"
|
||||||
|
|
||||||
LIBGOMP=true
|
_libgomp=true
|
||||||
LIBGCC=true
|
_libgcc=true
|
||||||
LIBATOMIC=true
|
_libatomic=true
|
||||||
LIBITM=true
|
_libitm=true
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||||
LANG_CXX=false
|
LANG_CXX=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
LIBGCC=false
|
_libgcc=false
|
||||||
_builddir="$srcdir/build-cross-pass2"
|
_builddir="$srcdir/build-cross-pass2"
|
||||||
else
|
else
|
||||||
_builddir="$srcdir/build-cross-final"
|
_builddir="$srcdir/build-cross-final"
|
||||||
|
@ -42,9 +48,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
LIBGOMP=false
|
LANG_D=false
|
||||||
LIBATOMIC=false
|
LANG_JIT=false
|
||||||
LIBITM=false
|
_libgomp=false
|
||||||
|
_libatomic=false
|
||||||
|
_libitm=false
|
||||||
|
|
||||||
# reset target flags (should be set in crosscreate abuild)
|
# reset target flags (should be set in crosscreate abuild)
|
||||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||||
|
@ -78,6 +86,8 @@ elif [ "$CBUILD" != "$CHOST" ]; then
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
|
LANG_D=false
|
||||||
|
LANG_JIT=false
|
||||||
|
|
||||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||||
_builddir="$srcdir/build-cross-native"
|
_builddir="$srcdir/build-cross-native"
|
||||||
|
@ -86,37 +96,63 @@ else
|
||||||
_builddir="$srcdir/build"
|
_builddir="$srcdir/build"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Go needs {set,make,swap}context, unimplemented in musl
|
case "$CARCH" in
|
||||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
# GDC hasn't been ported to PowerPC
|
||||||
|
# See libphobos/configure.tgt in GCC sources for supported targets
|
||||||
|
# riscv fails with: error: static assert "unimplemented"
|
||||||
|
ppc64le|riscv64) LANG_D=false ;;
|
||||||
|
# GDC does currently not work on 32-bit musl architectures.
|
||||||
|
# This is a known upstream issue.
|
||||||
|
# See: https://github.com/dlang/druntime/pull/3383
|
||||||
|
armhf|armv7|x86) LANG_D=false ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# libitm has TEXTRELs in ARM build, so disable for now
|
# libitm has TEXTRELs in ARM build, so disable for now
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
arm*) LIBITM=false ;;
|
arm*) _libitm=false ;;
|
||||||
mips*) LIBITM=false ;;
|
mips*) _libitm=false ;;
|
||||||
|
riscv64) _libitm=false ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Internal libffi fails to build on MIPS at the moment, need to
|
||||||
|
# investigate further. We disable LANG_GO on mips64 as it requires
|
||||||
|
# the internal libffi.
|
||||||
|
case "$CTARGET_ARCH" in
|
||||||
|
mips*) LANG_GO=false ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fortran uses libquadmath if toolchain has __float128
|
# Fortran uses libquadmath if toolchain has __float128
|
||||||
# currently on x86, x86_64 and ia64
|
# currently on x86, x86_64 and ia64
|
||||||
LIBQUADMATH=$LANG_FORTRAN
|
_libquadmath=$LANG_FORTRAN
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
|
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
|
||||||
*) LIBQUADMATH=false ;;
|
*) _libquadmath=false ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# libatomic is a dependency for openvswitch
|
# libatomic is a dependency for openvswitch
|
||||||
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||||
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||||
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||||
if $LIBGOMP; then
|
if $_libgomp; then
|
||||||
depends="$depends libgomp=$_gccrel"
|
depends="$depends libgomp=$_gccrel"
|
||||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$CARCH" in
|
||||||
|
riscv64)
|
||||||
|
LANG_ADA=false;;
|
||||||
|
esac
|
||||||
|
|
||||||
_languages=c
|
_languages=c
|
||||||
if $LANG_CXX; then
|
if $LANG_CXX; then
|
||||||
subpackages="$subpackages libstdc++:libcxx:$CTARGET_ARCH g++$_target:gpp"
|
subpackages="$subpackages libstdc++:libcxx:$CTARGET_ARCH libstdc++-dev$_target:libcxx_dev g++$_target:gpp"
|
||||||
_languages="$_languages,c++"
|
_languages="$_languages,c++"
|
||||||
fi
|
fi
|
||||||
|
if $LANG_D; then
|
||||||
|
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
|
||||||
|
_languages="$_languages,d"
|
||||||
|
makedepends_build="$makedepends_build libucontext-dev gcc-gdc-bootstrap"
|
||||||
|
fi
|
||||||
if $LANG_OBJC; then
|
if $LANG_OBJC; then
|
||||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||||
_languages="$_languages,objc"
|
_languages="$_languages,objc"
|
||||||
|
@ -130,56 +166,83 @@ if $LANG_FORTRAN; then
|
||||||
_languages="$_languages,fortran"
|
_languages="$_languages,fortran"
|
||||||
fi
|
fi
|
||||||
if $LANG_ADA; then
|
if $LANG_ADA; then
|
||||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
subpackages="$subpackages gcc-gnat$_target:gnat"
|
||||||
_languages="$_languages,ada"
|
_languages="$_languages,ada"
|
||||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
if [ "$CBUILD" = "$CTARGET" ]; then
|
||||||
|
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
|
||||||
|
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
|
||||||
|
else
|
||||||
|
subpackages="$subpackages libgnat::$CTARGET_ARCH"
|
||||||
|
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if $LANG_JIT; then
|
||||||
|
subpackages="$subpackages libgccjit:jit libgccjit-dev:jitdev"
|
||||||
fi
|
fi
|
||||||
makedepends="$makedepends_build $makedepends_host"
|
makedepends="$makedepends_build $makedepends_host"
|
||||||
|
|
||||||
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
# when using upstream releases, use this URI template
|
||||||
002_all_default-relro.patch
|
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
||||||
003_all_default-fortify-source.patch
|
#
|
||||||
005_all_default-as-needed.patch
|
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
|
||||||
gcc-as-needed-gold.patch
|
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
|
||||||
gcc-as-needed-push-pop.patch
|
# mirrored on dev.alpinelinux.org. Please ensure that the snapshot Git commit (as stated in the
|
||||||
011_all_default-warn-format-security.patch
|
# README) matches the base commit on the version-specific branch in the Git repository below.
|
||||||
012_all_default-warn-trampolines.patch
|
#
|
||||||
013_all_default-ssp-fix.patch
|
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
|
||||||
020_all_msgfmt-libstdc++-link.patch
|
# so that they can be properly tracked and easily rebased if needed.
|
||||||
050_all_libiberty-asprintf.patch
|
source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-${_pkgbase%%.*}-${_pkgsnap}.tar.xz
|
||||||
051_all_libiberty-pic.patch
|
0001-posix_memalign.patch
|
||||||
053_all_libitm-no-fortify-source.patch
|
0002-gcc-poison-system-directories.patch
|
||||||
090_all_pr55930-dependency-tracking.patch
|
0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||||
0003-gcc-poison-system-directories.patch
|
0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||||
|
0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||||
203-libgcc_s.patch
|
0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||||
205-nopie.patch
|
0007-Enable-Wtrampolines-by-default.patch
|
||||||
0002-posix_memalign.patch
|
0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||||
0008-s390x-muslldso.patch
|
0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||||
0010-ldbl128-config.patch
|
0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||||
0012-static-pie.patch
|
0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||||
|
0012-libitm-disable-FORTIFY.patch
|
||||||
libgcc-always-build-gcceh.a.patch
|
0013-libgcc_s.patch
|
||||||
gcc-4.9-musl-fortify.patch
|
0014-nopie.patch
|
||||||
gcc-6.1-musl-libssp.patch
|
0015-dlang-use-libucontext-on-mips64.patch
|
||||||
gcc-pure64.patch
|
0016-ada-fix-shared-linking.patch
|
||||||
|
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||||
fix-cxxflags-passing.patch
|
0018-add-fortify-headers-paths.patch
|
||||||
ada-shared.patch
|
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||||
ada-musl.patch
|
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||||
libgnarl-musl.patch
|
0021-mips64-disable-multilib-support.patch
|
||||||
|
0022-aarch64-disable-multilib-support.patch
|
||||||
320-libffi-gnulinux.patch
|
0023-s390x-disable-multilib-support.patch
|
||||||
|
0024-ppc64-le-disable-multilib-support.patch
|
||||||
gcc-pure64-mips.patch
|
0025-x86_64-disable-multilib-support.patch
|
||||||
|
0026-riscv-disable-multilib-support.patch
|
||||||
|
0027-always-build-libgcc_eh.a.patch
|
||||||
|
0028-ada-libgnarl-compatibility-for-musl.patch
|
||||||
|
0029-ada-musl-support-fixes.patch
|
||||||
|
0033-gcc-go-link-to-libucontext.patch
|
||||||
|
0034-Use-generic-errstr.go-implementation-on-musl.patch
|
||||||
|
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||||
|
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||||
|
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||||
|
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||||
|
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||||
|
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
|
||||||
|
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||||
|
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||||
|
0045-druntime-link-against-libucontext-on-all-platforms.patch
|
||||||
|
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
|
||||||
|
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
|
||||||
|
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
|
||||||
|
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||||
|
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
|
||||||
"
|
"
|
||||||
|
|
||||||
# gcc-4.8-build-args.patch
|
|
||||||
|
|
||||||
# we build out-of-tree
|
# we build out-of-tree
|
||||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
|
_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-${_pkgsnap}
|
||||||
_gcclibdir=/usr/lib/gcc/${CTARGET}/$pkgver
|
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||||
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$pkgver
|
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "$_gccdir"
|
cd "$_gccdir"
|
||||||
|
@ -202,7 +265,7 @@ prepare() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ${pkgver} > gcc/BASE-VER
|
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -211,6 +274,7 @@ build() {
|
||||||
local _cross_configure=
|
local _cross_configure=
|
||||||
local _bootstrap_configure=
|
local _bootstrap_configure=
|
||||||
local _symvers=
|
local _symvers=
|
||||||
|
local _jit_configure=
|
||||||
|
|
||||||
cd "$_gccdir"
|
cd "$_gccdir"
|
||||||
|
|
||||||
|
@ -228,6 +292,7 @@ build() {
|
||||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||||
|
riscv64-*-*-*) _arch_configure="--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
|
@ -254,10 +319,10 @@ build() {
|
||||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||||
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||||
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||||
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
|
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||||
|
|
||||||
msg "Building the following:"
|
msg "Building the following:"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -271,78 +336,112 @@ build() {
|
||||||
echo " libc_configure=$_libc_configure"
|
echo " libc_configure=$_libc_configure"
|
||||||
echo " cross_configure=$_cross_configure"
|
echo " cross_configure=$_cross_configure"
|
||||||
echo " bootstrap_configure=$_bootstrap_configure"
|
echo " bootstrap_configure=$_bootstrap_configure"
|
||||||
echo " hash_style_configure=$_hash_style_configure"
|
echo " hash_style_configure=$_hash_style_configure"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
export CFLAGS="$CFLAGS -O2"
|
||||||
|
export CXXFLAGS="$CXXFLAGS -O2"
|
||||||
|
export CPPFLAGS="$CPPFLAGS -O2"
|
||||||
|
|
||||||
|
local version="Alpine $pkgver-r$pkgrel"
|
||||||
|
local gccconfiguration="
|
||||||
|
--prefix=/usr
|
||||||
|
--mandir=/usr/share/man
|
||||||
|
--infodir=/usr/share/info
|
||||||
|
--build=${CBUILD}
|
||||||
|
--host=${CHOST}
|
||||||
|
--target=${CTARGET}
|
||||||
|
--enable-checking=release
|
||||||
|
--disable-fixed-point
|
||||||
|
--disable-libstdcxx-pch
|
||||||
|
--disable-multilib
|
||||||
|
--disable-nls
|
||||||
|
--disable-werror
|
||||||
|
$_symvers
|
||||||
|
--enable-__cxa_atexit
|
||||||
|
--enable-default-pie
|
||||||
|
--enable-default-ssp
|
||||||
|
--enable-cloog-backend
|
||||||
|
--enable-languages=$_languages
|
||||||
|
$_arch_configure
|
||||||
|
$_libc_configure
|
||||||
|
$_cross_configure
|
||||||
|
$_bootstrap_configure
|
||||||
|
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
|
||||||
|
--with-system-zlib
|
||||||
|
$_hash_style_configure
|
||||||
|
"
|
||||||
|
|
||||||
mkdir -p "$_builddir"
|
mkdir -p "$_builddir"
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
"$_gccdir"/configure --prefix=/usr \
|
"$_gccdir"/configure $gccconfiguration \
|
||||||
--mandir=/usr/share/man \
|
--with-pkgversion="$version"
|
||||||
--infodir=/usr/share/info \
|
|
||||||
--build=${CBUILD} \
|
msg "building gcc"
|
||||||
--host=${CHOST} \
|
|
||||||
--target=${CTARGET} \
|
|
||||||
--with-pkgversion="Alpine ${pkgver}" \
|
|
||||||
--enable-checking=release \
|
|
||||||
--disable-fixed-point \
|
|
||||||
--disable-libstdcxx-pch \
|
|
||||||
--disable-multilib \
|
|
||||||
--disable-nls \
|
|
||||||
--disable-werror \
|
|
||||||
$_symvers \
|
|
||||||
--enable-__cxa_atexit \
|
|
||||||
--enable-default-pie \
|
|
||||||
--enable-default-ssp \
|
|
||||||
--enable-cloog-backend \
|
|
||||||
--enable-languages=$_languages \
|
|
||||||
$_arch_configure \
|
|
||||||
$_libc_configure \
|
|
||||||
$_cross_configure \
|
|
||||||
$_bootstrap_configure \
|
|
||||||
--with-system-zlib \
|
|
||||||
$_hash_style_configure
|
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# we build gccjit separate to not build all of gcc with --enable-host-shared
|
||||||
|
# as doing so slows it down a few %, so for some quick if's here we gain
|
||||||
|
# free performance
|
||||||
|
if $LANG_JIT; then
|
||||||
|
mkdir -p "$_builddir"/libgccjit-build
|
||||||
|
cd "$_builddir"/libgccjit-build
|
||||||
|
"$_gccdir"/configure $gccconfiguration \
|
||||||
|
--disable-bootstrap \
|
||||||
|
--enable-host-shared \
|
||||||
|
--enable-languages=jit \
|
||||||
|
--with-pkgversion="$version"
|
||||||
|
|
||||||
|
msg "building libgccjit"
|
||||||
|
make all-gcc
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
make -j1 DESTDIR="${pkgdir}" install
|
make DESTDIR="$pkgdir" install
|
||||||
|
|
||||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||||
|
|
||||||
# we don't support gcj -static
|
if $LANG_JIT; then
|
||||||
|
make -C "$_builddir"/libgccjit-build/gcc DESTDIR="$pkgdir" jit.install-common
|
||||||
|
fi
|
||||||
|
|
||||||
|
# we dont support gcj -static
|
||||||
# and saving 35MB is not bad.
|
# and saving 35MB is not bad.
|
||||||
find "$pkgdir" -name libgtkpeer.a \
|
find "$pkgdir" \( -name libgtkpeer.a \
|
||||||
-o -name libgjsmalsa.a -o \
|
-o -name libgjsmalsa.a \
|
||||||
-o -name libgij.a -o \
|
-o -name libgij.a \) \
|
||||||
| xargs rm -f
|
-delete
|
||||||
|
|
||||||
# strip debug info from some static libs
|
# strip debug info from some static libs
|
||||||
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||||
|
-o -name libgphobos.a -o -name libgdruntime.a \
|
||||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||||
-a -type f`
|
-a -type f \
|
||||||
|
-exec ${STRIP_FOR_TARGET} -g {} +
|
||||||
|
|
||||||
if $LIBGOMP; then
|
if $_libgomp; then
|
||||||
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
||||||
fi
|
fi
|
||||||
if $LIBITM; then
|
if $_libitm; then
|
||||||
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove ffi
|
# remove ffi
|
||||||
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
||||||
find "$pkgdir" -name 'ffi*.h' | xargs rm -f
|
find "$pkgdir" -name 'ffi*.h' -delete
|
||||||
|
|
||||||
local gdblib=${_target:+$CTARGET/}lib
|
local gdblib=${_target:+$CTARGET/}lib
|
||||||
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py" ); do
|
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
|
||||||
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
|
||||||
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
||||||
done
|
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
||||||
|
done
|
||||||
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
|
fi
|
||||||
|
|
||||||
# move ada runtime libs
|
# move ada runtime libs
|
||||||
if $LANG_ADA; then
|
if $LANG_ADA; then
|
||||||
|
@ -350,20 +449,26 @@ package() {
|
||||||
mv "$i" "$pkgdir"/usr/lib/
|
mv "$i" "$pkgdir"/usr/lib/
|
||||||
ln -s ../../../../${i##*/} $i
|
ln -s ../../../../${i##*/} $i
|
||||||
done
|
done
|
||||||
|
if [ "$CHOST" = "$CTARGET" ]; then
|
||||||
|
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
|
||||||
|
mv "$i" "$pkgdir"/usr/lib/
|
||||||
|
ln -s ../../../../${i##*/} $i
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
# cross-gcc: remove any files that would conflict with the
|
# cross-gcc: remove any files that would conflict with the
|
||||||
# native gcc package
|
# native gcc package
|
||||||
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "$pkgdir"/usr/share
|
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
|
||||||
# libcc1 does not depend on target, don't ship it
|
# libcc1 does not depend on target, don't ship it
|
||||||
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
||||||
|
|
||||||
# fixup gcc library symlinks to be linker scripts so
|
# fixup gcc library symlinks to be linker scripts so
|
||||||
# linker finds the libs from relocated sysroot
|
# linker finds the libs from relocated sysroot
|
||||||
for so in "$pkgdir"/usr/$CTARGET/lib/*.so; do
|
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
|
||||||
if [ -h "$so" ]; then
|
if [ -h "$so" ]; then
|
||||||
local _real=$(basename $(readlink "$so"))
|
local _real=$(basename "$(readlink "$so")")
|
||||||
rm -f "$so"
|
rm -f "$so"
|
||||||
echo "GROUP ($_real)" > "$so"
|
echo "GROUP ($_real)" > "$so"
|
||||||
fi
|
fi
|
||||||
|
@ -372,29 +477,33 @@ package() {
|
||||||
# add c89/c99 wrapper scripts
|
# add c89/c99 wrapper scripts
|
||||||
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
fl="-std=c89"
|
_flavor="-std=c89"
|
||||||
for opt; do
|
for opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
-ansi|-std=c89|-std=iso9899:1990) fl="";;
|
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
|
||||||
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
exec gcc $fl ${1+"$@"}
|
exec gcc $_flavor ${1+"$@"}
|
||||||
EOF
|
EOF
|
||||||
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
fl="-std=c99"
|
_flavor="-std=c99"
|
||||||
for opt; do
|
for opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
-std=c99|-std=iso9899:1999) fl="";;
|
-std=c99|-std=iso9899:1999) _flavor="";;
|
||||||
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
exec gcc $fl ${1+"$@"}
|
exec gcc $_flavor ${1+"$@"}
|
||||||
EOF
|
EOF
|
||||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||||
|
|
||||||
|
# install lto plugin so regular binutils may use it
|
||||||
|
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
|
||||||
|
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,26 +520,53 @@ libcxx() {
|
||||||
pkgdesc="GNU C++ standard runtime library"
|
pkgdesc="GNU C++ standard runtime library"
|
||||||
depends=
|
depends=
|
||||||
|
|
||||||
|
if [ "$CHOST" = "$CTARGET" ]; then
|
||||||
|
# verify that we are using clock_gettime rather than doing direct syscalls
|
||||||
|
# so we dont break 32 bit arches due to time64.
|
||||||
|
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/usr/lib
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libcxx_dev() {
|
||||||
|
pkgdesc="GNU C++ standard runtime library (development files)"
|
||||||
|
depends=
|
||||||
|
replaces="g++"
|
||||||
|
|
||||||
|
amove usr/${_target:+$CTARGET/}lib/libstdc++.a \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libstdc++.so \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libstdc++fs.a \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libsupc++.a \
|
||||||
|
usr/${_target:+$CTARGET/}include/c++
|
||||||
|
}
|
||||||
|
|
||||||
gpp() {
|
gpp() {
|
||||||
pkgdesc="GNU C++ standard library and compiler"
|
pkgdesc="GNU C++ standard library and compiler"
|
||||||
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
|
||||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
"$subpkgdir"/usr/bin \
|
"$subpkgdir"/usr/bin \
|
||||||
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
||||||
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
||||||
|
|
||||||
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
||||||
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
|
|
||||||
|
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
|
||||||
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jit() {
|
||||||
|
pkgdesc="GCC JIT Library"
|
||||||
|
depends=
|
||||||
|
amove usr/lib/libgccjit.so*
|
||||||
|
}
|
||||||
|
|
||||||
|
jitdev() {
|
||||||
|
pkgdesc="GCC JIT Library (development files)"
|
||||||
|
depends="libgccjit"
|
||||||
|
amove usr/include/libgccjit*.h
|
||||||
|
}
|
||||||
|
|
||||||
libobjc() {
|
libobjc() {
|
||||||
pkgdesc="GNU Objective-C runtime"
|
pkgdesc="GNU Objective-C runtime"
|
||||||
replaces="objc"
|
replaces="objc"
|
||||||
|
@ -444,8 +580,10 @@ objc() {
|
||||||
replaces="gcc"
|
replaces="gcc"
|
||||||
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibdir/include \
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
|
"$subpkgdir"/$_gcclibdir/include \
|
||||||
"$subpkgdir"/usr/lib
|
"$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
|
||||||
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
||||||
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
|
@ -468,6 +606,40 @@ libgomp() {
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libgphobos() {
|
||||||
|
pkgdesc="D programming language standard library for GCC"
|
||||||
|
depends=
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
|
||||||
|
}
|
||||||
|
|
||||||
|
gdc() {
|
||||||
|
pkgdesc="GCC-based D language compiler"
|
||||||
|
depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev"
|
||||||
|
depends="$depends libucontext-dev"
|
||||||
|
provides="gcc-gdc-bootstrap=$_gccrel"
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
|
"$subpkgdir"/$_gcclibdir/include/d/ \
|
||||||
|
"$subpkgdir"/usr/lib \
|
||||||
|
"$subpkgdir"/usr/bin
|
||||||
|
# Copy: The installed '.d' files, the static lib, the binary itself
|
||||||
|
# The shared libs are part of 'libgphobos' so one can run program
|
||||||
|
# without installing the compiler
|
||||||
|
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
|
||||||
|
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
|
||||||
|
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
libgo() {
|
libgo() {
|
||||||
pkgdesc="Go runtime library for GCC"
|
pkgdesc="Go runtime library for GCC"
|
||||||
depends=
|
depends=
|
||||||
|
@ -478,17 +650,24 @@ libgo() {
|
||||||
|
|
||||||
go() {
|
go() {
|
||||||
pkgdesc="Go support for GCC"
|
pkgdesc="Go support for GCC"
|
||||||
depends="gcc=$_gccrel libgo=$_gccrel"
|
depends="gcc=$_gccrel libgo=$_gccrel !go"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
"$subpkgdir"/usr/lib \
|
"$subpkgdir"/usr/lib \
|
||||||
"$subpkgdir"/usr/bin
|
"$subpkgdir"/usr/bin
|
||||||
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
||||||
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
||||||
|
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
|
||||||
|
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
|
||||||
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
|
||||||
mv "$pkgdir"/usr/lib/libgo.a \
|
mv "$pkgdir"/usr/lib/libgo.a \
|
||||||
"$pkgdir"/usr/lib/libgo.so \
|
"$pkgdir"/usr/lib/libgo.so \
|
||||||
"$pkgdir"/usr/lib/libgobegin.a \
|
"$pkgdir"/usr/lib/libgobegin.a \
|
||||||
|
"$pkgdir"/usr/lib/libgolibbegin.a \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +691,7 @@ libquadmath() {
|
||||||
gfortran() {
|
gfortran() {
|
||||||
pkgdesc="GNU Fortran Compiler"
|
pkgdesc="GNU Fortran Compiler"
|
||||||
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
||||||
$LIBQUADMATH && depends="$depends libquadmath=$_gccrel"
|
$_libquadmath && depends="$depends libquadmath=$_gccrel"
|
||||||
replaces="gcc"
|
replaces="gcc"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
|
@ -523,11 +702,12 @@ gfortran() {
|
||||||
mv "$pkgdir"/usr/lib/libgfortran.a \
|
mv "$pkgdir"/usr/lib/libgfortran.a \
|
||||||
"$pkgdir"/usr/lib/libgfortran.so \
|
"$pkgdir"/usr/lib/libgfortran.so \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
if $LIBQUADMATH; then
|
if $_libquadmath; then
|
||||||
mv "$pkgdir"/usr/lib/libquadmath.a \
|
mv "$pkgdir"/usr/lib/libquadmath.a \
|
||||||
"$pkgdir"/usr/lib/libquadmath.so \
|
"$pkgdir"/usr/lib/libquadmath.so \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
fi
|
fi
|
||||||
|
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
|
||||||
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
||||||
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
||||||
}
|
}
|
||||||
|
@ -540,9 +720,18 @@ libgnat() {
|
||||||
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libgnatstatic() {
|
||||||
|
pkgdesc="GNU Ada static libraries"
|
||||||
|
depends=
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
|
||||||
|
}
|
||||||
|
|
||||||
gnat() {
|
gnat() {
|
||||||
pkgdesc="Ada support for GCC"
|
pkgdesc="Ada support for GCC"
|
||||||
depends="gcc=$_gccrel"
|
depends="gcc=$_gccrel"
|
||||||
|
provides="$pkgname-gnat-bootstrap=$_gccrel"
|
||||||
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
|
@ -553,34 +742,51 @@ gnat() {
|
||||||
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="64898a165f67e136d802a92e7633bf1b06c85266027e52127ea025bf5fc2291b5e858288aac0bdba246e6cdf7c6ec88bc8e0e7f3f6f1985f4297710cafde56ed gcc-8.2.0.tar.xz
|
sha512sums="
|
||||||
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
|
ba4d9e73d108088da26fbefe18d9b245b76771ffe752c2b4b31bdf38a2d0b638fbc115c377526c27311d4d7ffd4e0d236a5af5016bd364ccaa11a4989d1401e8 gcc-12-20220924.tar.xz
|
||||||
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
|
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
|
||||||
02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch
|
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
|
||||||
6c9a5068f6eea8a85d297a3555b1d2333ffd4b9ddbfb7560a3e643f8577603871ca123373ef7f96e894225291d88f7bf575c7f8386bcfdd1dabcd7ba12598b65 gcc-as-needed-gold.patch
|
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||||
ab0df1862f1b645634e79b8101326ce53215eba39861a455cd145b81b5267a6a61bc6e76b32d53887a0a48873f7efc23e2c52cc04400c6afd89822f245cdbc77 gcc-as-needed-push-pop.patch
|
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||||
e026bf9f73ee254528423c6cabdfd7794960c567161581b7d4b7c61c45027e12a6efef79662d4288b9cbaecb4798f01af6a5b4a13b766c2d501444ac1846fd43 011_all_default-warn-format-security.patch
|
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||||
37de4cc9061bfe1963e6e6570e1a6bbfd58204bf90e0eef819882599a9a80ea28f3eb815c20c1f173dc25d4bd9971b7c7f7f9512d6f8f91f04de1e1175114d4d 012_all_default-warn-trampolines.patch
|
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||||
38a0fedeac3eebe4a6a957792ba520225cf42663c96a171cd168fdb6c91ffa9a56b80351f8238c5d03b78d3ae2a6539a54481fe4848b4a395e2c87f2ff7adc08 013_all_default-ssp-fix.patch
|
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
|
||||||
d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
|
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||||
840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
|
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
|
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||||
e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
|
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||||
4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
|
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
|
||||||
3842bd2be3e53db34e59bfb2bd438b244fc3712055058b9e232e33345f0fab216256b79e364fbac335972dc599a1d74393704f0cd595f3f076dcc10883c85b28 0003-gcc-poison-system-directories.patch
|
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
|
||||||
d1c2d7ff7f673375dc7cd84ae9d8515853b5af6390c70bb763412c012101344e4ee1ce155151ce3fb6ba2b80af7ed42d697dbe1bf6fd6e7b2b9087a378c47c37 203-libgcc_s.patch
|
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
|
||||||
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
|
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
|
||||||
6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch
|
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
|
||||||
7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch
|
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||||
66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
|
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
|
||||||
45d5bc11a89e5af77503ca06eec52d6d84e6fea0be021aaee1bcc39f8dd3c7b4baa4200cfa2b0688faa0f207d005db89c029eff32f362207aa3d2365b2f2363e 0012-static-pie.patch
|
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
|
||||||
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
|
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
|
||||||
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
|
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
|
||||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
|
||||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
|
||||||
50537add461714f44dc6a778e0c6d0e15d6a782591c8aff38d1fb559191ddac2b5ee14a43a3005b389fdf98d2e7468ff4e64c88ba024cf94f9fe0d9854b9e9c8 ada-musl.patch
|
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
|
||||||
a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a15074b4cb58edd5d7e2868607c902dd003e8c464d5066fd4a575 libgnarl-musl.patch
|
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
|
||||||
f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
|
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
|
||||||
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch"
|
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
|
||||||
|
3c04b26554a78096296ca9542c77a91219bd26044dd2cb2006db4c1944889a97c215900b3828ba7e8c675162406db543605a815bdfbd915bf810663b1b253bdd 0033-gcc-go-link-to-libucontext.patch
|
||||||
|
699dc3641099da6136dd3689f06c6553c03b3a85acf83a3fce1beb5425065b3e378535ca9e9100a120fdbafc34871d61c063fd5328a49cd87a15a989ed51706d 0034-Use-generic-errstr.go-implementation-on-musl.patch
|
||||||
|
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||||
|
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||||
|
8bc6823f0b3c66f7b73d7ddb64ffa6930463285c2e9a14a2bc1882bcc4271144eaa1107d713294699caf9481648163cbf43921a2b8e4ac0d55c78a804bae8a3d 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||||
|
e9699f4721778869eb3a8fef2c679208ef5b98584892f30b0e1cb5dc1669f8158198d7792659b1b56c381baf62247d21990dcced9178547affd5d6bfb2d12548 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||||
|
d6dc1bfb881a313d167aaa5658790b0f55eea4336c408cfc6613dd5783440dafd0d37c43031a5f3e69be40f632e38371cd4fb6e5f0494ac4ea4d7d5025d2ae02 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||||
|
684c6a6d52512b973429b6e709966439ac1e174f9e79a33d4a638b452245b457b34752b4b4034ba983f6a712f86522e7adf715bab00a6603f64a12139c5b1e39 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
|
||||||
|
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||||
|
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||||
|
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
|
||||||
|
c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2101dfd4eea2a6d48bf4fae899a0ddb811c81abd7be35c122 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
|
||||||
|
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
|
||||||
|
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
|
||||||
|
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||||
|
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
|
||||||
|
"
|
||||||
|
|
|
@ -2,25 +2,32 @@
|
||||||
# Generator: pmbootstrap aportgen binutils-armhf
|
# Generator: pmbootstrap aportgen binutils-armhf
|
||||||
# Based on: main/binutils
|
# Based on: main/binutils
|
||||||
|
|
||||||
|
|
||||||
|
CTARGET_ARCH=armhf
|
||||||
|
CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
|
||||||
|
|
||||||
pkgname=binutils-armhf
|
pkgname=binutils-armhf
|
||||||
pkgver=2.35.2
|
pkgver=2.39
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Tools necessary to build programs for armhf targets"
|
pkgdesc="Tools necessary to build programs for armhf targets"
|
||||||
url="https://www.gnu.org/software/binutils/"
|
url="https://www.gnu.org/software/binutils/"
|
||||||
makedepends="gettext libtool autoconf automake bison texinfo"
|
makedepends_build="bison flex texinfo"
|
||||||
|
makedepends_host="zlib-dev"
|
||||||
|
makedepends="$makedepends_build $makedepends_host"
|
||||||
arch="x86_64"
|
arch="x86_64"
|
||||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||||
|
subpackages="binutils-dev binutils-doc"
|
||||||
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||||
binutils-ld-fix-static-linking.patch
|
binutils-ld-fix-static-linking.patch
|
||||||
gold-mips.patch
|
gold-mips.patch
|
||||||
ld-bfd-mips.patch
|
ld-bfd-mips.patch
|
||||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
CVE-2021-3487.patch
|
binutils-mips-disable-assert.patch
|
||||||
"
|
"
|
||||||
builddir="$srcdir/binutils-$pkgver"
|
builddir="$srcdir/binutils-$pkgver"
|
||||||
|
|
||||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||||
subpackages=""
|
subpackages="$subpackages binutils-gold"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
|
@ -41,38 +48,102 @@ fi
|
||||||
# - CVE-2017-7614
|
# - CVE-2017-7614
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
_target="$(arch_to_hostspec armhf)"
|
local _sysroot=/
|
||||||
"$builddir"/configure \
|
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||||
--build="$CBUILD" \
|
local _arch_configure=""
|
||||||
--target=$_target \
|
local _gold_configure="--disable-gold"
|
||||||
--with-lib-path=/usr/lib \
|
local _plugin_configure="--enable-plugins"
|
||||||
|
|
||||||
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
|
_sysroot="$CBUILDROOT"
|
||||||
|
_cross_configure="--disable-install-libiberty"
|
||||||
|
_plugin_configure="--disable-plugins"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||||
|
_gold_configure="--enable-gold"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CTARGET_ARCH" = "x86_64" ]; then
|
||||||
|
_arch_configure="--enable-targets=x86_64-pep"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CTARGET_ARCH" = "riscv64" ]; then
|
||||||
|
_gold_configure="--disable-gold"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$CTARGET_ARCH" in
|
||||||
|
mips*) _hash_style_configure="--enable-default-hash-style=sysv" ;;
|
||||||
|
*) _hash_style_configure="--enable-default-hash-style=gnu" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--build=$CBUILD \
|
||||||
|
--host=$CHOST \
|
||||||
|
--target=$CTARGET \
|
||||||
|
--with-build-sysroot="$CBUILDROOT" \
|
||||||
|
--with-sysroot=$_sysroot \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--with-sysroot=/usr/$_target \
|
--mandir=/usr/share/man \
|
||||||
--enable-ld=default \
|
--infodir=/usr/share/info \
|
||||||
--enable-gold=yes \
|
|
||||||
--enable-plugins \
|
|
||||||
--enable-deterministic-archives \
|
|
||||||
--disable-multilib \
|
--disable-multilib \
|
||||||
|
--disable-gprofng \
|
||||||
|
--enable-ld=default \
|
||||||
|
$_gold_configure \
|
||||||
|
--enable-64-bit-bfd \
|
||||||
|
$_plugin_configure \
|
||||||
|
--enable-relro \
|
||||||
|
--enable-deterministic-archives \
|
||||||
|
--enable-default-execstack=no \
|
||||||
|
$_cross_configure \
|
||||||
|
$_arch_configure \
|
||||||
|
$_hash_style_configure \
|
||||||
|
--with-pic \
|
||||||
--disable-werror \
|
--disable-werror \
|
||||||
--disable-nls
|
--disable-nls \
|
||||||
|
--with-mmap \
|
||||||
|
--with-system-zlib
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
make install DESTDIR="$pkgdir"
|
make install DESTDIR="$pkgdir"
|
||||||
|
if [ -d "$pkgdir"/usr/lib64 ]; then
|
||||||
# remove man, info folders
|
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
|
||||||
rm -rf "$pkgdir"/usr/share
|
rmdir "$pkgdir"/usr/lib64
|
||||||
|
fi
|
||||||
# remove files that conflict with non-cross binutils
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
rm -rf "$pkgdir"/usr/lib/bfd-plugins
|
# creating cross tools: remove any files that would conflict
|
||||||
|
# with the native tools, or other cross tools
|
||||||
|
rm -r "${pkgdir:?}"/usr/share
|
||||||
|
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||||
|
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libs() {
|
||||||
|
pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
|
||||||
|
}
|
||||||
|
|
||||||
sha512sums="9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz
|
gold() {
|
||||||
|
pkgdesc="GNU binutils - gold linker"
|
||||||
|
|
||||||
|
if [ -e "$pkgdir"/usr/bin/ld.gold ]; then
|
||||||
|
mkdir -p "$subpkgdir"/usr/bin
|
||||||
|
mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin
|
||||||
|
fi
|
||||||
|
mkdir -p "$subpkgdir"/usr/$CTARGET/bin
|
||||||
|
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
b08384ed124a74ad3a424db370c107230f09a54378502ca4385deb738f7cf799857f2af0db52709c7eeab8fa6c0a3d972f891396cce1e2834a21f67682fc4355 CVE-2021-3487.patch"
|
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||||
|
"
|
||||||
|
|
|
@ -10,7 +10,7 @@ LANG_JAVA=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
options="!strip !tracedeps"
|
options="!strip"
|
||||||
|
|
||||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||||
# when this variable matches "no*"
|
# when this variable matches "no*"
|
||||||
|
@ -24,7 +24,9 @@ CBUILDROOT="/"
|
||||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||||
|
|
||||||
pkgname=gcc-armhf
|
pkgname=gcc-armhf
|
||||||
pkgver=8.2.0
|
_pkgbase=12.2.1 # must match gcc/BASE-VER
|
||||||
|
_pkgsnap=20220924
|
||||||
|
pkgver=${_pkgbase}_git${_pkgsnap}
|
||||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||||
|
@ -32,33 +34,35 @@ pkgver=8.2.0
|
||||||
pkgname=gcc-armhf
|
pkgname=gcc-armhf
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Stage2 cross-compiler for armhf"
|
pkgdesc="Stage2 cross-compiler for armhf"
|
||||||
url="http://gcc.gnu.org"
|
url="https://gcc.gnu.org"
|
||||||
arch="x86_64"
|
arch="x86_64"
|
||||||
license="GPL LGPL"
|
license="GPL-2.0-or-later LGPL-2.1-or-later"
|
||||||
_gccrel=$pkgver-r$pkgrel
|
_gccrel=$pkgver-r$pkgrel
|
||||||
depends="isl binutils-armhf mpc1"
|
depends="binutils-armhf mpc1"
|
||||||
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
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"
|
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
|
||||||
subpackages="g++-armhf:gpp"
|
subpackages="g++-armhf:gpp libstdc++-dev-armhf:libcxx_dev"
|
||||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
||||||
replaces="libstdc++ binutils"
|
replaces="libstdc++ binutils"
|
||||||
|
|
||||||
: ${LANG_CXX:=true}
|
: "${LANG_CXX:=true}"
|
||||||
: ${LANG_OBJC:=true}
|
: "${LANG_D:=true}"
|
||||||
: ${LANG_GO:=true}
|
: "${LANG_OBJC:=true}"
|
||||||
: ${LANG_FORTRAN:=true}
|
: "${LANG_GO:=true}"
|
||||||
: ${LANG_ADA:=true}
|
: "${LANG_FORTRAN:=true}"
|
||||||
|
: "${LANG_ADA:=true}"
|
||||||
|
: "${LANG_JIT:=true}"
|
||||||
|
|
||||||
LIBGOMP="false"
|
_libgomp=true
|
||||||
LIBGCC="false"
|
_libgcc=false
|
||||||
LIBATOMIC="false"
|
_libatomic=true
|
||||||
LIBITM="false"
|
_libitm=true
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||||
LANG_CXX=false
|
LANG_CXX=false
|
||||||
LANG_ADA=false
|
LANG_ADA=false
|
||||||
LIBGCC=false
|
_libgcc=false
|
||||||
_builddir="$srcdir/build-cross-pass2"
|
_builddir="$srcdir/build-cross-pass2"
|
||||||
else
|
else
|
||||||
_builddir="$srcdir/build-cross-final"
|
_builddir="$srcdir/build-cross-final"
|
||||||
|
@ -66,9 +70,11 @@ if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
LIBGOMP=false
|
LANG_D=false
|
||||||
LIBATOMIC=false
|
LANG_JIT=false
|
||||||
LIBITM=false
|
_libgomp=false
|
||||||
|
_libatomic=false
|
||||||
|
_libitm=false
|
||||||
|
|
||||||
# reset target flags (should be set in crosscreate abuild)
|
# reset target flags (should be set in crosscreate abuild)
|
||||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||||
|
@ -102,6 +108,8 @@ elif [ "$CBUILD" != "$CHOST" ]; then
|
||||||
LANG_OBJC=false
|
LANG_OBJC=false
|
||||||
LANG_GO=false
|
LANG_GO=false
|
||||||
LANG_FORTRAN=false
|
LANG_FORTRAN=false
|
||||||
|
LANG_D=false
|
||||||
|
LANG_JIT=false
|
||||||
|
|
||||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||||
_builddir="$srcdir/build-cross-native"
|
_builddir="$srcdir/build-cross-native"
|
||||||
|
@ -110,36 +118,62 @@ else
|
||||||
_builddir="$srcdir/build"
|
_builddir="$srcdir/build"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Go needs {set,make,swap}context, unimplemented in musl
|
case "$CARCH" in
|
||||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
# GDC hasn't been ported to PowerPC
|
||||||
|
# See libphobos/configure.tgt in GCC sources for supported targets
|
||||||
|
# riscv fails with: error: static assert "unimplemented"
|
||||||
|
ppc64le|riscv64) LANG_D=false ;;
|
||||||
|
# GDC does currently not work on 32-bit musl architectures.
|
||||||
|
# This is a known upstream issue.
|
||||||
|
# See: https://github.com/dlang/druntime/pull/3383
|
||||||
|
armhf|armv7|x86) LANG_D=false ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# libitm has TEXTRELs in ARM build, so disable for now
|
# libitm has TEXTRELs in ARM build, so disable for now
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
arm*) LIBITM=false ;;
|
arm*) _libitm=false ;;
|
||||||
mips*) LIBITM=false ;;
|
mips*) _libitm=false ;;
|
||||||
|
riscv64) _libitm=false ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Internal libffi fails to build on MIPS at the moment, need to
|
||||||
|
# investigate further. We disable LANG_GO on mips64 as it requires
|
||||||
|
# the internal libffi.
|
||||||
|
case "$CTARGET_ARCH" in
|
||||||
|
mips*) LANG_GO=false ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fortran uses libquadmath if toolchain has __float128
|
# Fortran uses libquadmath if toolchain has __float128
|
||||||
# currently on x86, x86_64 and ia64
|
# currently on x86, x86_64 and ia64
|
||||||
LIBQUADMATH=$LANG_FORTRAN
|
_libquadmath=$LANG_FORTRAN
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
|
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
|
||||||
*) LIBQUADMATH=false ;;
|
*) _libquadmath=false ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# libatomic is a dependency for openvswitch
|
# libatomic is a dependency for openvswitch
|
||||||
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||||
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||||
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||||
if $LIBGOMP; then
|
if $_libgomp; then
|
||||||
depends="$depends libgomp=$_gccrel"
|
depends="$depends libgomp=$_gccrel"
|
||||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$CARCH" in
|
||||||
|
riscv64)
|
||||||
|
LANG_ADA=false;;
|
||||||
|
esac
|
||||||
|
|
||||||
_languages=c
|
_languages=c
|
||||||
if $LANG_CXX; then
|
if $LANG_CXX; then
|
||||||
_languages="$_languages,c++"
|
_languages="$_languages,c++"
|
||||||
fi
|
fi
|
||||||
|
if $LANG_D; then
|
||||||
|
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
|
||||||
|
_languages="$_languages,d"
|
||||||
|
makedepends_build="$makedepends_build libucontext-dev gcc-gdc-bootstrap"
|
||||||
|
fi
|
||||||
if $LANG_OBJC; then
|
if $LANG_OBJC; then
|
||||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||||
_languages="$_languages,objc"
|
_languages="$_languages,objc"
|
||||||
|
@ -153,56 +187,83 @@ if $LANG_FORTRAN; then
|
||||||
_languages="$_languages,fortran"
|
_languages="$_languages,fortran"
|
||||||
fi
|
fi
|
||||||
if $LANG_ADA; then
|
if $LANG_ADA; then
|
||||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
subpackages="$subpackages gcc-gnat$_target:gnat"
|
||||||
_languages="$_languages,ada"
|
_languages="$_languages,ada"
|
||||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
if [ "$CBUILD" = "$CTARGET" ]; then
|
||||||
|
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
|
||||||
|
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
|
||||||
|
else
|
||||||
|
subpackages="$subpackages libgnat::$CTARGET_ARCH"
|
||||||
|
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if $LANG_JIT; then
|
||||||
|
subpackages="$subpackages libgccjit:jit libgccjit-dev:jitdev"
|
||||||
fi
|
fi
|
||||||
makedepends="$makedepends_build $makedepends_host"
|
makedepends="$makedepends_build $makedepends_host"
|
||||||
|
|
||||||
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
# when using upstream releases, use this URI template
|
||||||
002_all_default-relro.patch
|
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
||||||
003_all_default-fortify-source.patch
|
#
|
||||||
005_all_default-as-needed.patch
|
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
|
||||||
gcc-as-needed-gold.patch
|
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
|
||||||
gcc-as-needed-push-pop.patch
|
# mirrored on dev.alpinelinux.org. Please ensure that the snapshot Git commit (as stated in the
|
||||||
011_all_default-warn-format-security.patch
|
# README) matches the base commit on the version-specific branch in the Git repository below.
|
||||||
012_all_default-warn-trampolines.patch
|
#
|
||||||
013_all_default-ssp-fix.patch
|
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
|
||||||
020_all_msgfmt-libstdc++-link.patch
|
# so that they can be properly tracked and easily rebased if needed.
|
||||||
050_all_libiberty-asprintf.patch
|
source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-${_pkgbase%%.*}-${_pkgsnap}.tar.xz
|
||||||
051_all_libiberty-pic.patch
|
0001-posix_memalign.patch
|
||||||
053_all_libitm-no-fortify-source.patch
|
0002-gcc-poison-system-directories.patch
|
||||||
090_all_pr55930-dependency-tracking.patch
|
0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||||
0003-gcc-poison-system-directories.patch
|
0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||||
|
0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||||
203-libgcc_s.patch
|
0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||||
205-nopie.patch
|
0007-Enable-Wtrampolines-by-default.patch
|
||||||
0002-posix_memalign.patch
|
0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||||
0008-s390x-muslldso.patch
|
0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||||
0010-ldbl128-config.patch
|
0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||||
0012-static-pie.patch
|
0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||||
|
0012-libitm-disable-FORTIFY.patch
|
||||||
libgcc-always-build-gcceh.a.patch
|
0013-libgcc_s.patch
|
||||||
gcc-4.9-musl-fortify.patch
|
0014-nopie.patch
|
||||||
gcc-6.1-musl-libssp.patch
|
0015-dlang-use-libucontext-on-mips64.patch
|
||||||
gcc-pure64.patch
|
0016-ada-fix-shared-linking.patch
|
||||||
|
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||||
fix-cxxflags-passing.patch
|
0018-add-fortify-headers-paths.patch
|
||||||
ada-shared.patch
|
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||||
ada-musl.patch
|
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||||
libgnarl-musl.patch
|
0021-mips64-disable-multilib-support.patch
|
||||||
|
0022-aarch64-disable-multilib-support.patch
|
||||||
320-libffi-gnulinux.patch
|
0023-s390x-disable-multilib-support.patch
|
||||||
|
0024-ppc64-le-disable-multilib-support.patch
|
||||||
gcc-pure64-mips.patch
|
0025-x86_64-disable-multilib-support.patch
|
||||||
|
0026-riscv-disable-multilib-support.patch
|
||||||
|
0027-always-build-libgcc_eh.a.patch
|
||||||
|
0028-ada-libgnarl-compatibility-for-musl.patch
|
||||||
|
0029-ada-musl-support-fixes.patch
|
||||||
|
0033-gcc-go-link-to-libucontext.patch
|
||||||
|
0034-Use-generic-errstr.go-implementation-on-musl.patch
|
||||||
|
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||||
|
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||||
|
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||||
|
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||||
|
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||||
|
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
|
||||||
|
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||||
|
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||||
|
0045-druntime-link-against-libucontext-on-all-platforms.patch
|
||||||
|
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
|
||||||
|
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
|
||||||
|
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
|
||||||
|
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||||
|
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
|
||||||
"
|
"
|
||||||
|
|
||||||
# gcc-4.8-build-args.patch
|
|
||||||
|
|
||||||
# we build out-of-tree
|
# we build out-of-tree
|
||||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
|
_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-${_pkgsnap}
|
||||||
_gcclibdir=/usr/lib/gcc/${CTARGET}/$pkgver
|
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||||
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$pkgver
|
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "$_gccdir"
|
cd "$_gccdir"
|
||||||
|
@ -225,7 +286,7 @@ prepare() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ${pkgver} > gcc/BASE-VER
|
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -233,6 +294,7 @@ build() {
|
||||||
local _libc_configure=
|
local _libc_configure=
|
||||||
local _bootstrap_configure=
|
local _bootstrap_configure=
|
||||||
local _symvers=
|
local _symvers=
|
||||||
|
local _jit_configure=
|
||||||
|
|
||||||
cd "$_gccdir"
|
cd "$_gccdir"
|
||||||
|
|
||||||
|
@ -250,6 +312,7 @@ build() {
|
||||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||||
|
riscv64-*-*-*) _arch_configure="--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$CTARGET_ARCH" in
|
case "$CTARGET_ARCH" in
|
||||||
|
@ -274,10 +337,10 @@ build() {
|
||||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||||
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||||
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||||
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
|
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||||
|
|
||||||
msg "Building the following:"
|
msg "Building the following:"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -291,78 +354,112 @@ build() {
|
||||||
echo " libc_configure=$_libc_configure"
|
echo " libc_configure=$_libc_configure"
|
||||||
echo " cross_configure=$_cross_configure"
|
echo " cross_configure=$_cross_configure"
|
||||||
echo " bootstrap_configure=$_bootstrap_configure"
|
echo " bootstrap_configure=$_bootstrap_configure"
|
||||||
echo " hash_style_configure=$_hash_style_configure"
|
echo " hash_style_configure=$_hash_style_configure"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
export CFLAGS="$CFLAGS -O2"
|
||||||
|
export CXXFLAGS="$CXXFLAGS -O2"
|
||||||
|
export CPPFLAGS="$CPPFLAGS -O2"
|
||||||
|
|
||||||
|
local version="Alpine $pkgver-r$pkgrel"
|
||||||
|
local gccconfiguration="
|
||||||
|
--prefix=/usr
|
||||||
|
--mandir=/usr/share/man
|
||||||
|
--infodir=/usr/share/info
|
||||||
|
--build=${CBUILD}
|
||||||
|
--host=${CHOST}
|
||||||
|
--target=${CTARGET}
|
||||||
|
--enable-checking=release
|
||||||
|
--disable-fixed-point
|
||||||
|
--disable-libstdcxx-pch
|
||||||
|
--disable-multilib
|
||||||
|
--disable-nls
|
||||||
|
--disable-werror
|
||||||
|
$_symvers
|
||||||
|
--enable-__cxa_atexit
|
||||||
|
--enable-default-pie
|
||||||
|
--enable-default-ssp
|
||||||
|
--enable-cloog-backend
|
||||||
|
--enable-languages=$_languages
|
||||||
|
$_arch_configure
|
||||||
|
$_libc_configure
|
||||||
|
$_cross_configure
|
||||||
|
$_bootstrap_configure
|
||||||
|
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
|
||||||
|
--with-system-zlib
|
||||||
|
$_hash_style_configure
|
||||||
|
"
|
||||||
|
|
||||||
mkdir -p "$_builddir"
|
mkdir -p "$_builddir"
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
"$_gccdir"/configure --prefix=/usr \
|
"$_gccdir"/configure $gccconfiguration \
|
||||||
--mandir=/usr/share/man \
|
--with-pkgversion="$version"
|
||||||
--infodir=/usr/share/info \
|
|
||||||
--build=${CBUILD} \
|
msg "building gcc"
|
||||||
--host=${CHOST} \
|
|
||||||
--target=${CTARGET} \
|
|
||||||
--with-pkgversion="Alpine ${pkgver}" \
|
|
||||||
--enable-checking=release \
|
|
||||||
--disable-fixed-point \
|
|
||||||
--disable-libstdcxx-pch \
|
|
||||||
--disable-multilib \
|
|
||||||
--disable-nls \
|
|
||||||
--disable-werror \
|
|
||||||
$_symvers \
|
|
||||||
--enable-__cxa_atexit \
|
|
||||||
--enable-default-pie \
|
|
||||||
--enable-default-ssp \
|
|
||||||
--enable-cloog-backend \
|
|
||||||
--enable-languages=$_languages \
|
|
||||||
$_arch_configure \
|
|
||||||
$_libc_configure \
|
|
||||||
$_cross_configure \
|
|
||||||
$_bootstrap_configure \
|
|
||||||
--with-system-zlib \
|
|
||||||
$_hash_style_configure
|
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# we build gccjit separate to not build all of gcc with --enable-host-shared
|
||||||
|
# as doing so slows it down a few %, so for some quick if's here we gain
|
||||||
|
# free performance
|
||||||
|
if $LANG_JIT; then
|
||||||
|
mkdir -p "$_builddir"/libgccjit-build
|
||||||
|
cd "$_builddir"/libgccjit-build
|
||||||
|
"$_gccdir"/configure $gccconfiguration \
|
||||||
|
--disable-bootstrap \
|
||||||
|
--enable-host-shared \
|
||||||
|
--enable-languages=jit \
|
||||||
|
--with-pkgversion="$version"
|
||||||
|
|
||||||
|
msg "building libgccjit"
|
||||||
|
make all-gcc
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$_builddir"
|
cd "$_builddir"
|
||||||
make -j1 DESTDIR="${pkgdir}" install
|
make DESTDIR="$pkgdir" install
|
||||||
|
|
||||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||||
|
|
||||||
# we don't support gcj -static
|
if $LANG_JIT; then
|
||||||
|
make -C "$_builddir"/libgccjit-build/gcc DESTDIR="$pkgdir" jit.install-common
|
||||||
|
fi
|
||||||
|
|
||||||
|
# we dont support gcj -static
|
||||||
# and saving 35MB is not bad.
|
# and saving 35MB is not bad.
|
||||||
find "$pkgdir" -name libgtkpeer.a \
|
find "$pkgdir" \( -name libgtkpeer.a \
|
||||||
-o -name libgjsmalsa.a -o \
|
-o -name libgjsmalsa.a \
|
||||||
-o -name libgij.a -o \
|
-o -name libgij.a \) \
|
||||||
| xargs rm -f
|
-delete
|
||||||
|
|
||||||
# strip debug info from some static libs
|
# strip debug info from some static libs
|
||||||
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||||
|
-o -name libgphobos.a -o -name libgdruntime.a \
|
||||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||||
-a -type f`
|
-a -type f \
|
||||||
|
-exec ${STRIP_FOR_TARGET} -g {} +
|
||||||
|
|
||||||
if $LIBGOMP; then
|
if $_libgomp; then
|
||||||
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
||||||
fi
|
fi
|
||||||
if $LIBITM; then
|
if $_libitm; then
|
||||||
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove ffi
|
# remove ffi
|
||||||
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
||||||
find "$pkgdir" -name 'ffi*.h' | xargs rm -f
|
find "$pkgdir" -name 'ffi*.h' -delete
|
||||||
|
|
||||||
local gdblib=${_target:+$CTARGET/}lib
|
local gdblib=${_target:+$CTARGET/}lib
|
||||||
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py" ); do
|
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
|
||||||
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
|
||||||
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
||||||
done
|
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
||||||
|
done
|
||||||
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
|
fi
|
||||||
|
|
||||||
# move ada runtime libs
|
# move ada runtime libs
|
||||||
if $LANG_ADA; then
|
if $LANG_ADA; then
|
||||||
|
@ -370,20 +467,26 @@ package() {
|
||||||
mv "$i" "$pkgdir"/usr/lib/
|
mv "$i" "$pkgdir"/usr/lib/
|
||||||
ln -s ../../../../${i##*/} $i
|
ln -s ../../../../${i##*/} $i
|
||||||
done
|
done
|
||||||
|
if [ "$CHOST" = "$CTARGET" ]; then
|
||||||
|
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
|
||||||
|
mv "$i" "$pkgdir"/usr/lib/
|
||||||
|
ln -s ../../../../${i##*/} $i
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
# cross-gcc: remove any files that would conflict with the
|
# cross-gcc: remove any files that would conflict with the
|
||||||
# native gcc package
|
# native gcc package
|
||||||
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "$pkgdir"/usr/share
|
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
|
||||||
# libcc1 does not depend on target, don't ship it
|
# libcc1 does not depend on target, don't ship it
|
||||||
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
||||||
|
|
||||||
# fixup gcc library symlinks to be linker scripts so
|
# fixup gcc library symlinks to be linker scripts so
|
||||||
# linker finds the libs from relocated sysroot
|
# linker finds the libs from relocated sysroot
|
||||||
for so in "$pkgdir"/usr/$CTARGET/lib/*.so; do
|
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
|
||||||
if [ -h "$so" ]; then
|
if [ -h "$so" ]; then
|
||||||
local _real=$(basename $(readlink "$so"))
|
local _real=$(basename "$(readlink "$so")")
|
||||||
rm -f "$so"
|
rm -f "$so"
|
||||||
echo "GROUP ($_real)" > "$so"
|
echo "GROUP ($_real)" > "$so"
|
||||||
fi
|
fi
|
||||||
|
@ -392,29 +495,33 @@ package() {
|
||||||
# add c89/c99 wrapper scripts
|
# add c89/c99 wrapper scripts
|
||||||
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
fl="-std=c89"
|
_flavor="-std=c89"
|
||||||
for opt; do
|
for opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
-ansi|-std=c89|-std=iso9899:1990) fl="";;
|
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
|
||||||
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
exec gcc $fl ${1+"$@"}
|
exec gcc $_flavor ${1+"$@"}
|
||||||
EOF
|
EOF
|
||||||
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
fl="-std=c99"
|
_flavor="-std=c99"
|
||||||
for opt; do
|
for opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
-std=c99|-std=iso9899:1999) fl="";;
|
-std=c99|-std=iso9899:1999) _flavor="";;
|
||||||
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
exec gcc $fl ${1+"$@"}
|
exec gcc $_flavor ${1+"$@"}
|
||||||
EOF
|
EOF
|
||||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||||
|
|
||||||
|
# install lto plugin so regular binutils may use it
|
||||||
|
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
|
||||||
|
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,26 +538,53 @@ libcxx() {
|
||||||
pkgdesc="GNU C++ standard runtime library"
|
pkgdesc="GNU C++ standard runtime library"
|
||||||
depends=
|
depends=
|
||||||
|
|
||||||
|
if [ "$CHOST" = "$CTARGET" ]; then
|
||||||
|
# verify that we are using clock_gettime rather than doing direct syscalls
|
||||||
|
# so we dont break 32 bit arches due to time64.
|
||||||
|
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/usr/lib
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libcxx_dev() {
|
||||||
|
pkgdesc="GNU C++ standard runtime library (development files)"
|
||||||
|
depends=
|
||||||
|
replaces="g++"
|
||||||
|
|
||||||
|
amove usr/${_target:+$CTARGET/}lib/libstdc++.a \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libstdc++.so \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libstdc++fs.a \
|
||||||
|
usr/${_target:+$CTARGET/}lib/libsupc++.a \
|
||||||
|
usr/${_target:+$CTARGET/}include/c++
|
||||||
|
}
|
||||||
|
|
||||||
gpp() {
|
gpp() {
|
||||||
pkgdesc="GNU C++ standard library and compiler"
|
pkgdesc="GNU C++ standard library and compiler"
|
||||||
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
|
||||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
"$subpkgdir"/usr/bin \
|
"$subpkgdir"/usr/bin \
|
||||||
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
||||||
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
||||||
|
|
||||||
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
||||||
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
|
|
||||||
|
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
|
||||||
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jit() {
|
||||||
|
pkgdesc="GCC JIT Library"
|
||||||
|
depends=
|
||||||
|
amove usr/lib/libgccjit.so*
|
||||||
|
}
|
||||||
|
|
||||||
|
jitdev() {
|
||||||
|
pkgdesc="GCC JIT Library (development files)"
|
||||||
|
depends="libgccjit"
|
||||||
|
amove usr/include/libgccjit*.h
|
||||||
|
}
|
||||||
|
|
||||||
libobjc() {
|
libobjc() {
|
||||||
pkgdesc="GNU Objective-C runtime"
|
pkgdesc="GNU Objective-C runtime"
|
||||||
replaces="objc"
|
replaces="objc"
|
||||||
|
@ -464,8 +598,10 @@ objc() {
|
||||||
replaces="gcc"
|
replaces="gcc"
|
||||||
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibdir/include \
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
|
"$subpkgdir"/$_gcclibdir/include \
|
||||||
"$subpkgdir"/usr/lib
|
"$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
|
||||||
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
||||||
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
|
@ -488,6 +624,40 @@ libgomp() {
|
||||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libgphobos() {
|
||||||
|
pkgdesc="D programming language standard library for GCC"
|
||||||
|
depends=
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
|
||||||
|
}
|
||||||
|
|
||||||
|
gdc() {
|
||||||
|
pkgdesc="GCC-based D language compiler"
|
||||||
|
depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev"
|
||||||
|
depends="$depends libucontext-dev"
|
||||||
|
provides="gcc-gdc-bootstrap=$_gccrel"
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||||
|
"$subpkgdir"/$_gcclibdir/include/d/ \
|
||||||
|
"$subpkgdir"/usr/lib \
|
||||||
|
"$subpkgdir"/usr/bin
|
||||||
|
# Copy: The installed '.d' files, the static lib, the binary itself
|
||||||
|
# The shared libs are part of 'libgphobos' so one can run program
|
||||||
|
# without installing the compiler
|
||||||
|
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
|
||||||
|
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
|
||||||
|
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
|
||||||
|
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
libgo() {
|
libgo() {
|
||||||
pkgdesc="Go runtime library for GCC"
|
pkgdesc="Go runtime library for GCC"
|
||||||
depends=
|
depends=
|
||||||
|
@ -498,17 +668,24 @@ libgo() {
|
||||||
|
|
||||||
go() {
|
go() {
|
||||||
pkgdesc="Go support for GCC"
|
pkgdesc="Go support for GCC"
|
||||||
depends="gcc=$_gccrel libgo=$_gccrel"
|
depends="gcc=$_gccrel libgo=$_gccrel !go"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
"$subpkgdir"/usr/lib \
|
"$subpkgdir"/usr/lib \
|
||||||
"$subpkgdir"/usr/bin
|
"$subpkgdir"/usr/bin
|
||||||
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
||||||
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
||||||
|
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
|
||||||
|
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
|
||||||
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
|
||||||
|
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
|
||||||
mv "$pkgdir"/usr/lib/libgo.a \
|
mv "$pkgdir"/usr/lib/libgo.a \
|
||||||
"$pkgdir"/usr/lib/libgo.so \
|
"$pkgdir"/usr/lib/libgo.so \
|
||||||
"$pkgdir"/usr/lib/libgobegin.a \
|
"$pkgdir"/usr/lib/libgobegin.a \
|
||||||
|
"$pkgdir"/usr/lib/libgolibbegin.a \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +709,7 @@ libquadmath() {
|
||||||
gfortran() {
|
gfortran() {
|
||||||
pkgdesc="GNU Fortran Compiler"
|
pkgdesc="GNU Fortran Compiler"
|
||||||
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
||||||
$LIBQUADMATH && depends="$depends libquadmath=$_gccrel"
|
$_libquadmath && depends="$depends libquadmath=$_gccrel"
|
||||||
replaces="gcc"
|
replaces="gcc"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
|
@ -543,11 +720,12 @@ gfortran() {
|
||||||
mv "$pkgdir"/usr/lib/libgfortran.a \
|
mv "$pkgdir"/usr/lib/libgfortran.a \
|
||||||
"$pkgdir"/usr/lib/libgfortran.so \
|
"$pkgdir"/usr/lib/libgfortran.so \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
if $LIBQUADMATH; then
|
if $_libquadmath; then
|
||||||
mv "$pkgdir"/usr/lib/libquadmath.a \
|
mv "$pkgdir"/usr/lib/libquadmath.a \
|
||||||
"$pkgdir"/usr/lib/libquadmath.so \
|
"$pkgdir"/usr/lib/libquadmath.so \
|
||||||
"$subpkgdir"/usr/lib/
|
"$subpkgdir"/usr/lib/
|
||||||
fi
|
fi
|
||||||
|
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
|
||||||
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
||||||
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
||||||
}
|
}
|
||||||
|
@ -560,9 +738,18 @@ libgnat() {
|
||||||
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libgnatstatic() {
|
||||||
|
pkgdesc="GNU Ada static libraries"
|
||||||
|
depends=
|
||||||
|
|
||||||
|
mkdir -p "$subpkgdir"/usr/lib
|
||||||
|
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
|
||||||
|
}
|
||||||
|
|
||||||
gnat() {
|
gnat() {
|
||||||
pkgdesc="Ada support for GCC"
|
pkgdesc="Ada support for GCC"
|
||||||
depends="gcc=$_gccrel"
|
depends="gcc=$_gccrel"
|
||||||
|
provides="$pkgname-gnat-bootstrap=$_gccrel"
|
||||||
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
||||||
|
|
||||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||||
|
@ -573,34 +760,51 @@ gnat() {
|
||||||
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="64898a165f67e136d802a92e7633bf1b06c85266027e52127ea025bf5fc2291b5e858288aac0bdba246e6cdf7c6ec88bc8e0e7f3f6f1985f4297710cafde56ed gcc-8.2.0.tar.xz
|
sha512sums="
|
||||||
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
|
ba4d9e73d108088da26fbefe18d9b245b76771ffe752c2b4b31bdf38a2d0b638fbc115c377526c27311d4d7ffd4e0d236a5af5016bd364ccaa11a4989d1401e8 gcc-12-20220924.tar.xz
|
||||||
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
|
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
|
||||||
02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch
|
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
|
||||||
6c9a5068f6eea8a85d297a3555b1d2333ffd4b9ddbfb7560a3e643f8577603871ca123373ef7f96e894225291d88f7bf575c7f8386bcfdd1dabcd7ba12598b65 gcc-as-needed-gold.patch
|
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
|
||||||
ab0df1862f1b645634e79b8101326ce53215eba39861a455cd145b81b5267a6a61bc6e76b32d53887a0a48873f7efc23e2c52cc04400c6afd89822f245cdbc77 gcc-as-needed-push-pop.patch
|
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
||||||
e026bf9f73ee254528423c6cabdfd7794960c567161581b7d4b7c61c45027e12a6efef79662d4288b9cbaecb4798f01af6a5b4a13b766c2d501444ac1846fd43 011_all_default-warn-format-security.patch
|
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
||||||
37de4cc9061bfe1963e6e6570e1a6bbfd58204bf90e0eef819882599a9a80ea28f3eb815c20c1f173dc25d4bd9971b7c7f7f9512d6f8f91f04de1e1175114d4d 012_all_default-warn-trampolines.patch
|
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
||||||
38a0fedeac3eebe4a6a957792ba520225cf42663c96a171cd168fdb6c91ffa9a56b80351f8238c5d03b78d3ae2a6539a54481fe4848b4a395e2c87f2ff7adc08 013_all_default-ssp-fix.patch
|
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
|
||||||
d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
|
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
||||||
840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
|
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
||||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
|
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
||||||
e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
|
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
||||||
4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
|
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
|
||||||
3842bd2be3e53db34e59bfb2bd438b244fc3712055058b9e232e33345f0fab216256b79e364fbac335972dc599a1d74393704f0cd595f3f076dcc10883c85b28 0003-gcc-poison-system-directories.patch
|
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
|
||||||
d1c2d7ff7f673375dc7cd84ae9d8515853b5af6390c70bb763412c012101344e4ee1ce155151ce3fb6ba2b80af7ed42d697dbe1bf6fd6e7b2b9087a378c47c37 203-libgcc_s.patch
|
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
|
||||||
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
|
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
|
||||||
6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch
|
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
|
||||||
7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch
|
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
||||||
66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
|
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
|
||||||
45d5bc11a89e5af77503ca06eec52d6d84e6fea0be021aaee1bcc39f8dd3c7b4baa4200cfa2b0688faa0f207d005db89c029eff32f362207aa3d2365b2f2363e 0012-static-pie.patch
|
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
||||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
||||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
|
||||||
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
|
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
|
||||||
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
|
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
|
||||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
|
||||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
|
||||||
50537add461714f44dc6a778e0c6d0e15d6a782591c8aff38d1fb559191ddac2b5ee14a43a3005b389fdf98d2e7468ff4e64c88ba024cf94f9fe0d9854b9e9c8 ada-musl.patch
|
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
|
||||||
a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a15074b4cb58edd5d7e2868607c902dd003e8c464d5066fd4a575 libgnarl-musl.patch
|
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
|
||||||
f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
|
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
|
||||||
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch"
|
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
|
||||||
|
3c04b26554a78096296ca9542c77a91219bd26044dd2cb2006db4c1944889a97c215900b3828ba7e8c675162406db543605a815bdfbd915bf810663b1b253bdd 0033-gcc-go-link-to-libucontext.patch
|
||||||
|
699dc3641099da6136dd3689f06c6553c03b3a85acf83a3fce1beb5425065b3e378535ca9e9100a120fdbafc34871d61c063fd5328a49cd87a15a989ed51706d 0034-Use-generic-errstr.go-implementation-on-musl.patch
|
||||||
|
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
||||||
|
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
||||||
|
8bc6823f0b3c66f7b73d7ddb64ffa6930463285c2e9a14a2bc1882bcc4271144eaa1107d713294699caf9481648163cbf43921a2b8e4ac0d55c78a804bae8a3d 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
||||||
|
e9699f4721778869eb3a8fef2c679208ef5b98584892f30b0e1cb5dc1669f8158198d7792659b1b56c381baf62247d21990dcced9178547affd5d6bfb2d12548 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
||||||
|
d6dc1bfb881a313d167aaa5658790b0f55eea4336c408cfc6613dd5783440dafd0d37c43031a5f3e69be40f632e38371cd4fb6e5f0494ac4ea4d7d5025d2ae02 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
|
||||||
|
684c6a6d52512b973429b6e709966439ac1e174f9e79a33d4a638b452245b457b34752b4b4034ba983f6a712f86522e7adf715bab00a6603f64a12139c5b1e39 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
|
||||||
|
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
|
||||||
|
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
|
||||||
|
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
|
||||||
|
c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2101dfd4eea2a6d48bf4fae899a0ddb811c81abd7be35c122 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
|
||||||
|
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
|
||||||
|
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
|
||||||
|
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
|
||||||
|
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
|
||||||
|
"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Forked from Alpine INSERT-REASON-HERE (CHANGEME!)
|
# Forked from Alpine INSERT-REASON-HERE (CHANGEME!)
|
||||||
|
|
||||||
pkgname=binutils
|
pkgname=binutils
|
||||||
pkgver=2.35.2
|
pkgver=2.39
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Tools necessary to build programs"
|
pkgdesc="Tools necessary to build programs"
|
||||||
url="https://www.gnu.org/software/binutils/"
|
url="https://www.gnu.org/software/binutils/"
|
||||||
|
@ -16,7 +16,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
|
||||||
gold-mips.patch
|
gold-mips.patch
|
||||||
ld-bfd-mips.patch
|
ld-bfd-mips.patch
|
||||||
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
CVE-2021-3487.patch
|
binutils-mips-disable-assert.patch
|
||||||
"
|
"
|
||||||
builddir="$srcdir/$pkgname-$pkgver"
|
builddir="$srcdir/$pkgname-$pkgver"
|
||||||
|
|
||||||
|
@ -46,10 +46,12 @@ build() {
|
||||||
local _cross_configure="--enable-install-libiberty --enable-shared"
|
local _cross_configure="--enable-install-libiberty --enable-shared"
|
||||||
local _arch_configure=""
|
local _arch_configure=""
|
||||||
local _gold_configure="--disable-gold"
|
local _gold_configure="--disable-gold"
|
||||||
|
local _plugin_configure="--enable-plugins"
|
||||||
|
|
||||||
if [ "$CHOST" != "$CTARGET" ]; then
|
if [ "$CHOST" != "$CTARGET" ]; then
|
||||||
_sysroot="$CBUILDROOT"
|
_sysroot="$CBUILDROOT"
|
||||||
_cross_configure="--disable-install-libiberty"
|
_cross_configure="--disable-install-libiberty"
|
||||||
|
_plugin_configure="--disable-plugins"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
|
||||||
|
@ -79,12 +81,14 @@ build() {
|
||||||
--mandir=/usr/share/man \
|
--mandir=/usr/share/man \
|
||||||
--infodir=/usr/share/info \
|
--infodir=/usr/share/info \
|
||||||
--disable-multilib \
|
--disable-multilib \
|
||||||
|
--disable-gprofng \
|
||||||
--enable-ld=default \
|
--enable-ld=default \
|
||||||
$_gold_configure \
|
$_gold_configure \
|
||||||
--enable-64-bit-bfd \
|
--enable-64-bit-bfd \
|
||||||
--enable-plugins \
|
$_plugin_configure \
|
||||||
--enable-relro \
|
--enable-relro \
|
||||||
--enable-deterministic-archives \
|
--enable-deterministic-archives \
|
||||||
|
--enable-default-execstack=no \
|
||||||
$_cross_configure \
|
$_cross_configure \
|
||||||
$_arch_configure \
|
$_arch_configure \
|
||||||
$_hash_style_configure \
|
$_hash_style_configure \
|
||||||
|
@ -107,6 +111,7 @@ package() {
|
||||||
# with the native tools, or other cross tools
|
# with the native tools, or other cross tools
|
||||||
rm -r "${pkgdir:?}"/usr/share
|
rm -r "${pkgdir:?}"/usr/share
|
||||||
rm -f "$pkgdir"/usr/lib/libiberty.a
|
rm -f "$pkgdir"/usr/lib/libiberty.a
|
||||||
|
rm -r "${pkgdir:?}"/usr/lib/bfd-plugins
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,9 +133,11 @@ gold() {
|
||||||
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348 binutils-2.35.2.tar.xz
|
sha512sums="
|
||||||
|
68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3 binutils-2.39.tar.xz
|
||||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
|
||||||
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
|
||||||
642c617db6c6e491f78f053d60f3aa369bad7bf8c1bc7ce267de6cf8fddf6c0d4cf63ce8c8f6e2f225dedbce7cb930d8e87e168fd8f72ca0837c77266ee2b5f8 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
|
||||||
b08384ed124a74ad3a424db370c107230f09a54378502ca4385deb738f7cf799857f2af0db52709c7eeab8fa6c0a3d972f891396cce1e2834a21f67682fc4355 CVE-2021-3487.patch"
|
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
|
||||||
|
"
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue