[Bf-blender-cvs] [ead394996e8] tmp_libupdate_34: Stop statically linking libstdc++ on Linux

Brecht Van Lommel noreply at git.blender.org
Tue Aug 16 20:47:27 CEST 2022


Commit: ead394996e857ed9c82d70c704c14657de6a7558
Author: Brecht Van Lommel
Date:   Tue Aug 16 18:32:50 2022 +0200
Branches: tmp_libupdate_34
https://developer.blender.org/rBead394996e857ed9c82d70c704c14657de6a7558

Stop statically linking libstdc++ on Linux

With the addition of shared libraries this doesn't work anymore. The shared
libraries use dynamical linking, and having each library with their own static
copy seems problematic.

The use of this predates our switch to CentOS 7. I hope that there is just
no need for this anymore, but it's not entirely clear.

===================================================================

M	build_files/buildbot/config/blender_linux.cmake
M	build_files/cmake/platform/platform_apple.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	source/creator/CMakeLists.txt

===================================================================

diff --git a/build_files/buildbot/config/blender_linux.cmake b/build_files/buildbot/config/blender_linux.cmake
index bedeeb6a690..3f3695ed481 100644
--- a/build_files/buildbot/config/blender_linux.cmake
+++ b/build_files/buildbot/config/blender_linux.cmake
@@ -28,4 +28,4 @@ set(LIBDIR "${CMAKE_CURRENT_LIST_DIR}/../../../../lib/${LIBDIR_NAME}" CACHE STRI
 # Platform specific configuration, to ensure static linking against everything.
 
 # Additional linking libraries
-set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++ -no-pie"  CACHE STRING "" FORCE)
+set(CMAKE_EXE_LINKER_FLAGS   "-lrt -no-pie"  CACHE STRING "" FORCE)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 63990eaacd5..eae39b2580b 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -21,11 +21,11 @@ function(print_found_status
   endif()
 endfunction()
 
-# Utility to install shared libraries.
+# Utility to install precompiled shared libraries.
 macro(add_bundled_libraries library)
   if(EXISTS ${LIBDIR})
-    set(_library_dir ${LIBDIR}/${library})
-    file(GLOB _all_library_versions ${_library_dir}/lib/*\.dylib*)
+    set(_library_dir ${LIBDIR}/${library}/lib)
+    file(GLOB _all_library_versions ${_library_dir}/*\.dylib*)
     list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
     list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
     unset(_all_library_versions)
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 97c2663ecbd..43c9a2abbdd 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -68,10 +68,6 @@ if(EXISTS ${LIBDIR})
   set(CLANG_ROOT_DIR ${LIBDIR}/llvm)
 endif()
 
-if(WITH_STATIC_LIBS)
-  string(APPEND CMAKE_EXE_LINKER_FLAGS " -static-libstdc++")
-endif()
-
 # Wrapper to prefer static libraries
 macro(find_package_wrapper)
   if(WITH_STATIC_LIBS)
@@ -81,12 +77,11 @@ macro(find_package_wrapper)
   endif()
 endmacro()
 
-# Utility to install shared libraries, all that exist in the precompiled
-# library folder will be copied.
+# Utility to install precompiled shared libraries.
 macro(add_bundled_libraries library)
   if(EXISTS ${LIBDIR})
-    set(_library_dir ${LIBDIR}/${library})
-    file(GLOB _all_library_versions ${_library_dir}/lib/*\.so*)
+    set(_library_dir ${LIBDIR}/${library}/lib)
+    file(GLOB _all_library_versions ${_library_dir}/*\.so*)
     list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
     list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
     unset(_all_library_versions)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f1faeec8a53..54fc2d3b69e 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -603,7 +603,7 @@ if(UNIX AND NOT APPLE)
       # Precompiled libraries, copy over complete lib directory.
       install_dir(
         ${PYTHON_LIBPATH}
-        ${TARGETDIR_VER}/python/lib
+        ${TARGETDIR_VER}/python
       )
     else()
       # System libraries.



More information about the Bf-blender-cvs mailing list