Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] zlib: conan recipe produces a non-relocatable shared lib on macOS (no LC_ID_DYLIB @rpath/libz.1.dylib) #9052

Closed
SpaceIm opened this issue Jan 24, 2022 · 0 comments · Fixed by #9056
Labels
bug Something isn't working

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 24, 2022

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: zlib/1.2.11
  • Operating System+version: Macos Monterey
  • Compiler+version: apple-clang 13
  • Conan version: conan 1.44.1
  • Python version: Python 3.9.10

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Macos
arch=x86_64
compiler=apple-clang
compiler.version=13.0
compiler.libcxx=libc++
build_type=Release
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

  • conan install zlib/1.2.11@ -o zlib:shared=True -b missing
  • cd to install lib dir of zlib
  • otool -L libz.1.2.11.dylib

Logs (Include/Attach if Applicable)

currently:

libz.1.2.11.dylib:
	libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

A proper relocatable shared lib should be:

libz.1.2.11.dylib:
	@rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

I won't open an issue for all recipes suffering of this issue, but among key recipes, I've seen at least: zlib, libcurl & openssl.

For zlib there is a simple explanation:

  • upstream CMakeLists set a very low min CMake version, which disable rpath in its policy
  • even with the proper CMake policy, files are copied manually in the recipe during installation instead of installed properly (install target of CMake is not just a simple copy of files, it properly changes rpath by removing absolute paths set in the build tree and replacing by default everything by @rpath/).
@SpaceIm SpaceIm added the bug Something isn't working label Jan 24, 2022
@SpaceIm SpaceIm changed the title [package] zlib: procudes non-relocatable shared lib on macOS (no LC_ID_DYLIB @rpath/libz.1.dylib) [package] zlib: conan recipe produces a non-relocatable shared lib on macOS (no LC_ID_DYLIB @rpath/libz.1.dylib) Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant