Configure target for clang thread safety checking (#2493)

This commit is contained in:
Andrew Gaul 2024-10-14 10:19:03 +09:00 committed by GitHub
parent 3ba8c2a139
commit 000273a8de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View File

@ -228,6 +228,7 @@ jobs:
- sanitize_address - sanitize_address
- sanitize_others - sanitize_others
- sanitize_thread - sanitize_thread
- thread_safety
- valgrind - valgrind
container: container:
@ -277,6 +278,10 @@ jobs:
elif [ "${{ matrix.checktype }}" = "sanitize_others" ]; then elif [ "${{ matrix.checktype }}" = "sanitize_others" ]; then
echo 'CXX=clang++' echo 'CXX=clang++'
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1 -fsanitize=undefined,implicit-conversion,local-bounds,unsigned-integer-overflow" echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1 -fsanitize=undefined,implicit-conversion,local-bounds,unsigned-integer-overflow"
elif [ "${{ matrix.checktype }}" = "thread_safety" ]; then
echo 'CXX=clang++'
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1 -Wthread-safety -stdlib=libc++ -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Werror"
echo 'LDFLAGS=-DCLANG_DEFAULT_LINKER=lld'
elif [ "${{ matrix.checktype }}" = "valgrind" ]; then elif [ "${{ matrix.checktype }}" = "valgrind" ]; then
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1" echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1"
echo 'VALGRIND="--leak-check=full --error-exitcode=1"' echo 'VALGRIND="--leak-check=full --error-exitcode=1"'
@ -288,7 +293,7 @@ jobs:
- name: Build - name: Build
run: | run: |
./autogen.sh ./autogen.sh
/bin/sh -c "CXX=${CXX} CXXFLAGS=\"${CXXFLAGS}\" ./configure --prefix=/usr --with-openssl" /bin/sh -c "CXX=${CXX} CXXFLAGS=\"${CXXFLAGS}\" LDFLAGS=\"${LDFLAGS}\" ./configure --prefix=/usr --with-openssl"
make make
- name: Test suite - name: Test suite

View File

@ -66,7 +66,9 @@ AWSCLI_ZIP_FILE="awscliv2.zip"
#----------------------------------------------------------- #-----------------------------------------------------------
# Parameters for configure(set environments) # Parameters for configure(set environments)
#----------------------------------------------------------- #-----------------------------------------------------------
CXX="g++"
CXXFLAGS="-O -DS3FS_PTHREAD_ERRORCHECK=1" CXXFLAGS="-O -DS3FS_PTHREAD_ERRORCHECK=1"
LDFLAGS=""
CONFIGURE_OPTIONS="--prefix=/usr --with-openssl" CONFIGURE_OPTIONS="--prefix=/usr --with-openssl"
#----------------------------------------------------------- #-----------------------------------------------------------
@ -236,7 +238,7 @@ elif [ "${CONTAINER_FULLNAME}" = "fedora:40" ]; then
PACKAGE_UPDATE_OPTIONS="update -y -qq" PACKAGE_UPDATE_OPTIONS="update -y -qq"
PACKAGE_INSTALL_OPTIONS="install -y" PACKAGE_INSTALL_OPTIONS="install -y"
INSTALL_PACKAGES="clang-tools-extra curl-devel fuse fuse-devel gcc libstdc++-devel gcc-c++ glibc-langpack-en java-latest-openjdk-headless jq libxml2-devel mailcap git automake make openssl openssl-devel curl attr diffutils procps python3-pip unzip" INSTALL_PACKAGES="clang clang-tools-extra curl-devel fuse fuse-devel gcc libstdc++-devel gcc-c++ glibc-langpack-en java-latest-openjdk-headless jq libxml2-devel mailcap git automake make openssl openssl-devel curl attr diffutils procps python3-pip unzip libcxx libcxx-devel"
INSTALL_CHECKER_PKGS="cppcheck ShellCheck" INSTALL_CHECKER_PKGS="cppcheck ShellCheck"
INSTALL_CHECKER_PKG_OPTIONS="" INSTALL_CHECKER_PKG_OPTIONS=""
@ -338,8 +340,12 @@ fi
#----------------------------------------------------------- #-----------------------------------------------------------
echo "${PRGNAME} [INFO] Set environment for configure options" echo "${PRGNAME} [INFO] Set environment for configure options"
echo "CXXFLAGS=${CXXFLAGS}" >> "${GITHUB_ENV}" cat << EOF >> "${GITHUB_ENV}"
echo "CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS}" >> "${GITHUB_ENV}" CXX=${CXX}
CXXFLAGS=${CXXFLAGS}
LDFLAGS=${LDFLAGS}
CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS}
EOF
echo "${PRGNAME} [INFO] Finish Linux helper for installing packages." echo "${PRGNAME} [INFO] Finish Linux helper for installing packages."