[vlc-commits] [Git][videolan/vlc][master] 4 commits: contrib: use HOSTVARS_PIC on CMake targets forcing POSITION_INDEPENDENT_CODE

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Oct 20 10:52:30 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c3ceacfd by Steve Lhomme at 2022-10-20T09:57:14+00:00
contrib: use HOSTVARS_PIC on CMake targets forcing POSITION_INDEPENDENT_CODE

...for static library builds.

So we have a clearer view of which target uses PIC and which doesn't.

aom does it with the CONFIG_PIC variable that we set with the same conditions
we set PIC.

- - - - -
d9f258b9 by Steve Lhomme at 2022-10-20T09:57:14+00:00
contrib: use HOSTVARS_PIC for vulkan targets

It makes no difference since we install headers and build a static library
only on mac. CMake defaults to PIC on shared libraries.

- - - - -
e1b6661e by Steve Lhomme at 2022-10-20T09:57:14+00:00
contrib: use the CMake flag to select the PIC flag

It may differ between compilers and is internally handled by CMake, including
not doing it on Windows targets.

- - - - -
c3d55dc1 by Steve Lhomme at 2022-10-20T09:57:14+00:00
contrib: openjpeg: extract to the proper directory during UNPACK

- - - - -


30 changed files:

- contrib/src/aom/rules.mak
- contrib/src/chromaprint/rules.mak
- contrib/src/ebml/rules.mak
- contrib/src/flac/rules.mak
- − contrib/src/fluidlite/add-pic.diff
- contrib/src/fluidlite/rules.mak
- contrib/src/glew/rules.mak
- contrib/src/glslang/rules.mak
- contrib/src/gme/rules.mak
- contrib/src/jpeg/rules.mak
- contrib/src/libaribcaption/rules.mak
- contrib/src/libebur128/rules.mak
- contrib/src/libxml2/rules.mak
- contrib/src/main.mak
- contrib/src/matroska/rules.mak
- contrib/src/mpcdec/rules.mak
- contrib/src/mysofa/rules.mak
- contrib/src/nfs/rules.mak
- contrib/src/openjpeg/SHA512SUMS
- − contrib/src/openjpeg/pic.patch
- contrib/src/openjpeg/rules.mak
- contrib/src/opus/rules.mak
- contrib/src/png/rules.mak
- contrib/src/soxr/rules.mak
- contrib/src/spatialaudio/rules.mak
- contrib/src/srt/rules.mak
- contrib/src/taglib/rules.mak
- contrib/src/vulkan-headers/rules.mak
- contrib/src/vulkan-loader/rules.mak
- contrib/src/x265/rules.mak


Changes:

=====================================
contrib/src/aom/rules.mak
=====================================
@@ -78,7 +78,7 @@ endif
 .aom: aom toolchain.cmake
 	rm -rf $(PREFIX)/include/aom
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(AOM_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(AOM_CONF)
 	+$(CMAKEBUILD)
 	$(call pkg_static,"$(BUILD_DIRUNPACK)/aom.pc")
 	$(CMAKEINSTALL)


=====================================
contrib/src/chromaprint/rules.mak
=====================================
@@ -23,7 +23,7 @@ DEPS_chromaprint = ffmpeg $(DEPS_ffmpeg)
 
 .chromaprint: chromaprint toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE)
+	$(HOSTVARS) $(CMAKE_PIC)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/ebml/rules.mak
=====================================
@@ -18,7 +18,7 @@ ebml: libebml-$(EBML_VERSION).tar.xz .sum-ebml
 
 .ebml: ebml toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE)
