hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

Build failed with glibc 2.34

Open hdu-sdlzx opened this issue 3 years ago • 6 comments

[ 95%] Building CXX object tools/hscollider/CMakeFiles/hscollider.dir/sig.cpp.o /home/sdlzx/rpmbuild/BUILD/hyperscan-5.4.0/tools/hscollider/sig.cpp:178:48: error: array bound is not an integer constant before ‘]’ token 178 | static TLS_VARIABLE char alt_stack_loc[SIGSTKSZ]; | ^ /home/sdlzx/rpmbuild/BUILD/hyperscan-5.4.0/tools/hscollider/sig.cpp: In function ‘void setSignalStack()’: /home/sdlzx/rpmbuild/BUILD/hyperscan-5.4.0/tools/hscollider/sig.cpp:191:23: error: ‘alt_stack_loc’ was not declared in this scope; did you mean ‘alt_stack’? 191 | alt_stack.ss_sp = alt_stack_loc; | ^~~~~~~~~~~~~ | alt_stack make[2]: *** [tools/hscollider/CMakeFiles/hscollider.dir/build.make:221: tools/hscollider/CMakeFiles/hscollider.dir/sig.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:691: tools/hscollider/CMakeFiles/hscollider.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

hdu-sdlzx avatar Jun 27 '22 08:06 hdu-sdlzx

@fatchanghao @hongyang7

hdu-sdlzx avatar Jun 27 '22 08:06 hdu-sdlzx

This has bitten me just today: from the changelog of glibc 2.34 (emphasis mine):

  • Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ). This supports dynamic sized register sets for modern architectural features like Arm SVE.

vlaci avatar Jun 28 '22 17:06 vlaci

Thank you for reporting the new glibc change. We'll review your patch.

hongyang7 avatar Jun 29 '22 14:06 hongyang7

For myself, I have no interested in building hscollider nor any other tools at all. Yeah sure, they are good tools, sometimes. But for compiling shared/static library purpose, I really don't need those things, they just add lots of compile time that I don't wanna spend and require extra library to be taken care of in build environment(libpcap).

So, I honestly suggest dudes would consider about adding a cmake option to let users to disable tools build to save compile time and get out of these out of no where issues. @hongyang7

for example:

cmake -D BUILD_TOOLS=OFF .

JackLiar avatar Sep 05 '22 12:09 JackLiar

@hdu-sdlzx

Please refer to latest develop branch. Commit ids: https://github.com/intel/hyperscan/commit/564ed6f65a1058e4e0adab69bdd17ba9138c8a0c and https://github.com/intel/hyperscan/commit/a404a415a090be370b3bed4b08e22b7077bad36c

hongyang7 avatar Oct 27 '22 18:10 hongyang7

@JackLiar Thanks for the suggestion, we'll think about it.

hongyang7 avatar Oct 28 '22 08:10 hongyang7