Skip to content

linkerSettings appears to work differently on macOS than linux #6257

Open
@finagolfin

Description

@finagolfin

Description

I was just trying to pass -no-toolchain-stdlib-rpath to the build when installing sourcekit-lsp in swiftlang/sourcekit-lsp#715 and Alex ran a full toolchain build to make sure it worked well. Strangely, it passed on linux and Windows builds sourcekit-lsp using CMake, not SPM, so it only failed on macOS, because it appears to incorrectly pass this Swift linker flag to clang:

0%: Link sourcekit-lsp (x86_64)
clang: error: unknown argument: '-no-toolchain-stdlib-rpath'

I'm not sure why it does this on macOS only, as the SPM source clearly shows the linker command-line running through the Swift compiler.

Expected behavior

No differences in linkerSettings behavior on different platforms

Actual behavior

The given example works on linux, but not macOS.

Steps to reproduce

Add a linkerSettings with a Swift flag like -no-toolchain-stdlib-rpath and build on macOS.

Swift Package Manager version/commit hash

1750a26

Swift & OS version (output of swift --version && uname -a)

Taken from the linked macOS CI run as I don't build on macOS:
Swift compiler commit - 642386290e84e9eeeed8ba70f07d5c3628be728a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions