Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LTO on newer macOS. #4548

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

JohanEngelen
Copy link
Member

The trouble was that the libLTO-ldc.dylib was not used by ld64, even though it is explicitly passed using -lto_library. Somehow the library renaming (adding "-ldc" postfix) is not working properly. I did not figure out how to fix it (the usual install-name-tool and resigning did not work), the only fix that worked is to not rename it at all. This bug went unnoticed because at -O0, there is no LTO object file output at all; hence the -O3 addition to the thinlto testcase.

The trouble was that the libLTO-ldc.dylib was not used by ld64, even though it is explicitly passed using -lto_library. Somehow the library renaming (adding "-ldc" postfix) is not working properly. I did not figure out how to fix it (the usual install-name-tool and resigning did not work), the only fix that worked is to not rename it at all.
This bug went unnoticed because at -O0, there is no LTO object file output at all; hence the -O3 addition to the thinlto testcase.
@JohanEngelen JohanEngelen enabled auto-merge (squash) December 27, 2023 15:26
@JohanEngelen JohanEngelen merged commit 2c2c550 into ldc-developers:master Dec 27, 2023
24 checks passed
@JohanEngelen JohanEngelen deleted the fix_darwin_lto branch December 28, 2023 12:16
JohanEngelen added a commit that referenced this pull request Jan 27, 2024
JohanEngelen added a commit that referenced this pull request Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant