RESOLVED FIXED200987
[GTK][WPE] Gtk-Doc fails with build options which need cooperation between CFLAGS and LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=200987
Summary [GTK][WPE] Gtk-Doc fails with build options which need cooperation between CF...
Adrian Perez
Reported 2019-08-21 10:54:15 PDT
This can be reproduced with a recent enough version of Clang with support for ThinLTO, which *requires* passing -fuse-ld=lld to the linker, and -flto=thin to *both* the compiler and the linker. Failing to pass the linker options results in lld not being used and the GNU Binutils linkers don't understand LLVM bitcode, or in lld being used (if it's the default) but -flto=thin will be missing from the linker command line (not good either). This has gone unnoticed even when some distributions use LTO becase it just *happens* to work with the Binutils linkers: linking object built with -flto wors even if the flag is not passed to the linker.
Attachments
Patch (1.86 KB, patch)
2019-08-21 11:11 PDT, Adrian Perez
no flags
Adrian Perez
Comment 1 2019-08-21 11:00:17 PDT
This can be reproduced by trying to build with the following CMake incantation: CC=clang CXX=clang \ LDFLAGS='-fuse-ld=lld -flto=thin' CFLAGS='-flto=thin' CXXFLAGS='-flto=thin' cmake -DPORT=GTK -DENABLE_GTKDOC=ON <…>
Adrian Perez
Comment 2 2019-08-21 11:11:19 PDT
Philippe Normand
Comment 3 2019-08-21 11:20:11 PDT
Comment on attachment 376897 [details] Patch Looks legit :)
WebKit Commit Bot
Comment 4 2019-08-21 11:58:19 PDT
Comment on attachment 376897 [details] Patch Clearing flags on attachment: 376897 Committed r248954: <https://trac.webkit.org/changeset/248954>
WebKit Commit Bot
Comment 5 2019-08-21 11:58:21 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2019-08-21 11:59:19 PDT
Note You need to log in before you can comment on or make changes to this bug.