[vlc-commits] [Git][videolan/vlc][master] 3 commits: contrib: medialibrary: link with -latomic

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Fri Feb 4 19:56:05 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
b9026d79 by Rémi Denis-Courmont at 2022-02-04T16:04:41+00:00
contrib: medialibrary: link with -latomic

medialibrary uses atomics which may require libatomic depending on the
ABI. This is currently the case on Linux RISC-V. In principles, it
should be pulled as needed by `-pthread` which should be in LDFLAGS.
However:
1) The VLC build system passes `-pthread` in LIBADD instead of LDFLAGS.
2) GNU/libtool discards `-pthread` for CXX-tagged binaries.

This is essentially the same problem as with libupnp lacking
`-lpthread`. In this particular case, medialibrary.pc forces `-lpthread`
explicitly but lacks `-latomic`.

Fixes #26521.

- - - - -
4872e537 by Rémi Denis-Courmont at 2022-02-04T16:04:41+00:00
contrib: upnp: add -lpthread on Linux

-pthread does not work in with CXX-tagged libtool invocation.

- - - - -
94ec8d99 by Rémi Denis-Courmont at 2022-02-04T16:04:41+00:00
Revert "upnp: force -lpthread"

This reverts commit 21d696e5df185e4ca3b9c5ecd606951462da2b9f.

- - - - -


3 changed files:

- contrib/src/medialibrary/rules.mak
- contrib/src/upnp/rules.mak
- modules/services_discovery/Makefile.am


Changes:

=====================================
contrib/src/medialibrary/rules.mak
=====================================
@@ -22,6 +22,13 @@ medialibrary: medialibrary-$(MEDIALIBRARY_VERSION).tar.xz .sum-medialibrary
 
 .medialibrary: medialibrary
 	cd $< && $(HOSTVARS_MESON) $(MESON) -Dlibvlc=disabled build
+	ninja -C $</build
+ifdef HAVE_LINUX
+ifndef HAVE_ANDROID
+	sed -e 's,^Libs\(.*\)-pthread,Libs\1-pthread -latomic,' \
+		-i $</build/meson-private/medialibrary.pc
+endif
+endif
 	cd $< && cd build && ninja install
 	touch $@
 


=====================================
contrib/src/upnp/rules.mak
=====================================
@@ -55,5 +55,11 @@ endif
 .upnp: upnp
 	$(RECONF)
 	cd $< && $(HOSTVARS) CFLAGS="$(UPNP_CFLAGS)" CXXFLAGS="$(UPNP_CXXFLAGS)" ./configure --disable-samples --without-documentation $(CONFIGURE_ARGS) $(HOSTCONF)
+ifdef HAVE_LINUX
+ifndef HAVE_ANDROID
+	sed -e 's,^Libs\(.*\)-pthread,Libs\1-pthread -lpthread,' \
+		-i $</libupnp.pc
+endif
+endif
 	cd $< && $(MAKE) install
 	touch $@


=====================================
modules/services_discovery/Makefile.am
=====================================
@@ -40,11 +40,6 @@ sd_LTLIBRARIES += $(LTLIBupnp)
 if HAVE_OSX
 libupnp_plugin_la_LDFLAGS += -Wl,-framework,CoreFoundation,-framework,SystemConfiguration
 endif
-if HAVE_LINUX
-if !HAVE_ANDROID
-libupnp_plugin_la_LIBADD += -lpthread
-endif
-endif
 
 libpulselist_plugin_la_SOURCES = services_discovery/pulse.c
 libpulselist_plugin_la_CFLAGS = $(AM_CFLAGS) $(PULSE_CFLAGS)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a86a62c9351686ed3b9930063adc6ebc199c4ab9...94ec8d99386c3e3daa84404d264282bdd264a255

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




More information about the vlc-commits mailing list