Closed pqfan closed 4 years ago
Can you post what string you used with cmake?
Greetings dstebila,
I tried both the original command listed at the README.md "cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake -DOQS_USE_CPU_EXTENSIONS=OFF .."
but also you can assume that I have used the openvpn-build Microsoft script which used the following command:
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake \ -DCMAKE_INSTALL_PREFIX=${BUILDROOT}/openssl-${OPENSSL_VERSION}/oqs \ -DOQS_USE_CPU_EXTENSIONS=OFF .. || die "cmake"
Turns out to this
[37/942] Building C object src/common/CMakeFiles/common.dir/aes/aes.c.obj FAILED: src/common/CMakeFiles/common.dir/aes/aes.c.obj /usr/bin/x86_64-w64-mingw32-gcc -Iinclude -Wl,--dynamicbase,--nxcompat -fvisibility=hidden -Werror -Wall -Wextra -Wpedantic -Wstrict-prototypes -Wshadow -Wformat=2 -Wfloat-equal -Wwrite-strings -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -Wl,--gc-sections -Wno-maybe-uninitialized -Wbad-function-cast -std=gnu11 -MD -MT src/common/CMakeFiles/common.dir/aes/aes.c.obj -MF src/common/CMakeFiles/common.dir/aes/aes.c.obj.d -o src/common/CMakeFiles/common.dir/aes/aes.c.obj -c ../src/common/aes/aes.c ../src/common/aes/aes.c: In function ‘OQS_AES128_ECB_enc_sch’: ../src/common/aes/aes.c:78:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:85:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:93:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:100:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:108:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:115:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:134:1: error: embedding a directive within macro arguments is not portable [-Werror]
^ ../src/common/aes/aes.c:169:0: error: unterminated argument list invoking macro "C_OR_NI" }
../src/common/aes/aes.c:73:2: error: ‘C_OR_NI’ undeclared (first use in this function)
C_OR_NI(
^~~
../src/common/aes/aes.c:73:2: note: each undeclared identifier is reported only once for each function it appears in
../src/common/aes/aes.c:73:2: error: expected ‘;’ at end of input
../src/common/aes/aes.c:73:2: error: expected declaration or statement at end of input
../src/common/aes/aes.c:72:44: error: unused parameter ‘plaintext’ [-Werror=unused-parameter]
void OQS_AES128_ECB_enc_sch(const uint8_t plaintext, const size_t plaintext_len, const void schedule, uint8_t ciphertext) {
^~~~~
../src/common/aes/aes.c:72:68: error: unused parameter ‘plaintext_len’ [-Werror=unused-parameter]
void OQS_AES128_ECB_enc_sch(const uint8_t plaintext, const size_t plaintext_len, const void schedule, uint8_t ciphertext) {
^~~~~
../src/common/aes/aes.c:72:95: error: unused parameter ‘schedule’ [-Werror=unused-parameter]
void OQS_AES128_ECB_enc_sch(const uint8_t plaintext, const size_t plaintext_len, const void schedule, uint8_t ciphertext) {
^~~~
../src/common/aes/aes.c:72:114: error: unused parameter ‘ciphertext’ [-Werror=unused-parameter]
void OQS_AES128_ECB_enc_sch(const uint8_t plaintext, const size_t plaintext_len, const void schedule, uint8_t ciphertext) {
^~~~~~
cc1: all warnings being treated as errors
[42/942] Building C object src/kem/sike/CMakeFiles/sike.dir/external/P610/P610_compressed.c.obj
ninja: build stopped: subcommand failed.
FATAL: ninja
FATAL: build x86_64 >&2
Traceback (most recent call last):
File "build.py", line 259, in
It's hard for me to debug since I don't have a similar build system. I've pushed a potential fix, can you try the latest commit on branch ds-aes-ni-def? Also, what's the version of gcc that mingw is using?
Going to try it right away
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
Ok! Seems to work just fine now!
For your records the system uses the GNU 7.3.0 Compiler, if I understood your question well.
I confirm I successfully cross-compiled and built a custom PQCrypto-VPN with Microsoft's build system and it works nicely with openssl-oqs latest release.
Thank you a lot for your work on this project and your support!
I m facing the exact same issue with Release 0.4.0, but #815 fixed it for me as well. I think the fix should be included in the current version.
Greetings,
Initially I want to thank all the involved contributors for this great project.
I use liboqs along with openssl-oqs and Microsoft's PQCrypto-VPN project, and always want to have the latest update when a new release comes out.
I should state that I am not such experience in coding, so my apologies for any possible wrong statement.
I encounter a cross-compiling error when I attempt to build at Ubuntu 18.04 on VirtualBox with ninja.
I insert inline the error output below:
I am looking forward hearing from you. Keep up with this great work. Best regards