Bug 200987 - [GTK][WPE] Gtk-Doc fails with build options which need cooperation between CFLAGS and LDFLAGS
Summary: [GTK][WPE] Gtk-Doc fails with build options which need cooperation between CF...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-21 10:54 PDT by Adrian Perez
Modified: 2019-08-21 11:59 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2019-08-21 11:11 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 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.
Comment 1 Adrian Perez 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 <…>
Comment 2 Adrian Perez 2019-08-21 11:11:19 PDT
Created attachment 376897 [details]
Patch
Comment 3 Philippe Normand 2019-08-21 11:20:11 PDT
Comment on attachment 376897 [details]
Patch

Looks legit :)
Comment 4 WebKit Commit Bot 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>
Comment 5 WebKit Commit Bot 2019-08-21 11:58:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-08-21 11:59:19 PDT
<rdar://problem/54565709>