You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/10 18:37:21 UTC

[GitHub] [arrow] Yuhta opened a new issue, #13367: How to build without PIC

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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] Yuhta commented on issue #13367: How to build without PIC

Posted by GitBox <gi...@apache.org>.
Yuhta commented on issue #13367:
URL: https://github.com/apache/arrow/issues/13367#issuecomment-1153252992

   Thanks @kou , our company has the policy that every library must be build for both PIC and non-PIC version, non-PIC version is for performance optimization.  It would be nice to have a flag to optionally disable PIC in the build.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on issue #13367: How to build without PIC

Posted by GitBox <gi...@apache.org>.
kou commented on issue #13367:
URL: https://github.com/apache/arrow/issues/13367#issuecomment-1153146646

   We always set `CMAKE_POSITION_INDEPENEDNT_CODE` to `ON` in `cpp/cmake_modules/*.cmake`.
   
   You need to change `*.cmake` files to set `CMAKE_POSITION_INDEPENDENT_CODE` to `OFF` for now because we don't provide option to control it.
   
   BTW, why do you want to disable PIC?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on issue #13367: How to build without PIC

Posted by GitBox <gi...@apache.org>.
kou commented on issue #13367:
URL: https://github.com/apache/arrow/issues/13367#issuecomment-1153371976

   OK. Could you open an issue on https://issues.apache.org/jira/browse/ARROW as a feature request?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou closed issue #13367: How to build without PIC

Posted by GitBox <gi...@apache.org>.
kou closed issue #13367: How to build without PIC
URL: https://github.com/apache/arrow/issues/13367


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] Yuhta commented on issue #13367: How to build without PIC

Posted by GitBox <gi...@apache.org>.
Yuhta commented on issue #13367:
URL: https://github.com/apache/arrow/issues/13367#issuecomment-1163616382

   https://issues.apache.org/jira/browse/ARROW-16886


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org