me

/

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

Resolve indirect shared library dependencies inside the target SDK

diviocity committed 5 days ago · 6a834d9c90c2ee0ec0a63fb3f5a9c0845323c456 View patch
Unverified signature 1 files changed +8 -5
tools/vinix-cc.v +8 -5

@@ -44,11 +44,14 @@ fn main() {

4444 }

4545 mut args := ['--sysroot=${root}', '-specs=${specs}']

4646 args << target_search_args(root, os.args[1..])

47- // The released AArch64 kernel maps 16 KiB pages. Some cross GCC

48- // distributions select a 4 KiB linker maximum even with a musl sysroot.

49- if os.is_file(os.join_path(root, 'lib/ld-musl-aarch64.so.1'))

50- && !os.args[1..].any(it in ['-c', '-E', '-S', '-M', '-MM', '-fsyntax-only', '-r']) {

51- args << '-Wl,-z,max-page-size=16384'

47+ if !os.args[1..].any(it in ['-c', '-E', '-S', '-M', '-MM', '-fsyntax-only', '-r']) {

48+ // The build machine's linker also needs to find DT_NEEDED libraries

49+ // named by input shared objects. Keep this path out of the target ELF.

50+ args << ['-Xlinker', '-rpath-link', '-Xlinker', '${root}/usr/lib:${root}/lib']

51+ // The released AArch64 kernel maps 16 KiB pages.

52+ if os.is_file(os.join_path(root, 'lib/ld-musl-aarch64.so.1')) {

53+ args << '-Wl,-z,max-page-size=16384'

54+ }

5255 }

5356 os.execvp(compiler, args) or {

5457 eprintln('${driver}: ${compiler}: ${err}')