-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Add runtime_library_search_directories for QNX dynamic linking #14
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
base: main
Are you sure you want to change the base?
fix: Add runtime_library_search_directories for QNX dynamic linking #14
Conversation
QNX toolchain requires -Wl,-rpath instead of -rpath for runtime library paths. This enables cc_shared_library and dynamic linking support.
nradakovic
left a comment
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.
Is this only for QNX? If that's the case, we need to set some guard, or to move this as part of template enablement.
Also, I don't see set on toolchains_qnx. Is there a reason why this was not enabled there? |
Yes it's only with the qcc/q++ compiler. Works on gcc/linux without changes. And yes, we identified it first (last week) on toolchains_qnx. Because it was already being phased out we checked with bazel_cpp_toolchains. Luckily fixing it there was possible with limited impact. What kind of guard do you mean? The change is in template/qnx so it should be limited to QNX only. Please make a proposal - I may not get what you mean... |
|
FYI: The error sighting in building the examples with the |
|
...and one more comment for explanation: My guess for the main root cause is that bazel cc_rules don't really support qcc well. When trying to trace the In the rules_cc link above the So the main root cause could be that bazel cc_rules don't really support qcc and this PR is a workaround for that. |
It's actually a bit deeper than that. Most configurations (this one as well) relay on legacy features. These features are used as autocomplete compiler and linker configuration and if you do not override them, Bazel assumes you want to use default implementation. For that he uses Unix like build and Windows (I think) like build to configure "missing" features. In case of QNX they assume search paths are the same as on Linux. Solution is of course to disable this, and go full customized configuration, but I have no time to implement that. I have done it for internal toolchains this approach, it's for sure better and safer, but for S-CORE I don't have time. |
We have idea that same features exists on both configuration so that in the future we can merge templates. We tried already now but too many delta were in place so we went separate template. But with this said, I don't want to make different linker features between them. Can we set this in default linker options? |
Sure - if you have a better way to implement this, that's completely fine with me. We can discard this PR in that case. That was just how we thought a broken feature we require could be fixed. |
No, I don't want to take credit for your work. I just want that you extend the list of current default_linker_flags_feature instead of creating completely new feature. If this is something that is mandatory for QNX, then we put it in default link feature. That's all. Update PR and I will approve it. |
|
Crap. With my last change I made conflict. Sorry about that. |
QNX toolchain requires -Wl,-rpath instead of -rpath for runtime library paths. This enables cc_shared_library and dynamic linking support.
Extend examples for dynamic linking case.