refactor(internal/build):remove rpath change

This commit is contained in:
luoliwoshang
2025-06-26 13:55:58 +08:00
parent f0728c4fe0
commit e60c3bd943
3 changed files with 3 additions and 41 deletions

View File

@@ -25,7 +25,7 @@ func cacheDir() string {
return filepath.Join(env.LLGoCacheDir(), "crosscompile")
}
func Use(goos, goarch string, wasiThreads, changeRpath bool) (export Export, err error) {
func Use(goos, goarch string, wasiThreads bool) (export Export, err error) {
targetTriple := llvm.GetTargetTriple(goos, goarch)
if runtime.GOOS == goos && runtime.GOARCH == goarch {
@@ -41,13 +41,6 @@ func Use(goos, goarch string, wasiThreads, changeRpath bool) (export Export, err
// Add OS-specific flags
switch goos {
case "darwin": // ld64.lld (macOS)
if changeRpath {
export.LDFLAGS = append(
export.LDFLAGS,
"-rpath", "@loader_path",
"-rpath", "@loader_path/../lib",
)
}
export.LDFLAGS = append(
export.LDFLAGS,
"-Xlinker", "-dead_strip",