ISPC Language support

No. CMAKE_<lang>_LINK_OPTIONS_NO_PIE is not used by default. If POSITION_INDEPENDENT_CODE is not set (TRUE or FALSE), no flags are applied to link step.

PIE flag (-fpie or -fno_pie) is applied only if property POSITION_INDEPENDENT_CODE is set (‘TRUE’ or ‘FALSE’).

To ensure consistency for the link step, define the variable CMAKE_POSITION_INDEPENDENT_CODE and include module CheckPIESupport in the root CMakelist.txt and call check_pie_supported().

variable CMAKE_POSITION_INDEPENDENT_CODE can take TRUE or FALSE:

  • set to FALSE: gcc and ispc will compile in their default mode (PIC for gcc and NO_PIC for ispc) but the linker will specify -fno_pie so link will succeed.
  • set to TRUE: gcc and ispc will compile with option -fPIC and the linker will use option -fpie and the link will succeed.