This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8fcd8ed8b3 [chore](build) add option to disable -frecord-gcc-switches 
(#12846)
8fcd8ed8b3 is described below

commit 8fcd8ed8b32868858437f8c973af6b70322176f2
Author: Zhengguo Yang <yangz...@gmail.com>
AuthorDate: Thu Sep 22 15:38:14 2022 +0800

    [chore](build) add option to disable -frecord-gcc-switches (#12846)
---
 be/CMakeLists.txt | 6 +++++-
 build.sh          | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 2fc57ecf3c..094ebc4c3d 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -410,7 +410,7 @@ check_function_exists(sched_getcpu HAVE_SCHED_GETCPU)
 #  -pthread: enable multithreaded malloc
 #  -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG: enable nanosecond precision for 
boost
 #  -fno-omit-frame-pointers: Keep frame pointer for functions in register
-set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -frecord-gcc-switches -Wall 
-Wno-sign-compare -pthread -Werror")
+set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall -Wno-sign-compare -pthread 
-Werror")
 set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -fstrict-aliasing 
-fno-omit-frame-pointer")
 set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -std=gnu++17 -D__STDC_FORMAT_MACROS")
 set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} 
-DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG")
@@ -418,6 +418,10 @@ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} 
-DBOOST_SYSTEM_NO_DEPRECATED")
 # Enable the cpu and heap profile of brpc
 set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DBRPC_ENABLE_CPU_PROFILER")
 
+if (RECORD_COMPILER_SWITCHES)
+    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -frecord-gcc-switches")
+endif()
+
 function(TRY_TO_CHANGE_LINKER LINKER_COMMAND LINKER_NAME)
     if (CUSTUM_LINKER_COMMAND STREQUAL "ld")
         execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=${LINKER_COMMAND} 
-Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
diff --git a/build.sh b/build.sh
index 661cac059d..dc98cbce5b 100755
--- a/build.sh
+++ b/build.sh
@@ -270,6 +270,10 @@ if [[ -z "${USE_DWARF}" ]]; then
     USE_DWARF='OFF'
 fi
 
+if [[ -z "${RECORD_COMPILER_SWITCHES}" ]]; then
+    RECORD_COMPILER_SWITCHES='OFF'
+fi
+
 echo "Get params:
     BUILD_FE            -- ${BUILD_FE}
     BUILD_BE            -- ${BUILD_BE}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to