intel / hyperscan

High-performance regular expression matching library
https://www.hyperscan.io
Other
4.78k stars 710 forks source link

Allow build hyperscan as PIC #371

Open dgutson opened 1 year ago

dgutson commented 1 year ago

As required by YaraNG, hyperscan needs to be built as PIC. They have patch, and it has been discussed in https://github.com/avast/yarang/issues/2 The idea is to be able to turn PIC on or off from the build system. CC @qequ @metthal

hongyang7 commented 1 year ago

Current Hyperscan is already configured as POSITION_INDEPENDENT_CODE for shared library (which is a common requirement for shared libs), like: https://github.com/intel/hyperscan/blob/64a995bf445d86b74eb0f375624ffc85682eadfe/CMakeLists.txt#L1195-L1200

While this yarang patch hyperscan_pic.patch needs Hyperscan to also add POSITION_INDEPENDENT_CODE support for static library.

Generally, I think it might not be a very commonly seen requirement of adding PIC support for a static library..... Are you perhaps under circumstances like you want to link static Hyperscan lib into some other shared lib or an executable? Or any other scenario? It would be nice if you can share with us more background. We'll look into that.

dgutson commented 1 year ago

@metthal could you please comment?