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

Build: fix linking of executables on some systems where TIFF/LCMS2 static libraries are not in system directories (fixes #1430) #1431

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

rouault
Copy link
Collaborator

@rouault rouault commented Jun 27, 2022

Note that the fix might be partial only for static-only builds (cf
comments)

Ammends PR #866 and #867

CC @ffontaine / @pseiderer

…atic libraries are not in system directories (fixes uclouvain#1430)

Note that the fix might be partial only for static-only builds (cf
comments)

Ammends PR uclouvain#866 and uclouvain#867
@ffontaine
Copy link
Contributor

I'm a little bit lost, TIFF_LIBNAME is set to ${TIFF_LIBRARIES} ${PC_TIFF_STATIC_LIBRARIES} which seems right except if ${PC_TIFF_STATIC_LIBRARIES} is "broken" on osx and contains a non existing path resulting in a build failure. Did I missed something?

@rouault
Copy link
Collaborator Author

rouault commented Jun 27, 2022

except if ${PC_TIFF_STATIC_LIBRARIES} is "broken" on osx and contains a non existing path resulting in a build failure.

PC_TIFF_STATIC_LIBRARIES on my Ubuntu 20.04 is "tiff;webp;zstd;lzma;jbig;jpeg;z;m" . Which is OK, but this variable doesn't contain paths, which causes the issue on distributions where the libraries are not in a system library directory. Presumably this should be combined with PC_TIFF_STATIC_LIBS_PATHS to build fully expanded library names.

@ffontaine
Copy link
Contributor

Thanks for the clarification. You're right, paths will not be returned by default by pkg-config, they're added by buildroot wrapper.

So, your change seems correct however I fear that it will break the build of openjp2_static when BUILD_SHARED_LIBS and BUILD_STATIC_LIBS are both set to ON. We'll probably have to disable this use case of building both libraries on buildroot.

@rouault
Copy link
Collaborator Author

rouault commented Jun 27, 2022

I fear that it will break the build of openjp2_static when BUILD_SHARED_LIBS and BUILD_STATIC_LIBS are both set to ON

yes that's likely. Perhaps do 2 separate builds. Static builds with dependency tracking are quite difficult to get right, and openjpeg that attempts to do both at the same time make it even more challenging.

@rouault rouault merged commit ca74961 into uclouvain:master Jun 27, 2022
@ffontaine
Copy link
Contributor

Indeed, we should definitely remove the BR2_SHARED_STATIC_LIBS option in buildroot.
Thanks for pinging me about this change. I'll be able to correctly handle the bump of openjpeg in buildroot.

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

Successfully merging this pull request may close these issues.

2 participants