smhasher icon indicating copy to clipboard operation
smhasher copied to clipboard

Linking errors on Core 2 Quad

Open mirh opened this issue 4 years ago • 4 comments

When I'm almost done compiling I get this

/usr/bin/cmake -E cmake_link_script CMakeFiles/SMHasher.dir/link.txt --verbose=1
/usr/bin/c++   -march=native -DHAVE_INT64 -O3 -DNDEBUG   CMakeFiles/SMHasher.dir/main.cpp.o  -o SMHasher  libSMHasherSupport.a 
/usr/bin/ld: libSMHasherSupport.a(t1ha0.c.o): in function `t1ha0_resolve':
t1ha0.c:(.text.unlikely+0x4e): undefined reference to `t1ha0_ia32aes_noavx'
/usr/bin/ld: t1ha0.c:(.text.unlikely+0x67): undefined reference to `t1ha0_ia32aes_avx2'
/usr/bin/ld: t1ha0.c:(.text.unlikely+0x7a): undefined reference to `t1ha0_ia32aes_avx'
/usr/bin/ld: libSMHasherSupport.a(blake3_dispatch.c.o): in function `blake3_compress_in_place':
blake3_dispatch.c:(.text+0x15f): undefined reference to `blake3_compress_in_place_sse41'
/usr/bin/ld: libSMHasherSupport.a(blake3_dispatch.c.o): in function `blake3_compress_xof':
blake3_dispatch.c:(.text+0x1d7): undefined reference to `blake3_compress_xof_sse41'
/usr/bin/ld: libSMHasherSupport.a(blake3_dispatch.c.o): in function `blake3_hash_many':
blake3_dispatch.c:(.text+0x28d): undefined reference to `blake3_hash_many_sse41'
/usr/bin/ld: SMHasher: hidden symbol `t1ha0_ia32aes_avx2' isn't defined
/usr/bin/ld: link finale non riuscito: bad value
collect2: error: ld returned 1 exit status

I suppose there is either some code not "ifdef-ed enough", or CMakeLists that has some library to include in the wrong part of an if. This is my cpuinfo

fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm pti tpr_shadow vnmi flexpriority dtherm

mirh avatar Mar 23 '20 01:03 mirh

@erthink

rurban avatar Mar 23 '20 06:03 rurban

Can you retry? I optimized now CMakeLists.txt properly for lto and cross-compilation. Still could be a wrong AVX2 probe.

rurban avatar Aug 17 '20 15:08 rurban

I don't know if tits the same issue, but I am getting a similar:

/usr/bin/ld: libSMHasherSupport.a(t1ha0.c.o): in function `t1ha0_resolve':
/home/devin/smhasher/t1ha/t1ha0.c:399: undefined reference to `t1ha0_ia32aes_noavx'
/usr/bin/ld: /home/devin/smhasher/t1ha/t1ha0.c:398: undefined reference to `t1ha0_ia32aes_avx2'
/usr/bin/ld: /home/devin/smhasher/t1ha/t1ha0.c:398: undefined reference to `t1ha0_ia32aes_avx'
/usr/bin/ld: libSMHasherSupport.a(Hashes.cpp.o): in function `falkhash_test_cxx(void const*, int, unsigned int, void*)':
/home/devin/smhasher/Hashes.cpp:726: undefined reference to `falkhash_test'
/usr/bin/ld: SMHasher: hidden symbol `t1ha0_ia32aes_avx2' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/SMHasher.dir/build.make:104: SMHasher] Error 1
make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/SMHasher.dir/all] Error 2
make: *** [Makefile:114: all] Error 2

but only if I build in Debug, or RelWithDebInfo. Issue disappears when I build with Release

devin122 avatar Aug 18 '20 13:08 devin122

I've redone the t1ha0 logic, when to include and when to ignore it. Those 3 funcs can only be used with Intel-alike CPUs.

rurban avatar Sep 24 '20 11:09 rurban

Looks like this is fixed now. If not please reopen

rurban avatar Nov 10 '22 09:11 rurban