package/pkg-cmake.mk: host: build shared as default
cover package/pkg-cmake.mk: host: build shared as default
this is a follow-up to this discussion/investigation
http://lists.busybox.net/pipermail/buildroot/2020-September/291494.html
first for doxygen and clangd/lld -DBUILD_SHARED_LIBS is enforced to =OFF. finally the default flag -DBUILD_SHARED_LIBS=ON is set.
Michael Nosthoff (3):
package/doxygen: disable shared libs for host package/{clang, lld}: host: disable shared_libs package/pkg-cmake.mk: build host with shared libs
package/clang/clang.mk | 1 + package/doxygen/doxygen.mk | 2 ++ package/lld/lld.mk | 3 +++ package/pkg-cmake.mk | 1 + 4 files changed, 7 insertions(+)
Signature · 1 line
2.25.1
PATCH 1/3 package/doxygen: disable shared libs for host
doxygen fails to build with BUILD_SHARED_LIBS=ON as it only for some targets honors this flag and links the rest static. So enforce BUILD_SHARED_LIBS=OFF for this package.
--- package/doxygen/doxygen.mk | 2 ++ 1 file changed, 2 insertions(+)
package/doxygen/doxygen.mk +2 -0
@@ -11,4 +11,6 @@ DOXYGEN_LICENSE = GPL-2.0 DOXYGEN_LICENSE_FILES = LICENSE HOST_DOXYGEN_DEPENDENCIES = host-flex host-bison +HOST_DOXYGEN_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF + $(eval $(host-cmake-package))
Signature · 1 line
2.25.1
PATCH 2/3 package/{clang, lld}: host: disable shared_libs
In reply to Michael Nosthoffsimilar to the llvm package disable shared libs for host build.
--- package/clang/clang.mk | 1 + package/lld/lld.mk | 3 +++ 2 files changed, 4 insertions(+)
package/clang/clang.mk +1 -0
@@ -33,6 +33,7 @@ CLANG_CONF_OPTS += -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON # By setting BUILD_SHARED_LIBS to OFF, we generate multiple static # libraries (the same way as host's clang build) and finally # libclang.so to be installed on the target. +HOST_CLANG_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF CLANG_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF # Default is Debug build, which requires considerably more disk space
package/lld/lld.mk +3 -0
@@ -19,6 +19,9 @@ HOST_LLD_DEPENDENCIES = host-llvm # https://reviews.llvm.org/D57264 HOST_LLD_CONF_OPTS += -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON +# build as static libs as is done in llvm & clang +HOST_LLD_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF + # GCC looks for tools in a different path from LLD's default installation path define HOST_LLD_CREATE_SYMLINKS mkdir -p $(HOST_DIR)/$(GNU_TARGET_NAME)/bin
Signature · 1 line
2.25.1
PATCH 3/3 package/pkg-cmake.mk: build host with shared libs
In reply to Michael NosthoffCMake offers the BUILD_SHARED_LIBS flag as a default parameter and most packages honor them.
Similar to pkg-autotools.mk build host packages always with BUILD_SHARED_LIBS=ON.
--- package/pkg-cmake.mk | 1 + 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +1 -0
@@ -146,6 +146,7 @@ define $(2)_CONFIGURE_CMDS -DBUILD_TEST=OFF \ -DBUILD_TESTS=OFF \ -DBUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=ON \ $$(CMAKE_QUIET) \ $$($$(PKG)_CONF_OPTS) \ )
Signature · 1 line
2.25.1
PATCH 1/3 package/doxygen: disable shared libs for host
In reply to Michael NosthoffQuoted 8 lines · On Wed, 16 Sep 2020 12:02:09 +0200 Michael Nosthoff via buildroot…
doxygen fails to build with BUILD_SHARED_LIBS=ON as it only for some targets honors this flag and links the rest static. So enforce BUILD_SHARED_LIBS=OFF for this package.
Signed-off-by Michael Nosthoff <[email protected]>--- package/doxygen/doxygen.mk | 2 ++ 1 file changed, 2 insertions(+)
Thanks, series applied!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com