You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Swift driver is invoked with the `-emit-library` option, but
without an `-o` option that specifies the emitted library's filename,
logic in the `getOutputFilename()` function derives a filename:
`"lib" + <a plasible base name>"`, and then the value of the
`LTDL_SHLIB_EXT` macro.
There are two problems here:
1. Windows shared library file names, by convention, do not begin with "lib".
2. The `LTDL_SHLIB_EXT` macro is set by
`llvm/cmake/modules/HandleLLVMOptions.cmake`, based on
`CMAKE_SHARED_LIBRARY_SUFFIX`, a built-in CMake variable that is set
at the time LLVM is configured to be built. So, if LLVM and Swift
were built on a Linux machine, but the `swiftc` executable that was
built was then invoked to produce a shared library for a Darwin target,
the library would have a ".so" suffix, not ".dylib". (It's for this
reason that the tests for this name inference, in
`test/Driver/linker.swift`, must use a regular expression that
matches both ".dylib" and ".so", despite specifying a Darwin
`-target`.)
In order to produce conventionally correct prefixes and suffixes based
on the target, modify the `getOutputFilename()` function to take an
`llvm::Triple` argument.
0 commit comments