This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Link against ZLIB::ZLIB
ClosedPublic

Authored by phosek on Feb 5 2020, 6:00 PM.

Details

Reviewers
compnerd
Summary

This is the imported target that find_package(ZLIB) defines.

Diff Detail

Event Timeline

phosek created this revision.Feb 5 2020, 6:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 6:00 PM
compnerd accepted this revision.Feb 5 2020, 6:05 PM

Linking against the imported target should do the right thing and add interface headers too.

This revision is now accepted and ready to land.Feb 5 2020, 6:05 PM
smeenai added a subscriber: smeenai.Feb 5 2020, 6:44 PM

Can you check the output of llvm-config --system-libs after this? There's been some issues reported for that after the original change (https://github.com/llvm/llvm-project/commit/abb00753069554c538f3d850897373d093389945), such as https://bugs.llvm.org/show_bug.cgi?id=44780.

foad added a subscriber: foad.Feb 6 2020, 1:26 AM

Hi @phosek, my local check builds are failing with:

$ ninja check-llvm-bindings-go
[0/1] Running lit suite /home/jayfoad2/git/llvm-project/llvm/test/Bindings/Go
FAIL: LLVM :: Bindings/Go/go.test (1 of 1)
******************** TEST 'LLVM :: Bindings/Go/go.test' FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/jayfoad2/llvm-debug/bin/llvm-go go=/usr/bin/go test llvm.org/llvm/bindings/go/llvm
--
Exit Code: 1

Command Output (stdout):
--
FAIL	llvm.org/llvm/bindings/go/llvm [build failed]

--
Command Output (stderr):
--
+ : 'RUN: at line 1'
+ /home/jayfoad2/llvm-debug/bin/llvm-go go=/usr/bin/go test llvm.org/llvm/bindings/go/llvm
# llvm.org/llvm/bindings/go/llvm
/usr/bin/ld.lld: error: unable to find library -lZLIB::ZLIB
clang: error: linker command failed with exit code 1 (use -v to see invocation)

--

********************

Testing Time: 12.58s
********************
Failing Tests (1):
    LLVM :: Bindings/Go/go.test

  Unexpected Failures: 1
FAILED: test/CMakeFiles/check-llvm-bindings-go 
cd /home/jayfoad2/llvm-debug/test && /usr/bin/python2.7 /home/jayfoad2/llvm-debug/./bin/llvm-lit -s -vv /home/jayfoad2/git/llvm-project/llvm/test/Bindings/Go
ninja: build stopped: subcommand failed.

Can you advise?

chill added a subscriber: chill.Feb 6 2020, 7:42 AM

We get bogus output from llvm-config:

$ ./bin/llvm-config --system-libs
-lZLIB::ZLIB -lrt -ldl -ltinfo -lpthread -lm
srj added a subscriber: srj.Feb 6 2020, 1:24 PM

We too get this bogus result from llvm-config (and it's breaking some of our builds). Please fix or revert.