Remove problematic quotes in the --undefined-glob linker argument#130
Open
06393993 wants to merge 1 commit into
Open
Remove problematic quotes in the --undefined-glob linker argument#13006393993 wants to merge 1 commit into
06393993 wants to merge 1 commit into
Conversation
The argument with quotes work because bazel use a response file[1] to pass the parameters to the linker. When the linker parse the response file, unncessary quotes are removed. But if the parameters are short, and bazel directly calls the linker with the arguments, the extra quotes unexpectedly become part of the pattern that the --undefined-glob argument tries to match. As a result, the linker may strip symbols starting with JNI_ or Java_ unexpectedly. In addition, it breaks the `meson` rule from `rules_foreign_cc`, because `meson` always passes the arguments to the linker as process arguments directly. And `meson`'s native files/cross files don't support single quote in `cpp_link_args` anyway[2]. [1]: https://gcc.gnu.org/wiki/Response_Files [2]: mesonbuild/meson#15573
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The argument with quotes work because bazel use a response file1 to pass the parameters to the linker. When the linker parse the response file, unncessary quotes are removed. But if the parameters are short, and bazel directly calls the linker with the arguments, the extra quotes unexpectedly become part of the pattern that the --undefined-glob argument tries to match. As a result, the linker may strip symbols starting with JNI_ or Java_ unexpectedly.
In addition, it breaks the
mesonrule fromrules_foreign_cc, becausemesonalways passes the arguments to the linker as process arguments directly. Andmeson's native files/cross files don't support single quote incpp_link_argsanyway2.