From 820d53580529188c40ce853f68a20a5a8c1ebc75 Mon Sep 17 00:00:00 2001 From: zhangxiaoyu Date: Thu, 3 Aug 2023 09:52:10 +0000 Subject: [PATCH] !589 compile using c++17 * compile using c++17 --- 0016-fix-execlp-not-enough-args.patch | 54 +++++++++++++++++++++++++++ iSulad.spec | 20 +++++++--- 2 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 0016-fix-execlp-not-enough-args.patch diff --git a/0016-fix-execlp-not-enough-args.patch b/0016-fix-execlp-not-enough-args.patch new file mode 100644 index 0000000..bb7251f --- /dev/null +++ b/0016-fix-execlp-not-enough-args.patch @@ -0,0 +1,54 @@ +From 85f6947f9f0c3a5ac7f70250b5c80627f2d18949 Mon Sep 17 00:00:00 2001 +From: zhangxiaoyu +Date: Tue, 1 Aug 2023 15:05:55 +0800 +Subject: [PATCH] fix execlp not enough args + +Signed-off-by: zhangxiaoyu +--- + cmake/set_build_flags.cmake | 2 +- + test/fuzz/CMakeLists.txt | 2 +- + test/image/oci/oci_ut_common.cc | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/cmake/set_build_flags.cmake b/cmake/set_build_flags.cmake +index ba250cd..09c85c6 100644 +--- a/cmake/set_build_flags.cmake ++++ b/cmake/set_build_flags.cmake +@@ -3,7 +3,7 @@ set(CMAKE_C_FLAGS "-fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -fP + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") + + if (GRPC_CONNECTOR) +- set(CMAKE_CXX_FLAGS "-fPIC -std=c++11 -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -Wno-error=deprecated-declarations") ++ set(CMAKE_CXX_FLAGS "-fPIC -std=c++17 -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -Wno-error=deprecated-declarations") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") + endif() + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-E -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -shared -pthread") +diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt +index 478a401..617a168 100644 +--- a/test/fuzz/CMakeLists.txt ++++ b/test/fuzz/CMakeLists.txt +@@ -34,7 +34,7 @@ MESSAGE(STATUS "GCLANG_PP_BINARY is set to ${GCLANG_PP_BINARY}") + SET(CMAKE_C_COMPILER "${GCLANG_BINARY}") + SET(CMAKE_CXX_COMPILER "${GCLANG_PP_BINARY}") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep") +-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage -std=c++11 -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep") ++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage -std=c++17 -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep") + SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + SET(EXE0 test_volume_mount_spec_fuzz) +diff --git a/test/image/oci/oci_ut_common.cc b/test/image/oci/oci_ut_common.cc +index 1158ae8..9fa25d1 100644 +--- a/test/image/oci/oci_ut_common.cc ++++ b/test/image/oci/oci_ut_common.cc +@@ -22,7 +22,7 @@ + + int execvp_success(const char *file, char * const argv[]) + { +- execlp("echo", "echo"); ++ execlp("echo", "echo", NULL); + return -1; + } + +-- +2.25.1 + diff --git a/iSulad.spec b/iSulad.spec index 2697cee..1258b3f 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,8 +1,9 @@ %global _version 2.1.2 -%global _release 4 +%global _release 5 %global is_systemd 1 %global enable_shimv2 1 %global is_embedded 1 +%global cpp_std 17 Name: iSulad Version: %{_version} @@ -28,6 +29,7 @@ Patch0012: 0012-fix-hugetlbs-malloc-length.patch Patch0013: 0013-fix-forget-to-set-return-value.patch Patch0014: 0014-ensure-define-in-local-and-use-correctly-type.patch Patch0015: 0015-Revert-the-changes-in-util_smart_calloc_s.patch +Patch0016: 0016-fix-execlp-not-enough-args.patch %ifarch x86_64 aarch64 Provides: libhttpclient.so()(64bit) @@ -67,6 +69,7 @@ BuildRequires: libcurl libcurl-devel libarchive-devel device-mapper-devel BuildRequires: http-parser-devel BuildRequires: libseccomp-devel libcap-devel libselinux-devel libwebsockets libwebsockets-devel BuildRequires: systemd-devel git +BuildRequires: libevhtp-devel libevent-devel %if 0%{?enable_shimv2} BuildRequires: lib-shim-v2 lib-shim-v2-devel %endif @@ -79,6 +82,7 @@ Requires: libcurl Requires: http-parser libseccomp Requires: libcap libselinux libwebsockets libarchive device-mapper Requires: systemd +BuildRequires: libevhtp libevent %if 0%{?enable_shimv2} Requires: lib-shim-v2 %endif @@ -95,15 +99,15 @@ mkdir -p build cd build %if 0%{?enable_shimv2} %if %{defined openeuler} -%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SHIM_V2=ON -DENABLE_UT=ON -DENABLE_GRPC_REMOTE_CONNECT=ON ../ +%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SHIM_V2=ON -DENABLE_UT=OFF -DENABLE_GRPC_REMOTE_CONNECT=OFF -DENABLE_GRPC=OFF -DCMAKE_CXX_STANDARD=%{cpp_std} ../ %else -%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SHIM_V2=ON -DENABLE_GRPC_REMOTE_CONNECT=ON ../ +%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SHIM_V2=ON -DENABLE_GRPC_REMOTE_CONNECT=OFF -DENABLE_GRPC=OFF -DCMAKE_CXX_STANDARD=%{cpp_std} ../ %endif %else %if %{defined openeuler} -%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_UT=ON -DENABLE_GRPC_REMOTE_CONNECT=ON ../ +%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_UT=OFF -DENABLE_GRPC_REMOTE_CONNECT=OFF -DENABLE_GRPC=OFF -DCMAKE_CXX_STANDARD=%{cpp_std} ../ %else -%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GRPC_REMOTE_CONNECT=ON ../ +%cmake -DDEBUG=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_GRPC_REMOTE_CONNECT=OFF -DENABLE_GRPC=OFF -DCMAKE_CXX_STANDARD=%{cpp_std} ../ %endif %endif %make_build @@ -270,6 +274,12 @@ fi %endif %changelog +* Thu Jul 20 2023 zhangxiaoyu - 2.1.2-5 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: compile using c++17 + * Mon May 29 2023 zhangxiaoyu - 2.1.2-4 - Type: bugfix - ID: NA