jpeg-turbo: fix static build
PATCH 1/2 jpeg-turbo: fix static build
Set ENABLE_STATIC and ENABLE_SHARED depending on BR2_PACKAGE_STATIC_LIBS, BR2_SHARED_SHARED_STATIC_LIBS and BR2_SHARED_SHARED_LIBS
Fixes:
- http://autobuild.buildroot.net/results/7e1500405a0f102dd6a48ef9337ffe4d7de73df3
--- package/jpeg-turbo/jpeg-turbo.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
package/jpeg-turbo/jpeg-turbo.mk +8 -0
@@ -15,6 +15,14 @@ JPEG_TURBO_DEPENDENCIES = host-pkgconf JPEG_TURBO_CONF_OPTS = -DWITH_JPEG8=ON +ifeq ($(BR2_STATIC_LIBS),y) +JPEG_TURBO_CONF_OPTS += -DENABLE_STATIC=ON -DENABLE_SHARED=OFF +else ifeq ($(BR2_SHARED_STATIC_LIBS),y) +JPEG_TURBO_CONF_OPTS += -DENABLE_STATIC=ON -DENABLE_SHARED=ON +else ifeq ($(BR2_SHARED_LIBS),y) +JPEG_TURBO_CONF_OPTS += -DENABLE_STATIC=OFF -DENABLE_SHARED=ON +endif + ifeq ($(BR2_PACKAGE_JPEG_SIMD_SUPPORT),y) JPEG_TURBO_CONF_OPTS += -DWITH_SIMD=ON # x86 simd support needs nasm
Signature · 1 line
2.14.1
PATCH 2/2 jpeg-turbo: fix install with a static only lib
Define CMAKE_INSTALL_RPATH only if ENABLE_SHARED is set otherwise the following error is raised when installing binaries:
CMake Error at cmake_install.cmake:73 (file):
file RPATH_CHANGE could not write new RPATH:
/usr/lib
to the file:
/home/fabrice/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/bin/rdjpgcom
No valid ELF RPATH or RUNPATH entry exists in the file;
--- ...ll-of-binaries-with-a-static-only-library.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/jpeg-turbo/0001-fix-install-of-binaries-with-a-static-only-library.patch
package/jpeg-turbo/0001-fix-install-of-binaries-with-a-static-only-library.patch new file +42 -0
@@ -0,0 +1,42 @@ +From f8c7732e24502c06739944f9a721c9d84a50319d Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Sun, 26 Aug 2018 19:11:55 +0200 +Subject: [PATCH] fix install of binaries with a static only library + +Define CMAKE_INSTALL_RPATH only if ENABLE_SHARED is set otherwise the +following error is raised: + +CMake Error at cmake_install.cmake:73 (file): + file RPATH_CHANGE could not write new RPATH: + + /usr/lib + + to the file: + + /home/fabrice/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/bin/rdjpgcom + + No valid ELF RPATH or RUNPATH entry exists in the file; + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Upstream status: https://github.com/libjpeg-turbo/libjpeg-turbo/pull/273] +--- + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1719522..862ab11 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,7 +109,9 @@ endif() + + include(cmakescripts/GNUInstallDirs.cmake) + ++if(ENABLE_SHARED) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) ++endif() + + macro(report_directory var) + if(CMAKE_INSTALL_${var} STREQUAL CMAKE_INSTALL_FULL_${var}) +-- +2.14.1 +
Signature · 1 line
2.14.1
Thomas Petazzoni
AppliedPATCH 1/2 jpeg-turbo: fix static build
In reply to Fabrice FontaineHello,
Quoted 11 lines · Fabrice Fontaine
Set
ENABLE_STATICandENABLE_SHAREDdepending onBR2_PACKAGE_STATIC_LIBS,BR2_SHARED_SHARED_STATIC_LIBSandBR2_SHARED_SHARED_LIBSFixes:
- http://autobuild.buildroot.net/results/7e1500405a0f102dd6a48ef9337ffe4d7de73df3Signed-off-by Fabrice Fontaine <[email protected]>--- package/jpeg-turbo/jpeg-turbo.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
Applied to next, thanks. Please follow-up with upstream on the second
patch: they asked you more details about it.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com