1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00
pmbootstrap/pmb/build
Oliver Smith 06bd8d98a1
cross-native2: set CGO_CFLAGS, CGO_LDFLAGS (MR 2565)
Cross compiling go programs with cross-native2 fails for armv7, riscv64
and armhf unless we use CGO_ENABLED=1 in the APKBUILD (see related
aports issue).

Add --sysroot to CGO_CFLAGS, so cgo can find the includes and doesn't
fail with:

  go build -buildmode=pie -modcacherw -trimpath -buildvcs=false -ldflags "-s -w -X main.Version=2.6.1" -o mkinitfs ./cmd/mkinitfs
  # runtime/cgo
  _cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory

Add it to LDFLAGS too for linking against libraries from the sysroot.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15809
Related: https://stackoverflow.com/a/38835938
2025-03-09 15:27:27 +01:00
..
__init__.py pmb: Use explicit re-exports (MR 2545) 2025-02-23 11:40:44 +01:00
_package.py pmb.build: install checkdepends when building (MR 2563) 2025-03-06 14:15:23 -08:00
autodetect.py build: add pmb:cross-native2 (MR 2474) 2025-02-27 01:29:35 +01:00
backend.py cross-native2: set CGO_CFLAGS, CGO_LDFLAGS (MR 2565) 2025-03-09 15:27:27 +01:00
checksum.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
envkernel.py build: add pmb:cross-native2 (MR 2474) 2025-02-27 01:29:35 +01:00
init.py pmb: Add lots of type hints (MR 2464) 2024-10-30 12:39:45 +01:00
kconfig.py pmb: Remove unnecessary pass statements (MR 2537) 2025-02-02 22:48:50 +01:00
newapkbuild.py pmb: Use unpacking operator to concatenate collections (MR 2525) 2025-01-15 22:35:02 +01:00
other.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00