+	$(HOSTVARS) $(CMAKE_PIC)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/flac/rules.mak
=====================================
@@ -42,7 +42,7 @@ DEPS_flac = ogg $(DEPS_ogg)
 
 .flac: flac toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(FLAC_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(FLAC_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/fluidlite/add-pic.diff deleted
=====================================
@@ -1,11 +0,0 @@
---- ./CMakeLists.txt.orig	2019-10-11 19:18:01.000000000 +0200
-+++ ./CMakeLists.txt	2019-10-11 19:18:04.000000000 +0200
-@@ -4,6 +4,8 @@ include(FindPkgConfig)
- 
- project(fluidlite)
- 
-+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-+
- list(APPEND HEADERS
-     include/fluidlite.h
-     )


=====================================
contrib/src/fluidlite/rules.mak
=====================================
@@ -22,14 +22,13 @@ DEPS_fluidlite = ogg $(DEPS_ogg)
 
 fluidlite: fluidlite-$(FLUID_HASH).tar.xz .sum-fluidlite
 	$(UNPACK)
-	$(APPLY) $(SRC)/fluidlite/add-pic.diff
 	$(MOVE)
 
 FLUIDLITE_CONF := -DFLUIDLITE_BUILD_SHARED=OFF
 
 .fluidlite: fluidlite toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(FLUIDLITE_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(FLUIDLITE_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/glew/rules.mak
=====================================
@@ -18,7 +18,7 @@ glew: glew-$(GLEW_VERSION).tgz .sum-glew
 
 .glew: glew toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) -S $</build/cmake
+	$(HOSTVARS) $(CMAKE_PIC) -S $</build/cmake
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/glslang/rules.mak
=====================================
@@ -31,7 +31,7 @@ GLSLANG_CONF := -DENABLE_GLSLANG_BINARIES=OFF -DENABLE_CTEST=OFF
 
 .glslang: glslang toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) CXXFLAGS="$(CXXFLAGS) -DYYDEBUG=0" $(CMAKE) $(GLSLANG_CONF)
+	$(HOSTVARS) CXXFLAGS="$(CXXFLAGS) -DYYDEBUG=0" $(CMAKE_PIC) $(GLSLANG_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/gme/rules.mak
=====================================
@@ -25,7 +25,7 @@ GME_CONF := -DENABLE_UBSAN=OFF
 
 .gme: game-music-emu toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(GME_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(GME_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/jpeg/rules.mak
=====================================
@@ -13,14 +13,10 @@ jpeg: libjpeg-turbo-$(JPEG_VERSION).tar.gz .sum-jpeg
 	$(MOVE)
 
 JPEG_CONF:= -DENABLE_SHARED=OFF -DWITH_TURBOJPEG=OFF
-ifndef HAVE_WIN32
-# this should probably be a global setting for CMake targets
-JPEG_CONF += -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
-endif
 
 .jpeg: jpeg toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(JPEG_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(JPEG_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/libaribcaption/rules.mak
=====================================
@@ -57,7 +57,7 @@ endif
 
 .libaribcaption: libaribcaption toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(LIBARIBCC_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(LIBARIBCC_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/libebur128/rules.mak
=====================================
@@ -22,7 +22,7 @@ LIBEBUR128_CONF := -DENABLE_INTERNAL_QUEUE_H=TRUE
 
 .libebur128: libebur128 toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(LIBEBUR128_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(LIBEBUR128_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/libxml2/rules.mak
=====================================
@@ -54,7 +54,7 @@ endif
 
 .libxml2: libxml2 toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(LIBXML2_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(LIBXML2_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/main.mak
=====================================
@@ -470,6 +470,8 @@ ifeq ($(V),1)
 CMAKE += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
 endif
 
+CMAKE_PIC = $(CMAKE) -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+
 MESONFLAGS = $(BUILD_DIR) $< --default-library static --prefix "$(PREFIX)" \
 	--backend ninja -Dlibdir=lib
 ifndef WITH_OPTIMIZATION


=====================================
contrib/src/matroska/rules.mak
=====================================
@@ -23,7 +23,7 @@ matroska: libmatroska-$(MATROSKA_VERSION).tar.xz .sum-matroska
 
 .matroska: matroska toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE)
+	$(HOSTVARS) $(CMAKE_PIC)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/mpcdec/rules.mak
=====================================
@@ -36,7 +36,7 @@ musepack: musepack_src_r$(MUSE_REV).tar.gz .sum-mpcdec
 
 .mpcdec: musepack toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(MUSE_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(MUSE_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/mysofa/rules.mak
=====================================
@@ -27,7 +27,7 @@ MYSOFA_CONF := -DBUILD_TESTS=OFF
 
 .mysofa: mysofa toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(MYSOFA_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(MYSOFA_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/nfs/rules.mak
=====================================
@@ -19,7 +19,7 @@ nfs: libnfs-$(NFS_VERSION).tar.gz .sum-nfs
 
 .nfs: nfs toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE)
+	$(HOSTVARS) $(CMAKE_PIC)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/openjpeg/SHA512SUMS
=====================================
@@ -1 +1 @@
-08975a2dd79f1e29fd1824249a5fbe66026640ed787b3a3aa8807c2c69f994240ff33e2132f8bf15bbc2202bef7001f98e42d487231d4eebc8e503538658049a  openjpeg-v2.5.0.tar.gz
+08975a2dd79f1e29fd1824249a5fbe66026640ed787b3a3aa8807c2c69f994240ff33e2132f8bf15bbc2202bef7001f98e42d487231d4eebc8e503538658049a  openjpeg-2.5.0.tar.gz


=====================================
contrib/src/openjpeg/pic.patch deleted
=====================================
@@ -1,10 +0,0 @@
---- openjpeg/src/lib/openjp2/CMakeLists.txt.ORIG	2017-12-06 00:07:11.830711871 -0500
-+++ openjpeg/src/lib/openjp2/CMakeLists.txt	2017-12-06 00:11:45.359362244 -0500
-@@ -1,5 +1,7 @@
- include_regular_expression("^.*$")
- 
-+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-+
- #
- install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
-  DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)


=====================================
contrib/src/openjpeg/rules.mak
=====================================
@@ -7,15 +7,13 @@ ifdef HAVE_WIN32
 DEPS_openjpeg += winpthreads $(DEPS_winpthreads)
 endif
 
-$(TARBALLS)/openjpeg-v$(OPENJPEG_VERSION).tar.gz:
+$(TARBALLS)/openjpeg-$(OPENJPEG_VERSION).tar.gz:
 	$(call download_pkg,$(OPENJPEG_URL),openjpeg)
 
-.sum-openjpeg: openjpeg-v$(OPENJPEG_VERSION).tar.gz
+.sum-openjpeg: openjpeg-$(OPENJPEG_VERSION).tar.gz
 
-openjpeg: openjpeg-v$(OPENJPEG_VERSION).tar.gz .sum-openjpeg
+openjpeg: openjpeg-$(OPENJPEG_VERSION).tar.gz .sum-openjpeg
 	$(UNPACK)
-	mv openjpeg-$(OPENJPEG_VERSION) openjpeg-v$(OPENJPEG_VERSION)
-	$(APPLY) $(SRC)/openjpeg/pic.patch
 	$(APPLY) $(SRC)/openjpeg/openjp2_pthread.patch
 	$(call pkg_static,"./src/lib/openjp2/libopenjp2.pc.cmake.in")
 	$(MOVE)
@@ -24,7 +22,7 @@ OPENJPEG_CONF := -DBUILD_PKGCONFIG_FILES=ON -DBUILD_CODEC:bool=OFF
 
 .openjpeg: openjpeg toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(OPENJPEG_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(OPENJPEG_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/opus/rules.mak
=====================================
@@ -29,7 +29,7 @@ endif
 
 .opus: opus toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(OPUS_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(OPUS_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/png/rules.mak
=====================================
@@ -41,7 +41,7 @@ endif
 
 .png: png toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(PNG_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(PNG_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/soxr/rules.mak
=====================================
@@ -42,7 +42,7 @@ SOXR_CONF := \
 
 .soxr: soxr toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(SOXR_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(SOXR_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/spatialaudio/rules.mak
=====================================
@@ -24,7 +24,7 @@ SPATIALAUDIO_CONF := -DMYSOFA_ROOT_DIR=$(PREFIX) -DHAVE_MIT_HRTF=OFF
 
 .spatialaudio: spatialaudio toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE) $(SPATIALAUDIO_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(SPATIALAUDIO_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/srt/rules.mak
=====================================
@@ -33,7 +33,7 @@ SRT_CONF := -DENABLE_SHARED=OFF -DUSE_ENCLIB=gnutls -DENABLE_CXX11=OFF -DENABLE_
 
 .srt: srt toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(SRT_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(SRT_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/taglib/rules.mak
=====================================
@@ -23,7 +23,7 @@ TAGLIB_CONF := -DBUILD_BINDINGS=OFF
 
 .taglib: taglib toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) $(TAGLIB_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) $(TAGLIB_CONF)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/vulkan-headers/rules.mak
=====================================
@@ -14,7 +14,7 @@ vulkan-headers: Vulkan-Headers-$(VULKAN_HEADERS_VERSION).tar.gz .sum-vulkan-head
 
 .vulkan-headers: vulkan-headers toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS) $(CMAKE)
+	$(HOSTVARS) $(CMAKE_PIC)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/vulkan-loader/rules.mak
=====================================
@@ -55,7 +55,7 @@ VULKAN_LOADER_ENV_CONF = \
 
 .vulkan-loader: vulkan-loader toolchain.cmake
 	$(CMAKECLEAN)
-	$(VULKAN_LOADER_ENV_CONF) $(HOSTVARS) $(CMAKE) $(VULKAN_LOADER_CONF)
+	$(VULKAN_LOADER_ENV_CONF) $(HOSTVARS) $(CMAKE_PIC) $(VULKAN_LOADER_CONF)
 	+$(CMAKEBUILD)
 
 ifdef HAVE_WIN32


=====================================
contrib/src/x265/rules.mak
=====================================
@@ -40,7 +40,7 @@ X265_CONF := -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
 .x265: x265 toolchain.cmake
 	$(REQUIRE_GPL)
 	$(CMAKECLEAN)
-	$(HOSTVARS_PIC) $(CMAKE) -S $</source $(X265_CONF)
+	$(HOSTVARS) $(CMAKE_PIC) -S $</source $(X265_CONF)
 	+$(CMAKEBUILD)
 	sed -e s/'[^ ]*clang_rt[^ ]*'//g -i.orig "$(BUILD_DIR)/x265.pc"
 	$(CMAKEINSTALL)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8da73edae52ff99e4cc450c162d964cfd50820ea...c3d55dc14495a338906bca7602581f2b62b8ed50

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8da73edae52ff99e4cc450c162d964cfd50820ea...c3d55dc14495a338906bca7602581f2b62b8ed50
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list