Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken build on macOS #165

Closed
Smattr opened this issue Apr 8, 2019 · 4 comments
Closed

broken build on macOS #165

Smattr opened this issue Apr 8, 2019 · 4 comments

Comments

@Smattr
Copy link

Smattr commented Apr 8, 2019

Currently building on macOS terminates with:

...
gcc  -I/opt/local/include  -L/opt/local/lib -o scrypt main.o libcperciva/alg/sha256.o libcperciva/cpusupport/cpusupport_x86_aesni.o libcperciva/cpusupport/cpusupport_x86_sse2.o libcperciva/crypto/crypto_aes.o libcperciva/crypto/crypto_aesctr.o libcperciva/crypto/crypto_entropy.
o libcperciva/util/asprintf.o libcperciva/util/entropy.o libcperciva/util/getopt.o libcperciva/util/humansize.o libcperciva/util/insecure_memzero.o libcperciva/util/readpass.o libcperciva/util/warnp.o lib/crypto/crypto_scrypt.o lib/crypto/crypto_scrypt_smix.o lib/scryptenc/scry
ptenc.o lib/scryptenc/scryptenc_cpuperf.o lib/util/memlimit.o libcperciva_aesni.a libscrypt_sse2.a -lcrypto
Undefined symbols for architecture x86_64:
  "_cpusupport_x86_rdrand_detect_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_cpusupport_x86_rdrand_init_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_cpusupport_x86_rdrand_present_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_generate_seed_rdrand", referenced from:
      _update_from_rdrand in crypto_entropy.o
ld: symbol(s) not found for architecture x86_64

This is with version 1.0.2r_0 of OpenSSL installed via Macports on (obviously) x86-64. Bisecting leads us to commit 509f0fa. Are macOS builds officially supported? I've never had any problems with scrypt on macOS in the past. Some further OS info below...

$ uname -mnrsv
Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed Feb 27 00:43:23 PST 2019; root:xnu-4570.71.35~1/RELEASE_X86_64 x86_64
$ sysctl -a | grep '^machdep\.cpu\..*features'
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM SMAP RDSEED ADX IPT SGX FPU_CSDS MPX CLFSOPT
machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI
@gperciva
Copy link
Member

gperciva commented Apr 8, 2019

Hi @Smattr, those symbols should be in:

$ nm libcperciva/cpusupport/cpusupport_x86_rdrand.o 
0000000000000000 T cpusupport_x86_rdrand_detect_1
0000000000000004 B cpusupport_x86_rdrand_init_1
0000000000000000 B cpusupport_x86_rdrand_present_1
$ nm libcperciva_rdrand.a 
0000000000000000 T generate_seed_rdrand

I don't see libcperciva_rdrand.* in your gcc line. Did you run autoreconf -i recently?

@Smattr
Copy link
Author

Smattr commented Apr 9, 2019

I did indeed. Should I not have? More complete attempt below.

