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

   I try to build a static library without PIC, and cannot find a way to do so.
   
   I am setting these options in cmake `-DARROW_BUILD_SHARED=off 
-DARROW_CXXFLAGS=-fno-PIC`, but when the build actually happening, a `-fPIC` is 
automatically appended after `ARROW_CXXFLAGS`:
   
   ```
   /home/engshare/third-party2/gcc/11.x/centos7-native/886b5eb/bin/g++ 
-DARROW_EXPORTING -DARROW_WITH_BACKTRACE -DARROW_WITH_TIMING_TESTS 
-DURI_STATIC_BUILD -I/home/engshare/third\
   -party2/apache-arrow-velox-private/8.0.0/src/build-platform010/no-pic/src 
-I/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp/src
 
-I/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp/src/generated
 -isystem /\
   
home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp/thirdparty/flatbuffers/include
 -isystem 
/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp/thirdparty/hadoop/include
 -Wno-noexcept-type -O3 -g -pipe -Wall -Wn\
   o-error -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 
-fno-omit-frame-pointer -momit-leaf-frame-pointer 
-fno-reorder-blocks-and-partition -gz=none -Wl,-z,relro -fcommon -gdwarf-4 
-gstrict-dwarf -Wcast-align=strict -march=core-avx2 -mtune=skylake -nostdinc 
-gre\
   cord-gcc-switches 
-fdebug-prefix-map=/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp=/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp
 -fdebug-prefix-map=/home/engshare/third-party2/apache-arrow-velox-pri\
   
vate/8.0.0/src/build-platform010/no-pic=/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp
 -fdiagnostics-color=always -O3 -DNDEBUG  -Wall -fno-semantic-interposition 
-Wno-cast-align -fno-PIC -O3 -DNDEBUG -fPIC -std=c++11 -MD -MT src/arrow/CMakeF\
   iles/arrow_objlib.dir/array/array_base.cc.o -MF 
CMakeFiles/arrow_objlib.dir/array/array_base.cc.o.d -o 
CMakeFiles/arrow_objlib.dir/array/array_base.cc.o -c 
/home/engshare/third-party2/apache-arrow-velox-private/8.0.0/src/apache-arrow-8.0.0/cpp/src/arrow/array/array_base.cc
   ```
   
   I looked around in the cmake and cannot find where the last `-fPIC` gets 
appended.  Can you point me a way to remove that flag?


-- 
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