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

Building for Windows (x86_64-pc-windows-msvc) with opt-level="s" causes link errors #691

Closed
elad-solomon opened this issue Feb 10, 2025 · 3 comments
Labels
build problem Build failure

Comments

@elad-solomon
Copy link

Problem:

I am building a rust application that utilizes aws-lc-rs and tonic in Windows.
My application is set to compile with static crt.

I tried to optimize the binary size by changing opt-size to "s", but received this link error:

Image

I was able to reproduce it by building aws-lc-rs with opt-level="s" and env RUSTFLAGS="-C target-feature=+crt-static".

Relevant details

AWS-LC for Rust versions or commit: current master (5af71cc)

I suspect the root cause relies in this logic that chooses the build type based on the opt-level. In MSVC, this directly affects the chosen C runtime, which probably causes the link error above.

@elad-solomon
Copy link
Author

elad-solomon commented Feb 10, 2025

Opened a PR that fixes this issue: #692

@justsmth
Copy link
Contributor

justsmth commented Feb 19, 2025

Hello! We just released aws-lc-rs v1.12.3 which addresses the problem reported here. This issue will now be resolved. If you continue to experience problems after upgrading, feel free to reopen this issue or create a new one.

Thanks for the report and for helping us improve our library!

@elad-solomon
Copy link
Author

elad-solomon commented Feb 19, 2025

Awesome, great news!!
Thanks for the rather quick response on this @justsmth , loving the activeness here in this project.

I think there might be a regression in the arm64 in this release (probably due to other commits unrelated to this issue), check out the issue I created today - #703

nevermind, false positive on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build problem Build failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants