Conversation

For a simple piece of C code I wanted to setup to run a simple test with all the fancy sanitizing and bug finding tools gcc/clang provide. This seems like exactly the thing you want to do with a CI, yet it was surprisingly challenging. Thread.
7
29
Issue 1: Code uses getrandom(), which is reasonably new. The travis environment is not very up-to-date. Default is Ubuntu 16. No getrandom. Latest available is Ubuntu 18.
3
3
Issue 2: MSAN. Again the environment is old. MSAN has a issue with getrandom before version 10, no current clang easily available on travis.
1
2
Issue 3: CFI. CFI uses the gold linker, which is not installed in the clang image. Okay, no problem, we can install it, right? well. travis uses its own version of clang, not the one from ubuntu, for whatever reasons. and no gold, thus no CFI.
3
1
Replying to
CFI doesn't require gold. It requires either LLD or the LLVM linker plugin with gold or ld.bfd. LLVM doesn't officially support the linker plugin with ld.bfd, but it has been possible to do it since binutils 2.21.51.0.2. It's not officially recommended or supported, but works.
1
Replying to and
AOSP and Chromium switched to LLD and Gold is no longer really actively developed or maintained. Gold is essentially already deprecated. It's not marked as such in binutils since the replacement is part of the LLVM project but it's going to rot away now.