diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-23 02:41:35 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-24 11:22:25 +0900 |
| commit | f6eaf76ec9d342ee1cef1590623dec390318801f (patch) | |
| tree | 8695e393d1ca795f6fc574a8de8d7a6794a789ba /internal/rosa/rosa.go | |
| parent | 5c127a70350c19c99bca388c94a4518d885c3ac3 (diff) | |
internal/rosa: patch library paths
This removes the need for reference LDFLAGS in the standard toolchain.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 795394c2..06f73c67 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -65,10 +65,9 @@ const ( EnvTriplet = "ROSA_TRIPLE" ) -// ldflags returns LDFLAGS corresponding to triplet. -func ldflags(static bool) string { - s := "LDFLAGS=" + - "-fuse-ld=lld " + +// earlyLDFLAGS returns LDFLAGS corresponding to triplet. +func earlyLDFLAGS(static bool) string { + s := "-fuse-ld=lld " + "-L/system/lib -Wl,-rpath=/system/lib " + "-L/system/lib/" + triplet() + " " + "-Wl,-rpath=/system/lib/" + triplet() + " " + @@ -76,7 +75,7 @@ func ldflags(static bool) string { "-unwindlib=libunwind " + "-Wl,--as-needed" if !static { - s += " -Wl,--dynamic-linker=/system/lib/ld-musl-x86_64.so.1" + s += " -Wl,--dynamic-linker=/system/bin/linker" } return s } @@ -199,7 +198,7 @@ ln -vs ../usr/bin /work/bin env = fixupEnviron(env, []string{ EnvTriplet + "=" + triplet(), lcMessages, - ldflags(true), + "LDFLAGS=" + earlyLDFLAGS(true), }, "/system/bin", "/usr/bin", "/usr/lib/llvm/21/bin", @@ -220,8 +219,6 @@ ln -vs ../usr/bin /work/bin EnvTriplet + "=" + triplet(), lcMessages, - ldflags(false), - "AR=ar", "RANLIB=ranlib", "LIBCC=/system/lib/clang/21/lib/" + triplet() + |
