intel / intel-ipsec-mb

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

Enforce slash for folder path when running nasm with CMake #132

Closed uilianries closed 10 months ago

uilianries commented 10 months ago

This PR fixes #131. Please, read #131 to obtain more information about.

Description

Preserve slash character when including folders with nasm and CMake

Affected parts

Motivation and Context

131

How Has This Been Tested?

I built my changer locally:

$ 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=
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

The important thing here is the include folders now with slash:

/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/

Types of changes

Checklist:

mdcornu commented 10 months ago

Thanks for the PR, we'll look into this ASAP.

-Marcel

mdcornu commented 10 months ago

Hi Uilian,

Can you please verify that you are using nasm 2.15.05 when building? I can't reproduce this issue using nasm 2.15.05 or newer (tested with cmake version 3.22.1 and 3.27.4). The link in your issue seems to indicate that the issue was fixed in nasm 2.14.

Regards, Marcel

uilianries commented 10 months ago

@mdcornu Checking again, there was mistake from my side, I have both nasm 2.14 and 2.15 installed and I was running 2.14. However, when using CMake, there is no verification about minimal version, but using Makefile yet.

I could update the PR to validate nasm version to be 2.15 as requirements, instead of this current backport. WDYT?

mdcornu commented 10 months ago

Sure, that sounds good 👍Thanks.

uilianries commented 10 months ago

@mdcornu I just created the PR #133 with new cmake check. I'm closing this PR in favor of #133.