-
Notifications
You must be signed in to change notification settings - Fork 3.4k
musl v1.2.2 LTO linker errors for exp_data and exp2f_data #15506
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
Comments
Ok... after trying out @sbc100's PR the exp_data and exp2_data linker errors appear fixed, but there's now a similar followup problem with
Also only when compiling with LTO. Those are defined in MUSL in the source files |
Ok, looks like adding the following files additionally to the new files in #15497 fixes the issue for my
...hard to say though if there are similar problems lurking in other code bases... |
Oops, sorry, that was too early. While the libmodplug case is fixed, other sokol-sample demos now trigger a new wasm-ld error I haven't seen before.
This appears to happen in demos that also link with Dear ImGui, also seems LTO specific. No idea how to proceed there though, the error message looks like it's a problem with mixed LTO / non-LTO code generation? Sorry for causing such a rabbit hole ;) |
We have had reports of missing symbols in LTO builds after the musl upgrade (#13006): https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer Also `lto2.test_float_builtinsTest` started failing on the emscripten-releases FYI waterfall. This change moves some of the new math-related source files into the libc-mt library which is excluded from LTO (see comments in in system_libs.py for background on this). Fixes: #15506
No, this is all part of known issue related to libcalls/builtins and LTO. Last last error you are seeing is because the reference to I believe this all relates to this upstream issue that I files: https://bugs.llvm.org/show_bug.cgi?id=44353. And I think the reason that we seem to be the only effect folks is that nobody else is trying to compile compiler-rt and its libc dependencies as LTO. Hopefully #15497 should fix this for you. |
FYI @sbc100, after testing your latest PR update there was one more followup error, but adding the following files to the end of your changes seems to fix those.
...my sokol-samples project is still compiling but after 2/3 I guess it's working now (will followup here if it doesn't). PS: yep, this was the last error, at least for my projects. I wonder if there's a watertight way to make sure that other code bases don't trigger similar problems..? |
We have had reports of missing symbols in LTO builds after the musl upgrade (emscripten-core#13006): https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer Also `lto2.test_float_builtinsTest` started failing on the emscripten-releases FYI waterfall. This change moves some of the new math-related source files into the libc-mt library which is excluded from LTO (see comments in in system_libs.py for background on this). Fixes: emscripten-core#15506
I'm getting a very similar error for ldexp.o when playing with yosysjs. |
@yuyichao could you share the full command line and the full error message? |
Like the math functions here these can be generated by the compiler and therefore cannot themselves be part of LTO. See #15506
I don't really have a minimum example to show but I have a github action to do the compilation automatically and I've just triggered a build that should show the issue (if I didn't mess anything up....) The build is at https://github.com/yuyichao/yosysjs/runs/4804475201?check_suite_focus=true and it should finish in about 5-10min... The finally linking step has many different files though but if there's an easy way to automatically reduce it I could give it a try. Note that this is using 3.0.0 release since the archlinux package hasn't been updated yet but it should have the previous fix. |
See the error at https://github.com/yuyichao/yosysjs/runs/4804475201?check_suite_focus=true#step:11:1094
|
Thanks! I was not able to repro locally, but I'm fairly sure #16002 will fix the issue |
This is with llvm/clang 13, in case that’s a new transformation they added… |
Emscripten is based on tip-of-tree llvm, which is currently llvm 14 (we roll in the latest changes from llvm several times a day). Are you sure you are using llvm 13? I'd be surprised if that was working/possible. See #11362 for discussions around possibly supporting older stable llvm versions. However, I also doubt this issue is related to the specific llvm version.. i think its just a matter of crafting an imput with a certain form... which I've not managed to do yet, but I'm happy to land #16002 anyway. |
Yes you are right. The archlinux package was using a specific llvm upstream commit. |
Like the math functions here these can be generated by the compiler and therefore cannot themselves be part of LTO. See #15506
Related links:
When testing the latest tot version which switched to musl v1.2.2, I'm getting linker errors in the sokol-samples project only when building with LTO enabled:
Unfortunately I'm having a hard time coming up with a minimal reproduction test case. From looking at the MUSL sources I'd expect that just using one of the
pow(), exp(), exp2()
calls (or their 'f' versions) in a minimal source file and compiling with LTO should trigger the problem, but so far no dice (stay tuned).PS: the optimizer passes removed the actual function calls and replaced them with simplified expressions 🙄
Here's a reproducer for the exp2_data problem:
...and a reproducer for
exp_data
, same code, just replace theexp2f()
call withexp2()
:The text was updated successfully, but these errors were encountered: