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

Add __chkstk on i686-pc-windows-gnu. #588

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Add __chkstk on i686-pc-windows-gnu. #588

merged 1 commit into from
Apr 10, 2024

Conversation

jeremyd2019
Copy link
Contributor

libLLVMSupport.a(DynamicLibrary.cpp.obj) references ___chkstk, which is an alias of __alloca in libgcc. This crate provided __alloca, but libgcc's implementation was also pulled in by the linker due to the reference to ___chkstk, causing a multiple definition linker error. Providing that symbol here prevents that.

Fixes #585

The reference to ___chkstk is due to https://github.com/llvm/llvm-project/blob/ccc02563f4d620d4d29a1cbd2c463871cc54745b/llvm/lib/Support/Windows/explicit_symbols.inc#L16-L18 (or possibly the reference above to __chkstk due to i386 name rules adding another underscore), not due to the compiler actually generating calls to it.

libLLVMSupport.a(DynamicLibrary.cpp.obj) references ___chkstk, which is
an alias of __alloca in libgcc.  This crate provided __alloca, but
libgcc's implementation was also pulled in by the linker due to the
reference to ___chkstk, causing a multiple definition linker error.
Providing that symbol here prevents that.

Fixes #585
@Amanieu Amanieu merged commit 3f47913 into rust-lang:master Apr 10, 2024
22 checks passed
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.

Regression: build failure on i686-pc-windows-gnu due to multiple definition of _alloca
2 participants