Revert "Revert "Merge pull request #7424 from kubkon/macho-surgery""

This commit is contained in:
Jakub Konka 2024-12-30 16:26:42 +01:00 committed by GitHub
parent d599e8c1e2
commit b0cd51f089
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 191 additions and 90 deletions

View file

@ -1041,14 +1041,13 @@ fn link_macos(
// "--gc-sections",
"-arch",
&arch,
// Suppress warnings, because otherwise it prints:
//
// ld: warning: -undefined dynamic_lookup may not work with chained fixups
//
// We can't disable that option without breaking either x64 mac or ARM mac
"-w",
"-macos_version_min",
&get_macos_version(),
// Suppress fixup chains to ease working out dynamic relocs by the
// surgical linker. In my experience, working with dyld opcodes is
// slightly easier than unpacking compressed info from the __got section
// and fixups load command.
"-no_fixup_chains",
])
.args(input_paths)
.args(extra_link_flags());