From: Shaun Tancheff Date: Wed, 25 May 2022 16:46:50 +0000 (+0700) Subject: LU-15652 build: On Debian detect -common kernel headers X-Git-Tag: 2.15.51~81 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=85a6eebeca1e1efb5bb9c3e737ab1978f8aca741 LU-15652 build: On Debian detect -common kernel headers Check for a matching /usr/src/linux-headers--common/ and update the --with-linux argument accordingly. Also move LC_GLIBC_SUPPORT_COPY_FILE_RANGE outside of utils as this also breaks the dkms build on Debian with 'static' follows 'non static' declairation of copy_file_range. Fixes: e6d1968fbbad ("LU-13903 build: Move GLIBC/openssl checks to where needed") HPE-bug-id: LUS-10826 Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: I6e4f0b27eba6c5b07cda14f064e57aa9c93ae3cc Reviewed-on: https://review.whamcloud.com/46836 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Jian Yu Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index e88c54b..7a4c98d 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -262,7 +262,6 @@ AC_ARG_WITH([linux], DEFAULT_LINUX_OBJ=$LINUX], [LINUX=$DEFAULT_LINUX]) AC_MSG_RESULT([$LINUX]) -AC_SUBST(LINUX) # -------- check for linux -------- LB_CHECK_FILE([$LINUX], [], @@ -276,8 +275,21 @@ AC_ARG_WITH([linux-obj], [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])], [LINUX_OBJ=$DEFAULT_LINUX_OBJ]) AC_MSG_RESULT([$LINUX_OBJ]) -AC_SUBST(LINUX_OBJ) +## -------- with linux should point to -common on Debian +AS_IF([test ${LINUX} == ${LINUX_OBJ} -a ${LINUX} == $(realpath ${LINUX})],[ + this_arch=$(realpath ${LINUX} | sed 's/-/\n/g' | tail -1) + linux_headers_common=$(realpath ${LINUX}|sed "s/-${this_arch}\$/-common/g") + AS_IF([test "${this_arch}" != common],[ + _cah="${linux_headers_common}/include/linux/compiler_attributes.h" + _cgh="${linux_headers_common}/include/linux/compiler-gcc.h" + AS_IF([test -f "${_cah}" -o -f "${_cgh}"],[ + AC_MSG_WARN([Setting LINUX to ${linux_headers_common} was ${LINUX}]) + LINUX=${linux_headers_common}]) + ]) + ]) +AC_SUBST(LINUX) +AC_SUBST(LINUX_OBJ) # -------- check for .config -------- AC_ARG_WITH([linux-config], [AS_HELP_STRING([--with-linux-config=path], diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 2f2ab2c..7a764fc 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -676,12 +676,12 @@ LC_CONFIG_CLIENT LB_CONFIG_MPITESTS LB_CONFIG_SERVERS LC_CONFIG_CRYPTO +LC_GLIBC_SUPPORT_COPY_FILE_RANGE # Tests depends from utils (multiop from liblustreapi) AS_IF([test "x$enable_utils" = xno], [enable_tests="no"]) AS_IF([test "x$enable_utils" = xyes], [ - LC_GLIBC_SUPPORT_COPY_FILE_RANGE LC_OPENSSL_SSK LC_OPENSSL_GETSEPOL LC_FID2PATH_ANON_UNION