Description
Problem Scenario:
We support deployment of artifacts across multiple platforms with multiple compilers (gcc, xlc, msvc). When a compiler/linker option from one of the previous stage is passed during default-test phase, few linkers (like gcc) are smart enough to exclude some linker options that might not be applicable for building a test executable, whereas few other compiler (e.g., xlc & msvc) still continue to link with linker options that either render an invalid unit-test executable (that can't be run) or fail to build an executable.
Example:
For msvc linker, linker options like /DLL or / DEF when continued to be passed as a flag during default-test phase, tries building an intermediate unittest.lib for test executable & fails to render a valid unit-test executable.
For xlc linker, similar linker options used for building a shared object must be discarded during test phase, those linker flags include -bnoentry, -bE, -qmkshrobj.
Solution:
The most elegant solution, we could think of cross-platform is to provide a testExcludeOptions that when passed in the linker section, would just exclude linker options (that were previously included to build a shared object) from getting passed to linker during the test-phase build.
Pull-request:
Please refer to #306, also contains automated tests (unit-tests) to validate the issue.