$ git clone https://github.com/tarsnap/scrypt
Cloning into 'scrypt'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 1833 (delta 43), reused 76 (delta 33), pack-reused 1722
Receiving objects: 100% (1833/1833), 417.27 KiB | 6.14 MiB/s, done.
Resolving deltas: 100% (1056/1056), done.
$ cd scrypt
$ git checkout 509f0fa
Note: checking out '509f0fa'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 509f0fa crypto_entropy.c: can use RDRAND (in addition to /dev/urandom)
$ export CFLAGS=-I/opt/local/include # teach autotools how to find Macports things
$ export LDFLAGS=-L/opt/local/lib
$ autoreconf -i
aclocal: warning: couldn't open directory 'm4': No such file or directory
configure.ac:12: installing 'config.aux/ar-lib'
configure.ac:10: installing 'config.aux/compile'
configure.ac:7: installing 'config.aux/install-sh'
configure.ac:7: installing 'config.aux/missing'
Makefile.am: installing 'config.aux/depcomp'
$ echo $?
0
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config.aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for ranlib... ranlib
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for library containing AES_encrypt... -lcrypto
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/sysinfo.h usability... no
checking sys/sysinfo.h presence... no
checking for sys/sysinfo.h... no
checking for sysinfo... no
checking for struct sysinfo... no
checking for struct sysinfo.totalram... no
checking for struct sysinfo.mem_unit... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking openssl/aes.h usability... yes
checking openssl/aes.h presence... no
configure: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: openssl/aes.h: proceeding with the compiler's result
checking for openssl/aes.h... yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking for posix_memalign... yes
checking for mmap... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking compiler_warnings... yes
./configure: line 5261: AX_CFLAGS_WARN_ALL: command not found
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
$ make
( export CC="gcc"; export CFLAGS="-I/opt/local/include"; command -p sh ./libcperciva/cpusupport/Build/cpusupport.sh "$PATH") > cpusupport-config.h.tmp && command -p mv cpusupport-config.h.tmp cpusupport-config.h
WARNING: POSIX violation: /bin/zsh's command -p resets $PATH
Checking if compiler supports X86 CPUID feature... yes
Checking if compiler supports X86 SSE2 feature... yes
Checking if compiler supports X86 AESNI feature... yes, via -maes
Checking if compiler supports X86 RDRAND feature... yes, via -mrdrnd
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from main.c:34:
./libcperciva/util/getopt.h:25:2: warning: Working around bug in LLVM optimizer [-W#warnings]
#warning Working around bug in LLVM optimizer
 ^
./libcperciva/util/getopt.h:26:2: warning: For more details see https://bugs.llvm.org/show_bug.cgi?id=27190 [-W#warnings]
#warning For more details see https://bugs.llvm.org/show_bug.cgi?id=27190
 ^
2 warnings generated.
depbase=`echo libcperciva/alg/sha256.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/alg/sha256.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/alg/sha256.o libcperciva/alg/sha256.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/cpusupport/cpusupport_x86_aesni.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/cpusupport/cpusupport_x86_aesni.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/cpusupport/cpusupport_x86_aesni.o libcperciva/cpusupport/cpusupport_x86_aesni.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/cpusupport/cpusupport_x86_sse2.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/cpusupport/cpusupport_x86_sse2.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/cpusupport/cpusupport_x86_sse2.o libcperciva/cpusupport/cpusupport_x86_sse2.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/crypto/crypto_aes.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/crypto/crypto_aes.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/crypto/crypto_aes.o libcperciva/crypto/crypto_aes.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/crypto/crypto_aesctr.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/crypto/crypto_aesctr.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/crypto/crypto_aesctr.o libcperciva/crypto/crypto_aesctr.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/crypto/crypto_entropy.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/crypto/crypto_entropy.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/crypto/crypto_entropy.o libcperciva/crypto/crypto_entropy.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/asprintf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/asprintf.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/asprintf.o libcperciva/util/asprintf.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/entropy.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/entropy.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/entropy.o libcperciva/util/entropy.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/getopt.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/getopt.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/getopt.o libcperciva/util/getopt.c &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from libcperciva/util/getopt.c:6:
./libcperciva/util/getopt.h:25:2: warning: Working around bug in LLVM optimizer [-W#warnings]
#warning Working around bug in LLVM optimizer
 ^
./libcperciva/util/getopt.h:26:2: warning: For more details see https://bugs.llvm.org/show_bug.cgi?id=27190 [-W#warnings]
#warning For more details see https://bugs.llvm.org/show_bug.cgi?id=27190
 ^
2 warnings generated.
depbase=`echo libcperciva/util/humansize.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/humansize.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/humansize.o libcperciva/util/humansize.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/insecure_memzero.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/insecure_memzero.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/insecure_memzero.o libcperciva/util/insecure_memzero.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/readpass.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/readpass.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/readpass.o libcperciva/util/readpass.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo libcperciva/util/warnp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT libcperciva/util/warnp.o -MD -MP -MF $depbase.Tpo -c -o libcperciva/util/warnp.o libcperciva/util/warnp.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo lib/crypto/crypto_scrypt.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT lib/crypto/crypto_scrypt.o -MD -MP -MF $depbase.Tpo -c -o lib/crypto/crypto_scrypt.o lib/crypto/crypto_scrypt.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo lib/crypto/crypto_scrypt_smix.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT lib/crypto/crypto_scrypt_smix.o -MD -MP -MF $depbase.Tpo -c -o lib/crypto/crypto_scrypt_smix.o lib/crypto/crypto_scrypt_smix.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo lib/scryptenc/scryptenc.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT lib/scryptenc/scryptenc.o -MD -MP -MF $depbase.Tpo -c -o lib/scryptenc/scryptenc.o lib/scryptenc/scryptenc.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo lib/scryptenc/scryptenc_cpuperf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT lib/scryptenc/scryptenc_cpuperf.o -MD -MP -MF $depbase.Tpo -c -o lib/scryptenc/scryptenc_cpuperf.o lib/scryptenc/scryptenc_cpuperf.c &&\
	mv -f $depbase.Tpo $depbase.Po
depbase=`echo lib/util/memlimit.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L   -I/opt/local/include -MT lib/util/memlimit.o -MD -MP -MF $depbase.Tpo -c -o lib/util/memlimit.o lib/util/memlimit.c &&\
	mv -f $depbase.Tpo $depbase.Po
gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L  `. ./cpusupport-config.h; echo ${CFLAGS_X86_AESNI}` -I/opt/local/include -MT libcperciva/crypto/aesni_a-crypto_aes_aesni.o -MD -MP -MF libcperciva/crypto/.deps/aesni_a-crypto_aes_aesni.Tpo -c -o libcperciva/crypto/aesni_a-crypto_aes_aesni.o `test -f 'libcperciva/crypto/crypto_aes_aesni.c' || echo './'`libcperciva/crypto/crypto_aes_aesni.c
mv -f libcperciva/crypto/.deps/aesni_a-crypto_aes_aesni.Tpo libcperciva/crypto/.deps/aesni_a-crypto_aes_aesni.Po
rm -f libcperciva_aesni.a
ar cru libcperciva_aesni.a libcperciva/crypto/aesni_a-crypto_aes_aesni.o 
ranlib libcperciva_aesni.a
gcc -DHAVE_CONFIG_H -I.  -I./libcperciva/alg -I./libcperciva/cpusupport -I./libcperciva/crypto -I./libcperciva/util -I./lib/crypto -I./lib/scryptenc -I./lib/util -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" -D_POSIX_C_SOURCE=200809L  `. ./cpusupport-config.h; echo ${CFLAGS_X86_SSE2}` -I/opt/local/include -MT lib/crypto/libscrypt_sse2_a-crypto_scrypt_smix_sse2.o -MD -MP -MF lib/crypto/.deps/libscrypt_sse2_a-crypto_scrypt_smix_sse2.Tpo -c -o lib/crypto/libscrypt_sse2_a-crypto_scrypt_smix_sse2.o `test -f 'lib/crypto/crypto_scrypt_smix_sse2.c' || echo './'`lib/crypto/crypto_scrypt_smix_sse2.c
mv -f lib/crypto/.deps/libscrypt_sse2_a-crypto_scrypt_smix_sse2.Tpo lib/crypto/.deps/libscrypt_sse2_a-crypto_scrypt_smix_sse2.Po
rm -f libscrypt_sse2.a
ar cru libscrypt_sse2.a lib/crypto/libscrypt_sse2_a-crypto_scrypt_smix_sse2.o 
ranlib libscrypt_sse2.a
gcc  -I/opt/local/include  -L/opt/local/lib -o scrypt main.o libcperciva/alg/sha256.o libcperciva/cpusupport/cpusupport_x86_aesni.o libcperciva/cpusupport/cpusupport_x86_sse2.o libcperciva/crypto/crypto_aes.o libcperciva/crypto/crypto_aesctr.o libcperciva/crypto/crypto_entropy.o libcperciva/util/asprintf.o libcperciva/util/entropy.o libcperciva/util/getopt.o libcperciva/util/humansize.o libcperciva/util/insecure_memzero.o libcperciva/util/readpass.o libcperciva/util/warnp.o lib/crypto/crypto_scrypt.o lib/crypto/crypto_scrypt_smix.o lib/scryptenc/scryptenc.o lib/scryptenc/scryptenc_cpuperf.o lib/util/memlimit.o libcperciva_aesni.a libscrypt_sse2.a -lcrypto 
Undefined symbols for architecture x86_64:
  "_cpusupport_x86_rdrand_detect_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_cpusupport_x86_rdrand_init_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_cpusupport_x86_rdrand_present_1", referenced from:
      _cpusupport_x86_rdrand in crypto_entropy.o
  "_generate_seed_rdrand", referenced from:
      _update_from_rdrand in crypto_entropy.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [scrypt] Error 1
make: *** [all] Error 2

@Smattr
Copy link
Author

Smattr commented Apr 9, 2019

Ah, sorry I should have dug a bit deeper. That specific commit is broken, but the branch is fixed (in a849733) before it gets merged back into master. The tip of master is working fine, not sure what I messed up the first time around. Apologies for the noise.

@Smattr Smattr closed this as completed Apr 9, 2019
@gperciva
Copy link
Member

gperciva commented Apr 9, 2019

That makes sense. We ensure that the PR compiles (of course), but within each PR the commits don't necessarily compile. This is primarily so that we can merge libcperciva changes between our projects even though they have different build systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants