[Bf-blender-cvs] [ef268c78933] master: Build: Fix build of library dependencies on Linux aarch64

Patrick Mours noreply at git.blender.org
Thu Jun 30 16:50:26 CEST 2022


Commit: ef268c78933079137288e326704431432adf9ad9
Author: Patrick Mours
Date:   Thu Jun 30 16:44:38 2022 +0200
Branches: master
https://developer.blender.org/rBef268c78933079137288e326704431432adf9ad9

Build: Fix build of library dependencies on Linux aarch64

rBb9c37608a9e959a896f5358d4ab3d3d001a70833 moved evaluation of
`versions.cmake` before `options.cmake`, as a result of which
`BLENDER_PLATFORM_ARM` was no longer defined in `versions.cmake`,
causing it to choose the wrong OpenSSL version for aarch64. This
reverts that. Also fixes a compiler crash when building flex with some
glibc versions.

Differential Revision: https://developer.blender.org/D15319

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

M	build_files/build_environment/CMakeLists.txt
M	build_files/build_environment/cmake/flex.cmake
M	build_files/build_environment/cmake/ispc.cmake
A	build_files/build_environment/patches/flex.diff

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

diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index a9ff48b2a9b..e0350901cd0 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -29,8 +29,9 @@ cmake_minimum_required(VERSION 3.5)
 
 include(ExternalProject)
 include(cmake/check_software.cmake)
-include(cmake/versions.cmake)
 include(cmake/options.cmake)
+# versions.cmake needs to be included after options.cmake due to the BLENDER_PLATFORM_ARM variable being needed.
+include(cmake/versions.cmake)
 include(cmake/boost_build_options.cmake)
 include(cmake/download.cmake)
 include(cmake/macros.cmake)
diff --git a/build_files/build_environment/cmake/flex.cmake b/build_files/build_environment/cmake/flex.cmake
index 2b04c8d5d68..99233adbcdc 100644
--- a/build_files/build_environment/cmake/flex.cmake
+++ b/build_files/build_environment/cmake/flex.cmake
@@ -5,6 +5,8 @@ ExternalProject_Add(external_flex
   URL_HASH ${FLEX_HASH_TYPE}=${FLEX_HASH}
   DOWNLOAD_DIR ${DOWNLOAD_DIR}
   PREFIX ${BUILD_DIR}/flex
+  # This patch fixes build with some versions of glibc (https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380)
+  PATCH_COMMAND ${PATCH_CMD} -d ${BUILD_DIR}/flex/src/external_flex < ${PATCH_DIR}/flex.diff
   CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
   BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make -j${MAKE_THREADS}
   INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make install
diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake
index 86dc1d9efa8..c2dbedca55f 100644
--- a/build_files/build_environment/cmake/ispc.cmake
+++ b/build_files/build_environment/cmake/ispc.cmake
@@ -28,7 +28,7 @@ elseif(UNIX)
   set(ISPC_EXTRA_ARGS_UNIX
     -DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
     -DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
-    -DARM_ENABLED=Off
+    -DARM_ENABLED=${BLENDER_PLATFORM_ARM}
     -DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
   )
 endif()
diff --git a/build_files/build_environment/patches/flex.diff b/build_files/build_environment/patches/flex.diff
new file mode 100644
index 00000000000..d3f9e8b0a66
--- /dev/null
+++ b/build_files/build_environment/patches/flex.diff
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+index c6f12d644..3c977a4e3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,8 +25,10 @@
+ # autoconf requirements and initialization
+ 
+ AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help at lists.sourceforge.net],[flex])
++AC_PREREQ([2.60])
+ AC_CONFIG_SRCDIR([src/scan.l])
+ AC_CONFIG_AUX_DIR([build-aux])
++AC_USE_SYSTEM_EXTENSIONS
+ LT_INIT
+ AM_INIT_AUTOMAKE([1.15 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
+ AC_CONFIG_HEADER([src/config.h])



More information about the Bf-blender-cvs mailing list