intel / isa-l_crypto

Other
267 stars 80 forks source link

libisal_crypto.so: undefined reference to `floor_pow2' #103

Closed a16bitsysop closed 2 years ago

a16bitsysop commented 2 years ago

I am trying to compile on alpine linux edge, but it fails with:

CCLD     sha1_mb/sha1_mb_rand_ssl_test
  CCLD     mh_sha1/mh_sha1_update_test
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ./.libs/libisal_crypto.so: undefined reference to `floor_pow2'
collect2: error: ld returned 1 exit status
make: *** [Makefile:4069: sha1_mb/sha1_mb_rand_ssl_test] Error 1
make: *** Waiting for unfinished jobs....
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ./.libs/libisal_crypto.so: undefined reference to `floor_pow2'
collect2: error: ld returned 1 exit status
make: *** [Makefile:3997: mh_sha1/mh_sha1_update_test] Error 1

doing a scanelf for the symbol the only location is: ET_REL - floor_pow2 ./src/isa-l_crypto-2.24.0/rolling_hash/rolling_hashx_base.o

I have tried autoreconf -fi and ./autogen.sh, both have the same result

configured with ./configure

The same error happens with x86_64 and aarch64

configure output:

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
autoreconf: configure.ac: tracing
autoreconf: configure.ac: creating directory build-aux
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force 
autoreconf: running: /usr/bin/autoconf --force
configure.ac:50: warning: The macro `AC_PROG_CC_STDC' is obsolete.
configure.ac:50: You should run autoupdate.
./lib/autoconf/c.m4:1666: AC_PROG_CC_STDC is expanded from...
configure.ac:50: the top level
configure.ac:68: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:68: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:68: the top level
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:23: installing 'build-aux/compile'
configure.ac:25: installing 'build-aux/config.guess'
configure.ac:25: installing 'build-aux/config.sub'
configure.ac:12: installing 'build-aux/install-sh'
configure.ac:12: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
autoreconf: Leaving directory '.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./build-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 how to create a pax tar archive... gnutar
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 the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking whether make supports nested variables... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking how to convert x86_64-pc-linux-musl file names to x86_64-pc-linux-musl format... func_convert_file_noop
checking how to convert x86_64-pc-linux-musl file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking whether Intel CET is enabled... no
checking for yasm... no
no yasm
checking for optional yasm SHA-NI support... no
checking for nasm... yes
checking for modern nasm... yes
checking for optional nasm AVX512 support... yes
checking for additional nasm AVX512 support... yes
checking for optional nasm SHA-NI support... yes
Using nasm args target "linux" "-f elf64"
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for inline... inline
checking for size_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libisal_crypto.pc
config.status: executing depfiles commands
config.status: executing libtool commands

        isa-l_crypto 2.24.0
        =====

        prefix:                 /usr
        sysconfdir:             ${prefix}/etc
        libdir:                 ${exec_prefix}/lib
        includedir:             ${prefix}/include

        compiler:               gcc
        cflags:                 -Os -fomit-frame-pointer
        ldflags:                -Wl,--as-needed,-O1,--sort-common

        debug:                  no
gbtucker commented 2 years ago

Thanks for reporting @a16bitsysop. It looks like this is only case (one of two) with inline helper functions that are missing static. Can you test on referenced PR 4f72976 and see if it fixes?

a16bitsysop commented 2 years ago

that fixes that issue thanks, so I tried packaging it:

I think x86 might need yasm instead of nasm or specify arch?:

/usr/lib/gcc/i586-alpine-linux-musl/12.1.1/../../../../i586-alpine-linux-musl/bin/ld: i386:x86-64 architecture of input fileaes/.libs/XTS_AES_128_dec_expanded_key_vaes.o' is incompatible with i386 output` https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/820877#L2616

armhf, armv7, and ppc64le all fail the first test: Test 0, digest 0 is 64F33B37, should be F4F0C766 https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/820879#L321

s390x fails:

Test failed function check 2712
[9075](https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/820878#L9075)make: *** [Makefile:5940: sm3_mb/sm3_mb_rand_ssl_test.run] Error 152

https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/820878#L9074

should I open new issues for these?

gbtucker commented 2 years ago

I think x86 might need yasm instead of nasm or specify arch?:

No, the issue isn't nasm. I would mark as x86_64 only for now.

armhf, armv7, and ppc64le all fail the first test: Test 0, digest 0 is 64F33B37, should be F4F0C766 https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/820879#L321

The arm64 builds should work. I'm not sure what the issue is there. Perhaps the arm folks can comment.

should I open new issues for these?

Please do as the previous fix will auto close this one.

a16bitsysop commented 2 years ago

okay, yes aarch64 builds and passes the tests