refactor(internal/build):remove rpath change
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -75,7 +75,7 @@ func TestUseCrossCompileSDK(t *testing.T) {
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
export, err := Use(tc.goos, tc.goarch, false, false)
|
||||
export, err := Use(tc.goos, tc.goarch, false)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user