pitrou opened a new issue, #35870:
URL: https://github.com/apache/arrow/issues/35870

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `ARROW_CXXFLAGS` used to allow changing the optimization level. However, 
this now gets ignored as the default optimization flags get appended _after_ 
the `ARROW_CXXFLAGS`.
   
   For example, the `conda-cpp-valgrind` job produces the following CMake 
configuration:
   ```
   -- CMAKE_C_FLAGS: -march=nocona -mtune=haswell -ftree-vectorize -fPIC 
-fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem 
/opt/conda/envs/arrow/include -fuse-ld=gold  -Wall -fno-semantic-interposition 
-msse4.2 -Og
   -- CMAKE_CXX_FLAGS:  -Wno-noexcept-type -fvisibility-inlines-hidden 
-fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC 
-fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem 
/opt/conda/envs/arrow/include -fdiagnostics-color=always -fuse-ld=gold  -Wall 
-fno-semantic-interposition -msse4.2 -Og
   -- CMAKE_C_FLAGS_DEBUG: -g -O0 -ggdb
   -- CMAKE_CXX_FLAGS_DEBUG: -g -O0 -ggdb
   ```
   
   ... and then the following compiler commands:
   ```
   [1/684] /opt/conda/envs/arrow/bin/ccache 
/opt/conda/envs/arrow/bin/x86_64-conda-linux-gnu-c++ -DARROW_EXPORTING 
-DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 
-DARROW_HAVE_SSE4_2 -DARROW_HDFS -DARROW_VALGRIND -DARROW_WITH_BACKTRACE 
-DARROW_WITH_BROTLI -DARROW_WITH_BZ2 -DARROW_WITH_LZ4 -DARROW_WITH_RE2 
-DARROW_WITH_SNAPPY -DARROW_WITH_TIMING_TESTS -DARROW_WITH_UTF8PROC 
-DARROW_WITH_ZLIB -DARROW_WITH_ZSTD -DURI_STATIC_BUILD -I/build/cpp/src 
-I/arrow/cpp/src -I/arrow/cpp/src/generated -isystem 
/arrow/cpp/thirdparty/flatbuffers/include -isystem 
/arrow/cpp/thirdparty/hadoop/include -Wno-noexcept-type 
-fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell 
-ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 
-ffunction-sections -pipe -isystem /opt/conda/envs/arrow/include 
-fdiagnostics-color=always -fuse-ld=gold  -Wall -fno-semantic-interposition 
-msse4.2 -Og -g -O0 -ggdb -std=c++17 -fPIC -pthread -MD -MT 
src/arrow/CMakeFiles/
 arrow_objlib.dir/util/bitmap_builders.cc.o -MF 
src/arrow/CMakeFiles/arrow_objlib.dir/util/bitmap_builders.cc.o.d -o 
src/arrow/CMakeFiles/arrow_objlib.dir/util/bitmap_builders.cc.o -c 
/arrow/cpp/src/arrow/util/bitmap_builders.cc
   ```
   (notice how `-O0` overrides `-Og` by coming after it)
   
   `ARROW_CXXFLAGS` should ideally override any default settings.
   
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to