summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-04-25 11:48:39 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-01-19 16:08:54 +0100
commit0d44cebc2e66df070444dd7cdc7b00014141b07a (patch)
tree044e97901086eb508dd41c5f60bd5d1395b21501
parent2a46c3cb25e802d9a50865c0ea21baee1d2c5bbf (diff)
Cut down on -pthread/-lpthread proliferation
Building against libstdc++ effectively always requires -pthread anyway (as various standard C++ headers require it, see the comment added to solenv/gbuild/platform/unxgcc.mk), so many explicit uses of -pthread/-lpthread can be removed. Doing a (partial) test build on Linux with Clang -stdlib=libc++ suggests that libc++ indeed doesn't need -pthread as libstdc++ does. The remaining uses of -pthread/-lpthread are mostly in configure.ac for the various BSDs (which somebody else might want to clean up now), and related to external projects. I tried to be careful to remove -pthread/-lpthread from makefiles only when C++ object files are involved (so -pthread will now be included on the link command line by default). Reviewed-on: https://gerrit.libreoffice.org/71291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit b1141fa61073b3f24e1a3574afa55a954e5a153d) Change-Id: I936e082839cb9a434bd273ce5a1f187a4245dfa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95130 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit fda7f14cb5e4d5f93b2ee706b7ec6ad35a988ae5)
-rw-r--r--connectivity/Library_postgresql-sdbc-impl.mk1
-rw-r--r--desktop/CppunitTest_desktop_app.mk1
-rw-r--r--desktop/Library_crashreport.mk1
-rw-r--r--desktop/Library_sofficeapp.mk3
-rw-r--r--external/clucene/Library_clucene.mk1
-rw-r--r--external/pdfium/Library_pdfium.mk1
-rw-r--r--jurt/Library_jpipe.mk4
-rw-r--r--libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk1
-rw-r--r--libreofficekit/Executable_gtktiledviewer.mk1
-rw-r--r--libreofficekit/Executable_tilebench.mk1
-rw-r--r--onlineupdate/Executable_test_updater_dialog.mk1
-rw-r--r--onlineupdate/Executable_updater.mk1
-rw-r--r--sal/Library_sal.mk3
-rw-r--r--sc/CppunitTest_sc_ucalc.mk6
-rw-r--r--sc/Library_sc.mk6
-rw-r--r--smoketest/Executable_libtest.mk1
-rw-r--r--solenv/gbuild/platform/linux.mk2
-rw-r--r--solenv/gbuild/platform/unxgcc.mk10
-rw-r--r--svx/Executable_gengal.mk2
-rw-r--r--vcl/Executable_icontest.mk1
-rw-r--r--vcl/Executable_lo_kde5filepicker.mk1
-rw-r--r--vcl/Executable_mtfdemo.mk1
-rw-r--r--vcl/Executable_ui-previewer.mk1
-rw-r--r--vcl/Executable_vcldemo.mk1
-rw-r--r--vcl/Executable_visualbackendtest.mk1
-rw-r--r--vcl/Library_desktop_detector.mk1
-rw-r--r--vcl/Library_vcl.mk6
-rw-r--r--vcl/Library_vclplug_gen.mk1
-rw-r--r--vcl/Library_vclplug_gtk.mk1
-rw-r--r--vcl/Library_vclplug_gtk3.mk1
-rw-r--r--vcl/Library_vclplug_gtk3_kde5.mk1
-rw-r--r--vcl/Library_vclplug_kde5.mk1
-rw-r--r--vcl/Library_vclplug_qt5.mk1
-rw-r--r--vcl/StaticLibrary_glxtest.mk1
34 files changed, 10 insertions, 57 deletions
diff --git a/connectivity/Library_postgresql-sdbc-impl.mk b/connectivity/Library_postgresql-sdbc-impl.mk
index 53cebd01a242..80c746f802dc 100644
--- a/connectivity/Library_postgresql-sdbc-impl.mk
+++ b/connectivity/Library_postgresql-sdbc-impl.mk
@@ -61,7 +61,6 @@ $(eval $(call gb_Library_add_libs,postgresql-sdbc-impl,\
$(if $(WITH_GSSAPI),$(GSSAPI_LIBS)) \
$(if $(WITH_KRB5),$(KRB5_LIBS)) \
$(if $(filter-out MACOSX,$(OS)),-ldl) \
- $(if $(filter-out MACOSX,$(OS)),-lpthread) \
))
endif
diff --git a/desktop/CppunitTest_desktop_app.mk b/desktop/CppunitTest_desktop_app.mk
index cd698aceee5e..adb57add6e7a 100644
--- a/desktop/CppunitTest_desktop_app.mk
+++ b/desktop/CppunitTest_desktop_app.mk
@@ -66,7 +66,6 @@ endif
$(eval $(call gb_CppunitTest_add_libs,desktop_app,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
endif
diff --git a/desktop/Library_crashreport.mk b/desktop/Library_crashreport.mk
index 3b9d6dd34fdc..a2cef785f370 100644
--- a/desktop/Library_crashreport.mk
+++ b/desktop/Library_crashreport.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_add_defs,crashreport,\
$(eval $(call gb_Library_add_libs,crashreport,\
$(if $(filter LINUX %BSD SOLARIS, $(OS)), \
$(DLOPEN_LIBS) \
- -lpthread \
) \
))
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 288e26d47726..29deeb707e3a 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_Library_set_include,sofficeapp,\
$(eval $(call gb_Library_add_libs,sofficeapp,\
$(if $(filter LINUX %BSD SOLARIS, $(OS)), \
$(DLOPEN_LIBS) \
- -lpthread \
) \
))
@@ -126,7 +125,6 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Library_add_libs,sofficeapp,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
))
else
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
@@ -138,7 +136,6 @@ endif
$(eval $(call gb_Library_add_libs,sofficeapp,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
endif
diff --git a/external/clucene/Library_clucene.mk b/external/clucene/Library_clucene.mk
index abc14d903f46..f04961398797 100644
--- a/external/clucene/Library_clucene.mk
+++ b/external/clucene/Library_clucene.mk
@@ -48,7 +48,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,clucene,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index 0019535857a6..1f90b2b3b415 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -559,7 +559,6 @@ ifneq (,$(filter LINUX ANDROID,$(OS)))
$(eval $(call gb_Library_add_libs,pdfium,\
-ldl \
-lrt \
- -lpthread \
))
$(eval $(call gb_Library_use_external,pdfium,freetype))
diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk
index 5759baed5175..204da654c553 100644
--- a/jurt/Library_jpipe.mk
+++ b/jurt/Library_jpipe.mk
@@ -74,10 +74,6 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,jpipe, \
))
endif
-$(eval $(call gb_Library_add_libs,jpipe, \
- $(if $(filter-out $(OS),ANDROID),-lpthread) \
-))
-
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
gb_CC := $(filter-out -fsanitize%,$(gb_CC))
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
diff --git a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
index d58923f45194..da3be044e853 100644
--- a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
+++ b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
@@ -28,7 +28,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_CppunitTest_add_libs,libreofficekit_tiledrendering,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/libreofficekit/Executable_gtktiledviewer.mk b/libreofficekit/Executable_gtktiledviewer.mk
index 5dd89e6065f6..99ef51af8975 100644
--- a/libreofficekit/Executable_gtktiledviewer.mk
+++ b/libreofficekit/Executable_gtktiledviewer.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_Executable_use_libraries,gtktiledviewer,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,gtktiledviewer,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
))
endif
diff --git a/libreofficekit/Executable_tilebench.mk b/libreofficekit/Executable_tilebench.mk
index 9d8b2a134f99..0b512a83e466 100644
--- a/libreofficekit/Executable_tilebench.mk
+++ b/libreofficekit/Executable_tilebench.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_Executable_use_libraries,tilebench,\
$(eval $(call gb_Executable_add_libs,tilebench,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
))
$(eval $(call gb_Executable_add_exception_objects,tilebench,\
diff --git a/onlineupdate/Executable_test_updater_dialog.mk b/onlineupdate/Executable_test_updater_dialog.mk
index 92e70dfae337..cae8e02df141 100644
--- a/onlineupdate/Executable_test_updater_dialog.mk
+++ b/onlineupdate/Executable_test_updater_dialog.mk
@@ -61,7 +61,6 @@ $(eval $(call gb_Executable_add_libs,test_updater_dialog,\
-lXrender \
-lSM \
-lICE \
- -lpthread \
))
endif
diff --git a/onlineupdate/Executable_updater.mk b/onlineupdate/Executable_updater.mk
index a4ceacee6bc1..5f83c13eb9ec 100644
--- a/onlineupdate/Executable_updater.mk
+++ b/onlineupdate/Executable_updater.mk
@@ -71,7 +71,6 @@ $(eval $(call gb_Executable_add_libs,updater,\
-lXrender \
-lSM \
-lICE \
- -lpthread \
))
endif
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 42e9287f30ac..33ba836d6066 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -57,9 +57,6 @@ $(eval $(call gb_Library_use_system_win32_libs,sal,\
))
$(eval $(call gb_Library_add_libs,sal,\
- $(if $(filter-out ANDROID HAIKU WNT,$(OS)), \
- -lpthread \
- ) \
$(if $(filter LINUX,$(OS)), \
-ldl \
-lrt \
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 48fb912c4335..4cad9547f3e6 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -114,12 +114,6 @@ $(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
))
endif
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
- -lpthread \
-))
-endif
-
$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
# vim: set noet sw=4 ts=4:
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 00db6e4a44c0..0ce26b5ba699 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -710,12 +710,6 @@ $(eval $(call gb_Library_add_libs,sc,\
))
endif
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Library_add_libs,sc,\
- -lpthread \
-))
-endif
-
$(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc))
$(eval $(call gb_SdiTarget_set_include,sc/sdi/scslots,\
diff --git a/smoketest/Executable_libtest.mk b/smoketest/Executable_libtest.mk
index e16c95073976..c1e33d35e10e 100644
--- a/smoketest/Executable_libtest.mk
+++ b/smoketest/Executable_libtest.mk
@@ -16,7 +16,6 @@ $(eval $(call gb_Executable_set_include,libtest,\
ifeq ($(OS),LINUX)
$(eval $(call gb_Executable_add_libs,libtest,\
-ldl \
- -pthread \
))
endif
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index 727418b8ea61..77d4dbe679e8 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -18,7 +18,7 @@ gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs)
include $(GBUILDDIR)/platform/unxgcc.mk
ifeq ($(DISABLE_DYNLOADING),TRUE)
-gb_STDLIBS := -lpthread -ldl
+gb_STDLIBS := -ldl
endif
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 8505f9638a19..a6a361e6ee53 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -42,12 +42,20 @@ gb_CFLAGS := \
-Wdeclaration-after-statement \
-Wshadow \
+# At least libstdc++ (which is approximated here with !HAVE_LIBCXX) needs -pthread when including
+# various C++ headers like <thread>, see <https://gcc.gnu.org/onlinedocs/gcc-8.3.0/libstdc++/manual/
+# manual/using.html#manual.intro.using.flags>:
+ifeq ($(HAVE_LIBCXX),)
+gb_CXX_LINKFLAGS := -pthread
+endif
+
gb_CXXFLAGS := \
$(gb_CXXFLAGS_COMMON) \
-fPIC \
-Wshadow \
-Woverloaded-virtual \
$(CXXFLAGS_CXX11) \
+ $(gb_CXX_LINKFLAGS) \
# enable debug STL
@@ -120,7 +128,7 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
# contains .c sources:
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
- $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(gb_CXX),$(gb_CC)) \
+ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(gb_CXX) $(gb_CXX_LINKFLAGS),$(gb_CC)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(gb_LTOFLAGS) \
$(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \
diff --git a/svx/Executable_gengal.mk b/svx/Executable_gengal.mk
index 844ab0b45e16..7316f6de2a20 100644
--- a/svx/Executable_gengal.mk
+++ b/svx/Executable_gengal.mk
@@ -64,13 +64,11 @@ endif
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Executable_add_libs,gengal,\
$(DLOPEN_LIBS) \
- -lpthread \
))
else
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,gengal,\
$(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Executable_icontest.mk b/vcl/Executable_icontest.mk
index 8c917b71cd0e..223cfa840f9b 100644
--- a/vcl/Executable_icontest.mk
+++ b/vcl/Executable_icontest.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_Executable_use_static_libraries,icontest,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,icontest,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Executable_lo_kde5filepicker.mk b/vcl/Executable_lo_kde5filepicker.mk
index 2eee2cd8711b..f3e940953601 100644
--- a/vcl/Executable_lo_kde5filepicker.mk
+++ b/vcl/Executable_lo_kde5filepicker.mk
@@ -92,7 +92,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Executable_add_libs,lo_kde5filepicker,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Executable_mtfdemo.mk b/vcl/Executable_mtfdemo.mk
index d637439a17ba..5c4c45165535 100644
--- a/vcl/Executable_mtfdemo.mk
+++ b/vcl/Executable_mtfdemo.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_Executable_use_static_libraries,mtfdemo,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,mtfdemo,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Executable_ui-previewer.mk b/vcl/Executable_ui-previewer.mk
index 0925e575ee67..cf6a2d3de6c7 100644
--- a/vcl/Executable_ui-previewer.mk
+++ b/vcl/Executable_ui-previewer.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_Executable_add_exception_objects,ui-previewer,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,ui-previewer,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Executable_vcldemo.mk b/vcl/Executable_vcldemo.mk
index c06725c297cf..35fcd27ffd51 100644
--- a/vcl/Executable_vcldemo.mk
+++ b/vcl/Executable_vcldemo.mk
@@ -53,7 +53,6 @@ $(eval $(call gb_Executable_use_static_libraries,vcldemo,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,vcldemo,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Executable_visualbackendtest.mk b/vcl/Executable_visualbackendtest.mk
index 87044535f03e..41c641a5ff14 100644
--- a/vcl/Executable_visualbackendtest.mk
+++ b/vcl/Executable_visualbackendtest.mk
@@ -45,7 +45,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Executable_add_libs,visualbackendtest,\
-lm \
-ldl \
- -lpthread \
-lX11 \
))
diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk
index 3edd0015e243..f28ff9078e64 100644
--- a/vcl/Library_desktop_detector.mk
+++ b/vcl/Library_desktop_detector.mk
@@ -66,7 +66,6 @@ $(eval $(call gb_Library_add_exception_objects,desktop_detector,\
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,desktop_detector,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
))
endif
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ae7622dacae3..5f8bcd3af059 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -624,11 +624,6 @@ $(eval $(call gb_Library_use_externals,vcl,\
freetype \
fontconfig \
))
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Library_add_libs,vcl,\
- -lpthread \
-))
-endif
else
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/opengl/DeviceInfo \
@@ -649,7 +644,6 @@ else
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,vcl,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
-lXext \
))
diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk
index 0e1c39c15766..ba02a3f57ba7 100644
--- a/vcl/Library_vclplug_gen.mk
+++ b/vcl/Library_vclplug_gen.mk
@@ -147,7 +147,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_gen,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk
index 67d405d4c8fa..360eabf46020 100644
--- a/vcl/Library_vclplug_gtk.mk
+++ b/vcl/Library_vclplug_gtk.mk
@@ -126,7 +126,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_gtk,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk
index 5ecf70bb4d0f..867903fd4f8e 100644
--- a/vcl/Library_vclplug_gtk3.mk
+++ b/vcl/Library_vclplug_gtk3.mk
@@ -119,7 +119,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_gtk3,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Library_vclplug_gtk3_kde5.mk b/vcl/Library_vclplug_gtk3_kde5.mk
index e2e7bf8a9616..c96cb672db2d 100644
--- a/vcl/Library_vclplug_gtk3_kde5.mk
+++ b/vcl/Library_vclplug_gtk3_kde5.mk
@@ -123,7 +123,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_gtk3_kde5,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index a1816c6ec143..e08d8fadae75 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -99,7 +99,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_kde5,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 5245d8a0149b..c4bc311fbcaf 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -102,7 +102,6 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_qt5,\
-lm \
-ldl \
- -lpthread \
))
endif
diff --git a/vcl/StaticLibrary_glxtest.mk b/vcl/StaticLibrary_glxtest.mk
index 227cbaa574c1..1a285875c828 100644
--- a/vcl/StaticLibrary_glxtest.mk
+++ b/vcl/StaticLibrary_glxtest.mk
@@ -31,7 +31,6 @@ $(eval $(call gb_StaticLibrary_use_api,glxtest,\
$(eval $(call gb_StaticLibrary_add_libs,glxtest,\
-lm $(DLOPEN_LIBS) \
- -lpthread \
-lX11 \
))