draco icon indicating copy to clipboard operation
draco copied to clipboard

ld: unknown option: --start-group

Open ryandesign opened this issue 1 year ago • 0 comments

draco 1.5.7 fails to link on macOS when using an llvm.org release of clang (as opposed to an Apple release of clang from Xcode or its command line tools). The error is:

ld: unknown option: --start-group

The cause is this code:

https://github.com/google/draco/blob/7d58126d076bc3f5f9d8c114d1700b7311faecfe/cmake/draco_targets.cmake#L165-L179

Apple clang identifies itself with the CMake compiler ID AppleClang (assuming CMP0025 is set to NEW which in my case it is) and llvm.org clang identifies itself as just Clang. This code, therefore, is checking if the compiler is llvm.org clang (or GCC) and if so it is adding the linker flags --start-group and --end-group which the macOS linker does not understand. You are presuming that using a non-Apple build of clang (or using GCC) means compiling on a non-Apple operating system, which is not a valid assumption.

ryandesign avatar Apr 12 '24 19:04 ryandesign