me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Resolve compiler search subdirectories inside the target SDK

diviocity committed 5 days ago · 94fcb93f51d34f0033fd29e443e142b2e978a90e View patch
Unverified signature 2 files changed +26 -8
BOOTSTRAP.md +2 -0

@@ -103,6 +103,8 @@ OpenSSH 9.9p2-1 passed its AArch64 recipe checks in QEMU user mode with six pack

103103

104104On AArch64, readline's configure script repurposes `CROSS_COMPILE` as a C preprocessor flag. The configure wrapper now fixes the compiler names before that script runs. With the same signed musl and ncurses SDK, configure changed from a lookup for `-DCROSS_COMPILINGgcc` to a successful AArch64 compiler and configuration check. See `arm/abi16/readline-configure-01`, receipt SHA-256 `60d817d3cd361d8a07bf186e3a8378787e05664207fef02a00ed25cfbfc1ce7f`.

105105

106+Readline 8.2.13-1 built and passed its history and ELF checks on AArch64. The compiler wrapper also rebases absolute include and library subdirectories into the signed SDK, including the `/usr/include/ncursesw` path emitted by pinentry. Pinentry 1.3.1-1 built its terminal and curses programs, ran the target version check, and passed the ELF page audit. See `arm/abi16/readline-package-01` and `arm/abi16/pinentry-headers-01`, receipt SHA-256 `705341ec3a85b2779cd6ebd551bed3c06672ee86674b4d50fec6ab149453c2bc` and `096d60a52b5b89d22eab0945aa6de8922e4ffc115aaa51a878ae335799ab31d4`.

107+

106108An eight-package x86_64 guest tested the BusyBox wget applet and its separately packaged TLS helper. It rejected an unknown certificate, retrieved the expected bytes after installing the local CA, and rejected the same certificate for a different hostname. The guest fixture is `tests/userland/wget.sh`. The worker keeps the install, audit and serial hashes in `foundation/wget-guest-x86_64-01/receipts.sha256`, SHA-256 `5872d1467ee2594b9305bed5fa1ceb084c8c3fde4ebccb0539db25d02b3849f9`.

107109

108110For package roots too large for a test initramfs, use `python3 tests/disk-root.py "$arch" "$root" "$fixture" "$iso" "$boot" "$output"` on the worker. The root must supply BusyBox init, and the fixture prints `VPAC FIXTURE GUEST PASS` after its checks. The helper creates a fresh ext2 image file from a private copy and runs QEMU in snapshot mode. The x86_64 release kernel read the matching disk identity and relocated all 109 dynamic executable paths from a 106-package root with 512 MiB of guest RAM. The test retains its ext2 and serial hashes under `foundation/disk-exec-x86-02/test`, receipt SHA-256 `6f600855744d04fa71d916f545e746ed36ba2686a56937c2b4c3cb02e3ec6a58`.

tools/vinix-cc.v +24 -8

@@ -5,21 +5,37 @@ module main

55import os

66

77// Libtool can add -L/usr/lib while it relinks libraries under DESTDIR. GCC's

8-// --sysroot does not rebase an ordinary -L argument. Keep these explicit

9-// system directories inside the SDK, including their two-argument spellings.

8+// --sysroot does not rebase ordinary -L or -I arguments. Keep explicit

9+// system directories and their descendants inside the SDK.

10+fn target_search_path(root string, flag string, path string) string {

11+ if flag == '-L' && (path == '/usr/lib' || path.starts_with('/usr/lib/') || path == '/lib'

12+ || path.starts_with('/lib/')) {

13+ return root + path

14+ }

15+ if flag in ['-I', '-isystem'] && (path == '/usr/include' || path.starts_with('/usr/include/')) {

16+ return root + path

17+ }

18+ return path

19+}

20+

1021fn target_search_args(root string, input []string) []string {

1122 mut args := []string{cap: input.len}

1223 mut previous := ''

1324 for arg in input {

14- if (previous == '-L' && arg in ['/usr/lib', '/lib'])

15- || (previous in ['-I', '-isystem'] && arg == '/usr/include') {

16- args << root + arg

17- } else if arg in ['-L/usr/lib', '-L/lib', '-I/usr/include'] {

18- args << arg[..2] + root + arg[2..]

25+ if previous != '' {

26+ args << target_search_path(root, previous, arg)

27+ previous = ''

28+ continue

29+ }

30+ if arg in ['-L', '-I', '-isystem'] {

31+ previous = arg

32+ }

33+ flag := arg.all_before('/')

34+ if flag in ['-L', '-I', '-isystem'] && arg.len > flag.len {

35+ args << flag + target_search_path(root, flag, arg[flag.len..])

1936 } else {

2037 args << arg

2138 }

22- previous = arg

2339 }

2440 return args

2541}