-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
compiler_rt: export floorl #10163
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
compiler_rt: export floorl #10163
Conversation
This fixes a stage1 linker error when compiling with VS2022 on Windows.
Is it correct to delete code from c_stage1.zig as it is moved to compiler_rt or will this cause problems elsewhere? |
@jcmoyer As compiler_rt is intended to match LLVM (see the README), this does not look like the right place to me.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks OK to merge to me. What's the problem as it stands?
Is it correct to delete code from c_stage1.zig as it is moved to compiler_rt or will this cause problems elsewhere?
Yes it is correct 👍
It's not intended to match LLVM exactly. It already has extra things for Zig to rely on that are not provided by LLVM's compiler-rt. See #7265 for more details. |
I find it confusing to call the document A small README of the structure would be nice and personally I would finding a rename of the folder compiler_rt to @LemonBoy What is your take on this? |
IMO compiler-rt must follow LLVM's structure (of course with the only exception of our custom stack probes) which in turn (loosely) follows libgcc, having one extra CU is better than shoving everything into a single huge file ( But let's take one step back. You don't want #7265 arguments are weak, merging everything together doesn't simplify anything for developers nor for the average user. |
one thing is simpler than two things. what's the argument for having two things? is it to follow some standard? but already we see that llvm's compiler-rt, libgcc, and msvc's equivalent are subtly different. the only realistic way to make sure everything works is to provide every symbol ourselves, but allow overriding (which is why we use weak_odr linkage). plus we have zig-specific stuff that requires non-"standard" symbols, such as math with arbitrary sized integers which we will need to lower to a compiler-rt call of a function that llvm's compiler-rt will never have. #1485 also, as this pull request demonstrates, this solves a problem that is currently causing windows to not link, precisely because of the improved simplicity of compiler-rt having more of the, well, compiler's runtime!
Thank you for making that patch upstream btw. |
This fixes a linker error when compiling with VS2022 on Windows:
I'm not entirely sure this is the correct place to export or if it should go into one of the conditional branches above.
E: So actually this is the classic C thing where long double isn't necessarily bigger than double, this will probably require some more thought. I'm going to have a closer look at what andrew suggested in IRC (related: #7265) since it looks like there's a better way to write this already in
std/special/c_stage1.zig
.