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

pkgconfig has -lzzip but non-dll builds need -lzzip-0 #117

Open
gdraheim opened this issue May 22, 2021 · 5 comments
Open

pkgconfig has -lzzip but non-dll builds need -lzzip-0 #117

gdraheim opened this issue May 22, 2021 · 5 comments

Comments

@gdraheim
Copy link
Owner

The mingw guys have show that a static-lib build fails as it only has a zzip-0.a being around while pkgconfig referes to zzip.a

See pull request #116 for discussions.

This comes from having the symlink "ln -s libzzip-0.so libzzip.so" activated only for shared lib builds.

if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
add_custom_target(libzzip_libtool_links ALL
    COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${dll}
    )
install(FILES
    ${outdir}/${lib}${libname}${dll}
    DESTINATION ${CMAKE_INSTALL_LIBDIR})

So the whole RELNUM and non-rel-alias setup should be revisited.

@Biswa96
Copy link
Contributor

Biswa96 commented May 22, 2021

As I said before, it is not necessary to take mingw as a special case. I have already done a little temporary patching to remove the number in libraries, here msys2/MINGW-packages#8746.

@gdraheim
Copy link
Owner Author

@Biswa96 - I am not sure if it would to have a general case to remove the libname-REL.lib feature as it may break compatibility with older versions of the lib. I would add it as a general option but as you have your own patch I'll leave as it is now.

@Biswa96
Copy link
Contributor

Biswa96 commented May 22, 2021

Agree. BTW, just for testing, I have tried to build the latest master branch and I got this error:

CMake Error at zzip/cmake_install.cmake:130 (file):
  file INSTALL cannot read symlink "F:/zziplib/bin/zzip/libzzip.dll" to
  duplicate at "F:/zziplib/bin/install/clang64/lib/libzzip.dll": File exists.
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

Just FYI, mingw does not follow .lib extension. It has .a for static lib, .dll.a for import library, .dll for dynamic lib. File list here https://packages.msys2.org/package/mingw-w64-x86_64-zziplib?repo=mingw64

@Biswa96
Copy link
Contributor

Biswa96 commented May 22, 2021

Another option would be to remain -lzzip-0 in pkgconfig files. Creating symbolic link in Microsoft Windows is a bit sketchy.

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Mar 27, 2022
The current released version of zziplib copies static libraries with appended
major version, but omits creating the necessary links to the base file names.
This prevents the linker to find the libraries via the search path.

The issue (gdraheim/zziplib#117) has been
fixed upstream; this patch extracts the necessary part of commit 0e8d35f92efb680c81f6ec1fca9f11d173dce389, to enable creation of symlinks.

This resolves the following autobuild issues:

http://autobuild.buildroot.net/results/6c56b645a2b723920f07b98474452824fba5e2c1
http://autobuild.buildroot.net/results/032aaff121fb114f388c67dbca3ad2b02f670e38
http://autobuild.buildroot.net/results/ba711034c0abe980f677e26de41739223e2f66e9

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
woodsts pushed a commit to woodsts/buildroot that referenced this issue Mar 30, 2022
The current released version of zziplib copies static libraries with appended
major version, but omits creating the necessary links to the base file names.
This prevents the linker to find the libraries via the search path.

The issue (gdraheim/zziplib#117) has been
fixed upstream; this patch extracts the necessary part of commit 0e8d35f92efb680c81f6ec1fca9f11d173dce389, to enable creation of symlinks.

This resolves the following autobuild issues:

http://autobuild.buildroot.net/results/6c56b645a2b723920f07b98474452824fba5e2c1
http://autobuild.buildroot.net/results/032aaff121fb114f388c67dbca3ad2b02f670e38
http://autobuild.buildroot.net/results/ba711034c0abe980f677e26de41739223e2f66e9

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 0f3d6d2)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
woodsts pushed a commit to woodsts/buildroot that referenced this issue Mar 30, 2022
The current released version of zziplib copies static libraries with appended
major version, but omits creating the necessary links to the base file names.
This prevents the linker to find the libraries via the search path.

The issue (gdraheim/zziplib#117) has been
fixed upstream; this patch extracts the necessary part of commit 0e8d35f92efb680c81f6ec1fca9f11d173dce389, to enable creation of symlinks.

This resolves the following autobuild issues:

http://autobuild.buildroot.net/results/6c56b645a2b723920f07b98474452824fba5e2c1
http://autobuild.buildroot.net/results/032aaff121fb114f388c67dbca3ad2b02f670e38
http://autobuild.buildroot.net/results/ba711034c0abe980f677e26de41739223e2f66e9

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 0f3d6d2)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
sbraneky pushed a commit to sbraneky/wb-buildroot that referenced this issue Feb 3, 2023
The current released version of zziplib copies static libraries with appended
major version, but omits creating the necessary links to the base file names.
This prevents the linker to find the libraries via the search path.

The issue (gdraheim/zziplib#117) has been
fixed upstream; this patch extracts the necessary part of commit 0e8d35f92efb680c81f6ec1fca9f11d173dce389, to enable creation of symlinks.

This resolves the following autobuild issues:

http://autobuild.buildroot.net/results/6c56b645a2b723920f07b98474452824fba5e2c1
http://autobuild.buildroot.net/results/032aaff121fb114f388c67dbca3ad2b02f670e38
http://autobuild.buildroot.net/results/ba711034c0abe980f677e26de41739223e2f66e9

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 0f3d6d2)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
@esselfe
Copy link

esselfe commented Mar 28, 2024

Yeah the generated pkgconfig file (/usr/lib/pkgconfig/zzip*.pc) have the wrong libs in it. Like zziplib.pc should have -lzzip-0 in it, not -lzzip. (zziplib 0.13.74)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants