Bug#848368: llvm-toolchain-3.9: Please add ELF symbols versions to the libraries

Lisandro Damián Nicanor Pérez Meyer perezmeyer at gmail.com
Wed Jan 18 18:54:48 UTC 2017


On martes, 17 de enero de 2017 22:21:51 ART Rebecca N. Palmer wrote:
[snip] 
> This suggests the fix (warning: untested and not my area of expertise -
> and if it is using that line, why is there no -Wl,--no-whole-archive in
> the build log?):

This part I don't know.

> --- a/tools/llvm-shlib/CMakeLists.txt
> +++ b/tools/llvm-shlib/CMakeLists.txt
> @@ -42,7 +42,7 @@
>   list(REMOVE_DUPLICATES LIB_NAMES)
>   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}"
> STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD") # FIXME:
> It should be "GNU ld for elf"
>     # GNU ld doesn't resolve symbols in the version script.
> -  set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
> +  set(LIB_NAMES
> -Wl,--version-script,../../../tools/llvm-shlib/simple_version_script.map
> -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
>   elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
>     set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
>   endif()
> --- a/dev/null
> +++ b/simple_version_script.map
> @@ -0,0 +1,1 @@
> +LLVM_3.9 { global: *; };

Probably the "../../../tools" path should be replaced by $
{CMAKE_CURRENT_SOURCE_DIR}/tools

> (Should also work with the obvious change for 3.8; I haven't checked
> 3.7.  Deliberately not making 3.9 "depend" on 3.8, as the whole point is
> to make the linker treat them as separate libraries)

Right.

> Some LLVM-using libraries use -Bsymbolic to avoid similar problems (e.g.
> #768185), but I don't know whether enabling that on LLVM itself would
> help: it may well be papering over a problem that symbol versioning
> would really solve.

Right.

-- 
Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20170118/bf1e3711/attachment-0001.sig>


More information about the Pkg-llvm-team mailing list