-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix linking problem in sac_from_c, caused by ld being a one-pass linker #2
base: master
Are you sure you want to change the base?
Conversation
AFAIK, the problem is a bit deeper. Will the fix you propose solves your problem, it creates the dual problem for systems where linking is done the other way around. If this is indeed the case, we need to find a way to detect what the system needs; this should be possible within CMAKE... |
Re Bodo's comment, above: Can you cite any single-pass linker/loaders that work in the opposite As the code stands in sac_from_c/CMakeLists.txt now, the offending argument sequence was |
@sbscholz , Cmake doesn't really help here, as Alternatively, and this is what we are doing right now, we have to generate the command that calls the C compiler in the right way. There is always a risk that this would be incorrect for some compiler. While it should be possible to adjust But maybe, before doing all this, I think that Bob's solution is actually reasonable. A single-pass linker is the simplest kind that we can find in the wild, so if it accepts our commands, any other linker should do so as well. Do you have a specific example of a linker that would fail? |
Are the -lmod1 and -lmod2 flags blindly introduced in order to support some maybe-run-time codes? Just curious. WRT -l stuff, I read somewhere that CMAKE does have the capability to sort the library trees into a correct order |
@bernecky , the As for cmake, yes, it knows how to build the targets correctly and it would do the right thing. The catch is that you have to give dependencies statically (when you run cmake). In case of sac_from_c, we are dealing with dynamic dependencies: we have to compile Sum.sac before we can call sac4c to figure out the flags that are needed for summarize. Once again, it is possible to work around this problem, but the solution is non-trivial. Therefore, maybe in this particular case of a single binary, what you are proposing is ok. |
Hi, Artem. Your "generated by sac4c dynamically with some assumptions..." threw me. I assumed |
No description provided.