Skip to content

llvm-config --system-libs prints entire libxml2 path #43524

@vinsonlee

Description

@vinsonlee
Bugzilla Link 44179
Resolution FIXED
Resolved on Feb 28, 2020 03:12
Version trunk
OS All
Blocks #43900
CC @compnerd,@zmodem

Extended Description

llvm-config --system-libs now prints the entire libxml2 path.

Before
$ llvm-config --system-libs
-lz -lrt -ldl -ltinfo -lpthread -lm -lxml2

Now
$ llvm-config --system-libs
-lz -lrt -ldl -ltinfo -lpthread -lm -l/usr/lib/x86_64-linux-gnu/libxml2.so

This leads to linking errors if depending on llvm-config --system-libs during compilation.
/usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu/libxml2

This new behavior is introduced with these llvm-10 commits.

commit cfcfd8a
Author: Saleem Abdulrasool [email protected]
Date: Wed Nov 27 12:55:46 2019 -0800

build: avoid cached literals being linked against

If the value of the LibXml2 search is cached, it can cause an errant
link against LIBXML2_LIBRARIES-NOTFOUND if libxml2 is not found. Add
a guard against this.  Should repair the build bots.

commit 340e7c0
Author: Saleem Abdulrasool [email protected]
Date: Wed Nov 27 12:34:36 2019 -0800

build: avoid hardcoding the libxml2 library name

FindLibXml2 will set the LIBXML2_LIBRARIES variable to the libraries that
we must link against. This will be an empty string if libxml2 is not
found. Avoid hardcoding the library name as xml2 in the configuration.
Simplify the usage in the WindowsManifest library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions