diff --git a/build-tools/automation/azure-pipelines-public.yaml b/build-tools/automation/azure-pipelines-public.yaml index f00a09174e2..652eb62229d 100644 --- a/build-tools/automation/azure-pipelines-public.yaml +++ b/build-tools/automation/azure-pipelines-public.yaml @@ -138,8 +138,8 @@ stages: workspace: clean: all variables: - CXX: g++-10 - CC: gcc-10 + CXX: g++-11 + CC: gcc-11 steps: - checkout: self path: s/android @@ -151,8 +151,8 @@ stages: - script: | sudo apt-get update - sudo apt-get install -y g++-10 gcc-10 - displayName: install g++-10 and gcc-10 + sudo apt-get install -y g++-11 gcc-11 + displayName: install g++-11 and gcc-11 - template: /build-tools/automation/yaml-templates/build-linux-steps.yaml parameters: diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index d53525fb085..52a719908a2 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -32,8 +32,8 @@ stages: workspace: clean: all variables: - CXX: g++-10 - CC: gcc-10 + CXX: g++-11 + CC: gcc-11 ${{ if eq(parameters.use1ESTemplate, true) }}: templateContext: outputs: diff --git a/build-tools/scripts/generate-pinvoke-tables.sh b/build-tools/scripts/generate-pinvoke-tables.sh index 936f167815a..e96754b8a3b 100755 --- a/build-tools/scripts/generate-pinvoke-tables.sh +++ b/build-tools/scripts/generate-pinvoke-tables.sh @@ -52,7 +52,7 @@ case ${HOST} in if [ "${RUNNING_ON_CI}" == "no" ]; then COMPILER="g++" else - COMPILER="g++-10" + COMPILER="g++-11" fi ;; darwin) diff --git a/external/termux-elf-cleaner b/external/termux-elf-cleaner index ee5385e004a..3da3eeab96e 160000 --- a/external/termux-elf-cleaner +++ b/external/termux-elf-cleaner @@ -1 +1 @@ -Subproject commit ee5385e004a9d67bdc289e43939691b260e06b03 +Subproject commit 3da3eeab96e57fa794c5ea0feb2eed4903545dec diff --git a/tools/fastdev/elfcleaner/CMakeLists.txt b/tools/fastdev/elfcleaner/CMakeLists.txt index bba82e0fe5f..afbfb5d699c 100644 --- a/tools/fastdev/elfcleaner/CMakeLists.txt +++ b/tools/fastdev/elfcleaner/CMakeLists.txt @@ -1,14 +1,21 @@ # Set the minimum version of CMake that can be used # To find the cmake version run # $ cmake --version -cmake_minimum_required(VERSION 3.5) +# 3.20+ is required so policy CMP0128 is NEW and the C++ standard flag +# (e.g. -std=c++20) is always emitted; elf-cleaner.cpp uses std::counting_semaphore. +cmake_minimum_required(VERSION 3.20) # Set the project name project (elfcleaner C CXX) -set(CMAKE_CXX_STANDARD 17) +# Keep ELFCLEANER_VERSION, CMAKE_CXX_STANDARD, and the PACKAGE_NAME/ +# PACKAGE_VERSION/COPYRIGHT compile definitions below in sync with +# external/termux-elf-cleaner/CMakeLists.txt. +set(ELFCLEANER_VERSION "3.0.1") + +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS ON) +set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -25,9 +32,14 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -Wall") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -Wall") set(ELFCLEANER_SOURCES - ../../../external/termux-elf-cleaner/termux-elf-cleaner.cpp + ../../../external/termux-elf-cleaner/elf-cleaner.cpp ) # Add an executable add_executable(elfcleaner ${ELFCLEANER_SOURCES}) +target_compile_definitions(elfcleaner + PRIVATE "COPYRIGHT=\"Copyright (C) 2022-2024 Termux and contributors.\"" + PRIVATE "PACKAGE_VERSION=\"${ELFCLEANER_VERSION}\"" + PRIVATE "PACKAGE_NAME=\"termux-elf-cleaner\"" + ) set_target_properties(elfcleaner PROPERTIES LINK_FLAGS_RELEASE -s) \ No newline at end of file