Reputation: 381
I am trying to compile this code for some time. Specifically, I am trying to compile the avx2 code using the given mac. However, I am always getting the following error. I have looked up a lot but unable to find a solution. I will be very glad if you help me to find a solution.
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [test/test_kyber] Error 1
gcc version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Clang version :
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
Output running the make command.
/usr/bin/gcc -Wall -Wextra -O3 -fomit-frame-pointer -msse2avx -mavx2 -march=native -static -o test/test_kyber kyber.c poly.c polyvec.c fips202.o fips202x4.c precomp.c ntt.c verify.c indcpa.c consts.c kex.c nttlevels0t4.s nttlevels5t7.s mul_coefficients.s polyvec_pointwise_acc.s poly_add.s poly_sub.s cbd.s poly_freeze.s crypto_stream_aes256ctr.c keccak4x/KeccakP-1600-times4-SIMD256.o randombytes.c test/test_kyber.c
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [test/test_kyber] Error 1
Upvotes: 1
Views: 7833
Reputation: 381
thanks a lot for your help and time. I understood the problem. The makefile adds a -static flag, but on our office machines we don't have static libc.a. Hence, the error "cannot find -lc". I removed the static flag and it works fine for now. I think we don't need a static libc.a, but I will have to check more closely.
Upvotes: 1