[vlc-commits] [Git][videolan/vlc][master] 3 commits: libplacebo: remove dummy.cpp

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Sep 9 09:06:43 UTC 2022



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
cd6fd0c7 by Steve Lhomme at 2022-09-09T08:23:38+00:00
libplacebo: remove dummy.cpp

It is needed when libplacebo links with vulkan-loader.

We use the libplacebo link parameter from the pkg-config file.
The vulkan-loader link parameters are propagated through the Requires part
of the libplacebo.pc.
The vulkan dependency was added since https://code.videolan.org/videolan/libplacebo/-/commit/5e41228e76e1dec2f833fe948742ce45064f8097

And vulkan-loader generates the proper C++ runtime links since
https://github.com/KhronosGroup/Vulkan-Loader/commit/f61b89f46e388c9c3f22c265ae994bd7fb60bacc
That's since 1.1.77 from 2018.

- - - - -
29d48417 by Steve Lhomme at 2022-09-09T08:23:38+00:00
contrib: libplacebo: remove hack on the .pc file

That hack was introduced in 4e599bd5cbe4f28a65299b06abc0c748d335db05.
This has been fixed a long time ago. We require meson 0.56 which contains the
fix.

- - - - -
9dbbce4b by Steve Lhomme at 2022-09-09T08:23:38+00:00
contrib: libplacebo: force the C++ runtime linking not found in vulkan-loader

When we're not building vulkan-loader the .pc file may not be found at all or
it may contain the C++ runtime export. To properly use libplacebo from C code
we need to link with the C++ runtime of vulkan-loader.

It's not a good idea to rebuild vulkan-loader on behalf of the system which
contains it with its own settings. So we set the C++ runtime in the library
that uses it.

- - - - -


4 changed files:

- + contrib/src/libplacebo/0001-meson-add-the-CLANG-gcc-C-runtime-when-linking-with-.patch
- contrib/src/libplacebo/rules.mak
- modules/video_output/libplacebo/Makefile.am
- modules/video_output/vulkan/Makefile.am


Changes:

=====================================
contrib/src/libplacebo/0001-meson-add-the-CLANG-gcc-C-runtime-when-linking-with-.patch
=====================================
@@ -0,0 +1,42 @@
+From 45b4b27748dd8aa9e2bd63dc5060f92d45fc71a2 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Wed, 7 Sep 2022 14:30:55 +0200
+Subject: [PATCH] meson: add the CLANG/gcc C++ runtime when linking with vulkan
+ loader
+
+The Vulkan loader present on some Linux distro or Android don't export which
+C++ they are using. When using libplacebo from C code it's missing in the link
+parameters from libplacebo. So we do it on behalf of Vulkan loader.
+
+We suppose we're building with a compatible C++ compiler that was used to
+generate the vulkan loader.
+
+We can't detect the link flags exposed by vulkan with Meson so we assume it's
+never set.
+---
+ src/meson.build | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/meson.build b/src/meson.build
+index dd2f1fe..0f238bd 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -48,6 +48,15 @@ if not vulkan_headers.found() and not get_option('vulkan').disabled()
+   endif
+ endif
+ 
++# add the C++ runtime that vulkan needs but may not expose in its pkg-config
++if vulkan_headers.found()
++  if cxx.get_id() == 'clang'
++    build_deps += cxx.find_library('c++', required: true)
++  elif cxx.get_id() == 'gcc'
++    build_deps += cxx.find_library('stdc++', required: true)
++  endif
++endif
++
+ d3d11 = disabler()
+ d3d11_inc = ['d3d11_4.h', 'dxgi1_6.h']
+ d3d11_deps = [
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -41,14 +41,13 @@ ifdef HAVE_ANDROID
 	$(APPLY) $(SRC)/libplacebo/fix-android-build.patch
 endif
 	$(APPLY) $(SRC)/libplacebo/0001-Fix-incompatible-pointer-integer-conversion-errors-o.patch
+	$(APPLY) $(SRC)/libplacebo/0001-meson-add-the-CLANG-gcc-C-runtime-when-linking-with-.patch
 	$(MOVE)
 
 .libplacebo: libplacebo crossfile.meson
 	cd $< && rm -rf ./build
 	cd $< && $(HOSTVARS_MESON) $(MESON) $(PLACEBOCONF) build
 	cd $< && cd build && ninja install
-# Work-around messon issue https://github.com/mesonbuild/meson/issues/4091
-	sed -i.orig -e 's/Libs: \(.*\) -L$${libdir} -lplacebo/Libs: -L$${libdir} -lplacebo \1/g' $(PREFIX)/lib/pkgconfig/libplacebo.pc
 # Work-around for full paths to static libraries, which libtool does not like
 # See https://github.com/mesonbuild/meson/issues/5479
 	(cd $(UNPACK_DIR) && $(SRC_BUILT)/pkg-rewrite-absolute.py -i "$(PREFIX)/lib/pkgconfig/libplacebo.pc")


=====================================
modules/video_output/libplacebo/Makefile.am
=====================================
@@ -3,9 +3,6 @@
 LIBPLACEBO_COMMONSOURCES = video_output/libplacebo/utils.h \
 	video_output/libplacebo/instance.h
 
-# Trigger the c++ linker because of glslang dependency of libplacebo
-LIBPLACEBO_COMMONSOURCES += dummy.cpp
-
 libplacebo_utils_la_SOURCES = $(LIBPLACEBO_COMMONSOURCES) \
 			      video_output/libplacebo/utils.c
 libplacebo_utils_la_CFLAGS = $(AM_CFLAGS) $(LIBPLACEBO_CFLAGS)


=====================================
modules/video_output/vulkan/Makefile.am
=====================================
@@ -4,9 +4,6 @@
 VULKAN_COMMONSOURCES = video_output/vulkan/platform.c \
 	video_output/vulkan/platform.h
 
-# Trigger the c++ linker because of glslang dependency of libplacebo
-VULKAN_COMMONSOURCES += dummy.cpp
-
 VULKAN_COMMONCFLAGS = $(VULKAN_CFLAGS) $(LIBPLACEBO_CFLAGS)
 VULKAN_COMMONLIBS = $(VULKAN_LIBS) $(LIBPLACEBO_LIBS)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/75287e22c0c9b54d683837fe1815174807027d9a...9dbbce4b7d94556cfdd7f8a219d4a93ad90453b5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/75287e22c0c9b54d683837fe1815174807027d9a...9dbbce4b7d94556cfdd7f8a219d4a93ad90453b5
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