~postmarketos/pmbootstrap-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH pmbootstrap] aportgen: build gcc-x86_64 etc. pkgs for aarch64

Details
Message ID
<20231126104823.3723-1-ollieparanoid@postmarketos.org>
DKIM signature
missing
Download raw message
Patch: +16 -5
Instead of building cross packages for the native architecture, add a
new get_cross_packages_arches() function that returns the desired
architectures no matter what the current native architecture is.

So gcc-x86_64 will always have arch="aarch64", and gcc-aarch64 will
always have arch="x86_64".

We can tweak the function in the future if e.g. it becomes viable to
cross compile from riscv64. Or even better, remove this and the cross
compile packages upstreamed into alpine (see pmb#551).
---
 pmb/aportgen/__init__.py       | 12 ++++++++++++
 pmb/aportgen/busybox_static.py |  2 +-
 pmb/aportgen/gcc.py            |  5 ++---
 pmb/aportgen/musl.py           |  2 +-
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/pmb/aportgen/__init__.py b/pmb/aportgen/__init__.py
index 6473f916..1071173a 100644
--- a/pmb/aportgen/__init__.py
+++ b/pmb/aportgen/__init__.py
@@ -13,6 +13,18 @@ import pmb.config
import pmb.helpers.cli


def get_cross_package_arches(pkgname):
    """
    Get the arches for which we want to build cross packages.
    :param pkgname: package name, e.g. "gcc-aarch64", "gcc-x86_64"
    :returns: string of architecture(s) (space separated)
    """
    if pkgname.endswith("-x86_64"):
        return "aarch64"
    else:
        return "x86_64"


def properties(pkgname):
    """
    Get the `pmb.config.aportgen` properties for the aport generator, based on
diff --git a/pmb/aportgen/busybox_static.py b/pmb/aportgen/busybox_static.py
index f7cf6aac..e8278b85 100644
--- a/pmb/aportgen/busybox_static.py
+++ b/pmb/aportgen/busybox_static.py
@@ -47,7 +47,7 @@ def generate(args, pkgname):

            url="http://busybox.net"
            license="GPL2"
            arch="{pmb.config.arch_native}"
            arch="{pmb.aportgen.get_cross_package_arches(pkgname)}"
            options="!check !strip"
            pkgdesc="Statically linked Busybox for $_arch"
            _target="$(arch_to_hostspec $_arch)"
diff --git a/pmb/aportgen/gcc.py b/pmb/aportgen/gcc.py
index c341aa86..c1422f91 100644
--- a/pmb/aportgen/gcc.py
+++ b/pmb/aportgen/gcc.py
@@ -23,12 +23,11 @@ def generate(args, pkgname):
                         " gcc6.")
    pmb.helpers.run.user(args, ["cp", "-r", upstream, f"{args.work}/aportgen"])

    # Rewrite APKBUILD (only building for native covers most use cases and
    # saves a lot of build time, can be changed on demand)
    # Rewrite APKBUILD
    fields = {
        "pkgname": pkgname,
        "pkgdesc": f"Stage2 cross-compiler for {arch}",
        "arch": pmb.config.arch_native,
        "arch": pmb.aportgen.get_cross_package_arches(pkgname),
        "depends": f"binutils-{arch} mpc1",
        "makedepends_build": "gcc g++ bison flex texinfo gawk zip"
                             " gmp-dev mpfr-dev mpc1-dev zlib-dev",
diff --git a/pmb/aportgen/musl.py b/pmb/aportgen/musl.py
index 0a459e4a..8a8e2fc8 100644
--- a/pmb/aportgen/musl.py
+++ b/pmb/aportgen/musl.py
@@ -42,7 +42,7 @@ def generate(args, pkgname):
            pkgname={pkgname}
            pkgver={pkgver}
            pkgrel={pkgrel}
            arch="{pmb.config.arch_native}"
            arch="{pmb.aportgen.get_cross_package_arches(pkgname)}"
            subpackages="musl-dev-{arch}:package_dev"

            _arch="{arch}"
-- 
2.43.0

[pmbootstrap/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CX8OYMEHPX3U.2KD055S92RBLW@cirno2>
In-Reply-To
<20231126104823.3723-1-ollieparanoid@postmarketos.org> (view parent)
DKIM signature
missing
Download raw message
pmbootstrap/patches/.build.yml: SUCCESS in 14m5s

[aportgen: build gcc-x86_64 etc. pkgs for aarch64][0] from [Oliver Smith][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/47024
[1]: ollieparanoid@postmarketos.org

✓ #1101207 SUCCESS pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/1101207
Reply to thread Export thread (mbox)