Skip to content

Build: Make fails with the error "invalid for movq" and the warning "implicit conversion shortens 64-bit value". Workaround: Use clang instead of llvm-gcc. #1367

@dgdy9hvz

Description

@dgdy9hvz

I have found that llvm-gcc on Mac OS X fails to compile wolfssl-3.13.0. If gcc is a symlink to llvm-gcc, then, by adding the line export CC=clang before ./configure, clang must be forced to be used.

I did this

The current directory is "wolfssl-3.13.0", to which "wolfssl-3.13.0.zip" expanded.

./configure --enable-static --disable-shared
make

I expected the following

The "make" completes the compilation and link successfully.

what happened

The "make" terminates with errors. The following is the log that "make" printed. I replaced some paths with "[omitted]" in the log for security and privacy reasons. According to the "config.log", CC='gcc'.

make -j3  all-am
  CC       wolfcrypt/test/testsuite_testsuite_test-test.o
  CC       examples/echoclient/testsuite_testsuite_test-echoclient.o
  CC       examples/client/testsuite_testsuite_test-client.o
wolfcrypt/test/test.c: In function 'rsa_decode_test':
wolfcrypt/test/test.c:7513: warning: implicit conversion shortens 64-bit value into a 32-bit value
wolfcrypt/test/test.c:7520: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       examples/echoserver/testsuite_testsuite_test-echoserver.o
  CC       examples/server/testsuite_testsuite_test-server.o
  CC       examples/client/tests_unit_test-client.o
  CC       examples/server/tests_unit_test-server.o
  CC       wolfcrypt/src/src_libwolfssl_la-hmac.lo
  CC       wolfcrypt/src/src_libwolfssl_la-hash.lo
  CC       wolfcrypt/src/src_libwolfssl_la-cpuid.lo
In file included from wolfcrypt/src/hmac.c:38:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-random.lo
  CC       wolfcrypt/src/src_libwolfssl_la-sha256.lo
  CC       wolfcrypt/src/src_libwolfssl_la-rsa.lo
In file included from wolfcrypt/src/random.c:96:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/sha256.c:95:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/rsa.c:178:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-aes.lo
  CC       wolfcrypt/src/src_libwolfssl_la-sha.lo
  CC       wolfcrypt/src/src_libwolfssl_la-sha512.lo
In file included from wolfcrypt/src/aes.c:243:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/sha.c:87:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/sha512.c:126:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-sha3.lo
  CC       wolfcrypt/src/src_libwolfssl_la-logging.lo
In file included from wolfcrypt/src/sha3.c:160:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-wc_encrypt.lo
  CC       wolfcrypt/src/src_libwolfssl_la-wc_port.lo
  CC       wolfcrypt/src/src_libwolfssl_la-error.lo
  CC       wolfcrypt/src/src_libwolfssl_la-signature.lo
  CC       wolfcrypt/src/src_libwolfssl_la-wolfmath.lo
  CC       wolfcrypt/src/src_libwolfssl_la-memory.lo
In file included from wolfcrypt/src/wolfmath.c:51:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-dh.lo
  CC       wolfcrypt/src/src_libwolfssl_la-asn.lo
  CC       wolfcrypt/src/src_libwolfssl_la-coding.lo
In file included from wolfcrypt/src/asn.c:71:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/dh.c:43:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-poly1305.lo
  CC       wolfcrypt/src/src_libwolfssl_la-md5.lo
In file included from wolfcrypt/src/poly1305.c:42:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/md5.c:45:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-chacha.lo
  CC       wolfcrypt/src/src_libwolfssl_la-chacha20_poly1305.lo
  CC       wolfcrypt/src/src_libwolfssl_la-tfm.lo
In file included from wolfcrypt/src/chacha.c:45:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
wolfcrypt/src/chacha.c: In function 'wc_Chacha_encrypt_bytes':
wolfcrypt/src/chacha.c:991: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/chacha20_poly1305.c:42:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
  CC       wolfcrypt/src/src_libwolfssl_la-ecc.lo
  CC       src/src_libwolfssl_la-internal.lo
In file included from wolfcrypt/src/tfm.c:44:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
wolfcrypt/src/tfm.c: In function 'fp_forcezero':
wolfcrypt/src/tfm.c:2266: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from wolfcrypt/src/ecc.c:119:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
wolfcrypt/src/ecc.c: In function 'wc_ecc_mulmod_ex':
wolfcrypt/src/ecc.c:2221: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from src/internal.c:40:
./wolfcrypt/src/misc.c: In function 'ForceZero':
./wolfcrypt/src/misc.c:198: warning: implicit conversion shortens 64-bit value into a 32-bit value
src/internal.c: In function 'SendServerHello':
src/internal.c:20346: warning: implicit conversion shortens 64-bit value into a 32-bit value
/var/[omitted]/ccvDgLmH.s:15:suffix or operands invalid for `movq'
/var/[omitted]/ccvDgLmH.s:58:suffix or operands invalid for `movq'
/var/[omitted]/ccvDgLmH.s:116:suffix or operands invalid for `movq'
/var/[omitted]/ccvDgLmH.s:143:suffix or operands invalid for `movq'
/var/[omitted]/ccvDgLmH.s:3359:suffix or operands invalid for `movq'
make[1]: *** [wolfcrypt/src/src_libwolfssl_la-tfm.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

workaround

This problem can be avoided by adding the line export CC=clang before ./configure. Then, the make successfully completes.

export CC=clang
./configure --enable-static --disable-shared
make

environment

wolfssl-3.13.0
Mac OS X

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions