Skip to content

[C++][CMake] Invalid version script argument supplied to MSVC linker #50449

Description

@johnwparent

Describe the bug, including details regarding any error messages, version, and platform.

Arrow's CPP CMake currently determines linker version script argument support by assessing the current CMake version, or interrogating the linker via check_linker_flag.
When using MSVC, link.exe will not fail if given an unrecognized argument, so check_linker_flag always succeeds, and supplies an invalid argument to the linker.

Normally, since the linker doesn't crash on unrecognized arguments, this is fine, just produces some linker stdout noise, however if there's a space in the path to the project root, the linker will crash as it fails to correctly process an unquoted path with a space.

Example of build failure: https://gitlab.spack.io/spack/spack-packages/-/jobs/22969196

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions