-
Notifications
You must be signed in to change notification settings - Fork 19
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
cmake: build libraries failed #68
Comments
Each time the silver bullet whole archive is mentioned it feels worse to swallow that pill because I did not get the rationale yet. |
@jschlatow f256f01 also fixes the problem for me. This hopefully will not break #60. The libraries I get are < 2MB. |
The rational is everything that is |
@trimpim, @jschlatow: I will have a look into this. @trimpim: Can I reproduce your scenario using https://github.com/trimpim/wasmedge-genode ? There doesn't seem to be a |
@trimpim: Thanks, where do I find the |
@trimpim: Nevermind found it. |
@trimpim: You need to change the
to
because In the meantime I will try to clean up the |
* add libgcc as whole-archive to 'ldlibs_so' in flags.tcl * remove unnecessary 'whole-archive' entries from qmake.tcl and cmake.tcl * remove unnecessary and unused globals of 'ldlibs_so' issue genodelabs#68
@jschlatow: The issue for |
As we use libgcc_eh (and libsupc++) in a creative way in cxx.mk it is literally part of the linker but suffers from the global-hidden condition too (if I understand correctly). Would it make sense to review symbols/ld and the linking of ld.lib.so to provide more symbols of the runtime that are currently missing to solve the issues we address here? |
@ssumpf thanks for the fix. With this change and your patch build and run of wasmedge works for me. |
* add libgcc as whole-archive to 'ldlibs_so' in flags.tcl * remove unnecessary 'whole-archive' entries from qmake.tcl and cmake.tcl * remove unnecessary and unused globals of 'ldlibs_so' issue #68
* move the '-lgcc' from ldlib_so to ldlibs_common and use ldlibs_common also for qmake (as done by the other build systems) * remove unnecessary libgcc locating code for qmake issue genodelabs#68
@jschlatow: ce9b91b tries to improve upon f219ab3 by removing the unnecessary detection of |
Autoconf apparently also suffers. (experienced while attempting to port gforth on Linux/ARM64 on my MNT-Reform) With the common, the basic compile test fails because all symbols of libgcc end up in the binary twice. This is probably because I sense that the wrapping of -lgcc in a |
@ssumpf I also noticed that you removed the |
As far as I understand it, this is covered by |
Okay, this one is new to me. In this case we want -lgcc for all binaries and the |
That's true - at least that was the rationale of 9dcadf7. It seems that I missed adapting qmake.tcl in this respect. So it's good to remove this option. Could you do this in a separate commit? |
* add the '-lgcc' to ldlibs_common and use ldlibs_common also for qmake (as done by the other build systems) * remove libgcc locating code for qmake issue genodelabs#68
This is already covered by 'ldlibs_common' issue genodelabs#68
P.S. This also resolves the |
As we are again orbiting around whole-archive I took yesterday afternoon to get an idea of the actual situation and how several statements of the past fit into this picture.
After the investigation I patched examples for the test ecf97e0 and sketched solutions for common flags e3f8557 as well as cmake 459308b. My question is now: Can we walk this road and, thus, wipe some myths and legends associated to this topic? |
Could you please tell us the nature of the problem? Which constructor was not called? Also, 9f94761 changes flags.tcl en-passant but the commit message suggests changes (and effects) to qmake only, while all build systems are affected. |
@chelmuth: I have tried your branch and it seems to work well in most cases. |
@chelmuth: I will try to get -lgcc to the end of the linker command line for qmake next. |
It looks like |
@cproc: Yes this does the trick 👍 |
* remove '-static-gcc'from ldlibs_common as '-nodefaultlibs/ disables the desired liggcc * remove '-lgcc' from whole archive of ldlibs_so because it is not required when '-lgcc' s *always* at the end of the linking command issue genodelabs#68
We use the GENODE_QMAKE_LIBS variable to achieve this. issue genodelabs#68
This is covered by ldlibs_common issue genodelabs#68
@jschlatow: The commits above (my staging branch) are hopefully the last ones regarding this issue. Thanks to our combined knowledge I am pretty happy with this solution and everything works as expected. |
* remove '-static-gcc'from ldlibs_common as '-nodefaultlibs/ disables the desired liggcc * remove '-lgcc' from whole archive of ldlibs_so because it is not required when '-lgcc' is *always* at the end of the linking command issue #68
* remove unnecessary 'whole-archive' entries from qmake.tcl and cmake.tcl * remove unnecessary and unused globals of 'ldlibs_so' issue #68
We use the GENODE_QMAKE_LIBS variable to achieve this. issue #68
This is covered by ldlibs_common issue #68
Thanks for the collaborative effort. I'm also happy with the result. I merged the commits and force-pushed to staging to eliminate commit 81ced02. |
When I try to run our
waasmedge
project with either 23.04 or 23.10 I get the following error:This uses:
libunwind
,libcxx-abi
andlibcxx
fromllvm
spdlog
wasmedge
These are all built using goa.
2ec360c resolves the issue for me, but as I'm no expert on linking this might be far from optimal.
This might be related to #66 and the errors I encountered in genodelabs/genode-world#342
The text was updated successfully, but these errors were encountered: