intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
288 stars 88 forks source link

nasm can not find .inc .asm files when building with CMake #131

Closed uilianries closed 10 months ago

uilianries commented 10 months ago

The intel-ipsec-mb version 1.4 is affected by CMake when including folders to be used with nasm. The CMake removes slash (/) from folder path, but that's a requirement for nasm. The result is that nasm can't include files from this project.

This CMake's behavior is a known issue but not considered as a bug.

Environment

OS: Linux Ubuntu 16.04 Compiler: GCC 5 Compiler: nasm 2.15.05 CMake 3.27.1

Steps

wget https://github.com/intel/intel-ipsec-mb/archive/refs/tags/v1.4.tar.gz
tar zxf v1.4.tar.gz
cd intel-ipsec-mb-1.4/
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build/ --target IPSec_MB

Building log

$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON
-- Project Version: 1.4.0
-- AESNI emulation support... OFF
-- SAFE_OPTIONS...            ON
-- SAFE_PARAM...              ON
-- SAFE_DATA...               ON
-- SAFE_LOOKUP...             ON
-- BUILD_SHARED_LIBS...       ON
-- CMAKE_GENERATOR...         Unix Makefiles
-- BUILD_TYPE...              Release
-- CMAKE_VERBOSE_MAKEFILE...  ON
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OPERATING SYSTEM...        Linux
-- The ASM_NASM compiler identification is NASM
-- Found assembler: /usr/bin/nasm
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/foobar/intel-ipsec-mb-1.4/build
conan@3e7851c64819:/tmp/foobar/intel-ipsec-mb-1.4$ cmake --build build/ --target IPSec_MB
/usr/bin/cmake -S/tmp/foobar/intel-ipsec-mb-1.4 -B/tmp/foobar/intel-ipsec-mb-1.4/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make  -f CMakeFiles/Makefile2 IPSec_MB
make[1]: Entering directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
/usr/bin/cmake -S/tmp/foobar/intel-ipsec-mb-1.4 -B/tmp/foobar/intel-ipsec-mb-1.4/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /tmp/foobar/intel-ipsec-mb-1.4/build/CMakeFiles 83
/usr/bin/make  -f CMakeFiles/Makefile2 lib/CMakeFiles/IPSec_MB.dir/all
make[2]: Entering directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
/usr/bin/make  -f lib/CMakeFiles/IPSec_MB.dir/build.make lib/CMakeFiles/IPSec_MB.dir/depend
make[3]: Entering directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
cd /tmp/foobar/intel-ipsec-mb-1.4/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/foobar/intel-ipsec-mb-1.4 /tmp/foobar/intel-ipsec-mb-1.4/lib /tmp/foobar/intel-ipsec-mb-1.4/build /tmp/foobar/intel-ipsec-mb-1.4/build/lib /tmp/foobar/intel-ipsec-mb-1.4/build/lib/CMakeFiles/IPSec_MB.dir/DependInfo.cmake --color=
Dependee "/tmp/foobar/intel-ipsec-mb-1.4/build/lib/CMakeFiles/IPSec_MB.dir/DependInfo.cmake" is newer than depender "/tmp/foobar/intel-ipsec-mb-1.4/build/lib/CMakeFiles/IPSec_MB.dir/depend.internal".
Dependee "/tmp/foobar/intel-ipsec-mb-1.4/build/lib/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/tmp/foobar/intel-ipsec-mb-1.4/build/lib/CMakeFiles/IPSec_MB.dir/depend.internal".
Scanning dependencies of target IPSec_MB
make[3]: Leaving directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
/usr/bin/make  -f lib/CMakeFiles/IPSec_MB.dir/build.make lib/CMakeFiles/IPSec_MB.dir/build
make[3]: Entering directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
[  0%] Building ASM_NASM object lib/CMakeFiles/IPSec_MB.dir/avx2_t1/aes128_gcm_by8_avx2.asm.o
cd /tmp/foobar/intel-ipsec-mb-1.4/build/lib && /usr/bin/nasm -I/tmp/foobar/intel-ipsec-mb-1.4/lib -I/tmp/foobar/intel-ipsec-mb-1.4/lib/include -I/tmp/foobar/intel-ipsec-mb-1.4/lib/no-aesni -DSAFE_DATA -DSAFE_PARAM -DSAFE_LOOKUP -Werror -felf64 -Xgnu -gdwarf -DLINUX -D__linux__ -f elf64 -o CMakeFiles/IPSec_MB.dir/avx2_t1/aes128_gcm_by8_avx2.asm.o /tmp/foobar/intel-ipsec-mb-1.4/lib/avx2_t1/aes128_gcm_by8_avx2.asm
/tmp/foobar/intel-ipsec-mb-1.4/lib/avx2_t1/aes128_gcm_by8_avx2.asm:31: fatal: unable to open include file `include/gcm_avx_gen4.inc'
lib/CMakeFiles/IPSec_MB.dir/build.make:84: recipe for target 'lib/CMakeFiles/IPSec_MB.dir/avx2_t1/aes128_gcm_by8_avx2.asm.o' failed
make[3]: *** [lib/CMakeFiles/IPSec_MB.dir/avx2_t1/aes128_gcm_by8_avx2.asm.o] Error 1
make[3]: Leaving directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
CMakeFiles/Makefile2:1152: recipe for target 'lib/CMakeFiles/IPSec_MB.dir/all' failed
make[2]: *** [lib/CMakeFiles/IPSec_MB.dir/all] Error 2
make[2]: Leaving directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
CMakeFiles/Makefile2:1159: recipe for target 'lib/CMakeFiles/IPSec_MB.dir/rule' failed
make[1]: *** [lib/CMakeFiles/IPSec_MB.dir/rule] Error 2
make[1]: Leaving directory '/tmp/foobar/intel-ipsec-mb-1.4/build'
Makefile:613: recipe for target 'IPSec_MB' failed
make: *** [IPSec_MB] Error 2
mdcornu commented 10 months ago

Closing as this is only occurs with unsupported versions of NASM, see #132 for details. CMake minimum NASM version check was added in 9e17d6cad1f99e64f3534053a3ff096c46646058.