Forward <linkflags> from using msvc toolset options to the linker#606
Open
uilianries wants to merge 3 commits into
Open
Forward <linkflags> from using msvc toolset options to the linker#606uilianries wants to merge 3 commits into
uilianries wants to merge 3 commits into
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
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.
Proposed changes
Greetings! 👋
While working through a Windows/MSVC debug-build issue in the Boost Conan recipe, I found that
<linkflags>passed through ausing msvc : version : command : options ;toolset-configuration statement is silently dropped, so it never reacheslink.exe.However, the documentation has a standard for
options:https://www.bfgroup.xyz/b2/manual/release/index.html#b2.overview.configuration:
And it uses the example:
Doing a quick search, the common.jam always stores
<linkflags>into a variable namedOPTIONS, scoped to<toolset>.linkBased on the documetation example, gcc.jam reads that
$(OPTIONS):However, the msvc.jam only reads
$(LINKOPT)and$(LINKFLAGS), but does not list$(OPTIONS)there:So on msvc,
<linkflags>supplied via ausingstatement is silently dropped at link time, while the same flag supplied as b2 command line property works fine, since that path populatesLINKFLAGSdirectly.In practice this meant things like
/DEBUGsilently never reachedlink.exewhen passed manually.This PR adds
$(OPTIONS)tomsvc.jam, we can use auser-config.jamlike:The
ldflagspassed to<linkflags>will correctly passed to msvc toolset in this case. This behavior is working already for GCC.I also added a new regression test to validate what is passed via
<linkflags>will be listed in the linker command for msvc.Steps to Reproduce
Minimal reproduction without Boost:
The link command should be similar to:
The
/SOMETHINGflag is missing. You can check my full build log: b2-test-output.logEnvironment
Types of changes
Checklist
Further comments
Let me know if you'd like the test extended to cover
clang-win/intel-winexplicitly, or if a different regression-test shape is preferred. Regards!