Misconfiguration of create_llvm_prof |
|||||
Issue descriptionNot sure if this is caused by the llvm roll (4.0 -> 5.0) or host toolchain migration. (cros sdk) ~$ create_llvm_prof ERROR: LLVM support was not enabled in this configuration. Please configure and rebuild with: $ ./configure --with-llvm=<path-to-llvm-config>
,
May 4 2017
It looks like that "--as-needed" breaks the mechanism on which the following change relies. Disabling --as-needed for this host package seems the way to go. commit 7b6b980178ddf686d1cceb37124b139828108808 Author: Mehdi Amini <mehdi.amini@apple.com> Date: Mon Nov 28 22:23:53 2016 +0000 Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch The macro LLVM_ENABLE_ABI_BREAKING_CHECKS is moved to a new header abi-breaking.h, from llvm-config.h. Only headers that are using the macro are including this new header. LLVM will define a symbol, either EnableABIBreakingChecks or DisableABIBreakingChecks depending on the configuration setting for LLVM_ABI_BREAKING_CHECKS. The abi-breaking.h header will add weak references to these symbols in every clients that includes this header. This should ensure that a mismatch triggers a link failure (or a load time failure for DSO). On MSVC, the pragma "detect_mismatch" is used instead. Differential Revision: https://reviews.llvm.org/D26876 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288082 91177308-0d34-0410-b5e6-96231b3b80d8
,
May 5 2017
OK, here is the problem. autofdo's autotools files specify LLVM libraries in LDFLAGS, rather than LIBS. That resulted in wrong order of objects in the command line when calling ld. I'm preparing a fix to upstream and will cherry-pick it back here. Since we already have a work-around[1], there is no time pressure. [1] https://chromium-review.googlesource.com/c/496647
,
May 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/e275ca42268b1e1bd5534e6c9358129c2e4188ef commit e275ca42268b1e1bd5534e6c9358129c2e4188ef Author: Ting-Yuan Huang <laszio@chromium.org> Date: Fri May 05 21:42:50 2017 autofdo: filter -Wl,--as-needed --as-needed breaks a link time check introduced in https://reviews.llvm.org/D26876 during configuration. BUG= chromium:718580 TEST=create_llvm_prof runs Change-Id: I229804d6070f54955c1985504afb8bcc96b4865e Reviewed-on: https://chromium-review.googlesource.com/496647 Commit-Ready: Ting-Yuan Huang <laszio@chromium.org> Tested-by: Ting-Yuan Huang <laszio@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [rename] https://crrev.com/e275ca42268b1e1bd5534e6c9358129c2e4188ef/sys-devel/autofdo/autofdo-0.15-r3.ebuild [modify] https://crrev.com/e275ca42268b1e1bd5534e6c9358129c2e4188ef/sys-devel/autofdo/autofdo-0.15.ebuild
,
May 6 2017
,
May 9 2017
,
Sep 20 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by laszio@chromium.org
, May 4 2017Tried a configure / make manually (i.e., not using ebuild / emerge) and it's fine. The difference between the good and bad configure is "-Wl,--as-needed" configure:4721: checking whether we can compile and link with llvm(ProfileData) configure:4751: x86_64-pc-linux-gnu-g++ -o conftest -O2 -pipe -std=gnu++11 -I/usr/include -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wl,-O2 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed -Wl,-rpath /usr/lib64 -L/usr/lib64 -lLLVM-5.0svn conftest.cpp >&5 /var/tmp/portage/sys-devel/autofdo-0.15-r2/temp/ccPhKcjC.o:(.data+0x0): undefined reference to `llvm::DisableABIBreakingChecks' collect2: error: ld returned 1 exit status configure:4751: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "AutoFDO" | #define PACKAGE_TARNAME "autofdo" | #define PACKAGE_VERSION "0.14" | #define PACKAGE_STRING "AutoFDO 0.14" | #define PACKAGE_BUGREPORT "autofdo@googlegroups.com" | #define PACKAGE_URL "" | #define PACKAGE "autofdo" | #define VERSION "0.14" | /* end confdefs.h. */ | | #include "llvm/ProfileData/SampleProf.h" | int | main () | { | | llvm::sampleprof::SampleRecord *R; | R = new llvm::sampleprof::SampleRecord(); | return llvm::sampleprof::SPVersion(); | | | ; | return 0; | } | configure:4768: result: no configure:4780: Using shared LLVM libraries. Setting -rpath to /usr/lib64. configure:4792: WARNING: could not detect the LLVM libraries. Support for LLVM profiles disabled.