google / google/draco

ld: unknown option: --start-group

Open
#1,058 0 comments 4 reactions 0 assignees View on GitHub
bug cmake
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

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](https://cmake.org/cmake/help/latest/policy/CMP0025.html) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.