ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 59 forks source link

symbol clash between genprotimg/src/utils/buffer.c and libssh #109

Closed sharkcz closed 3 years ago

sharkcz commented 3 years ago

Looks like we are hitting a symbol clash between genprotimg/src/utils/buffer.c and libssh when building in Fedora Rawhide. A local build in Fedora 32 looks good. Both buffer.c and libssh define buffer_free, libssh is brought in via libcurl ... Probably related to enabled LTO in Fedora >=34.

...
gcc -I ../../include -D_GNU_SOURCE -I"/builddir/build/BUILD/s390-tools-2.16.0/genprotimg/src/" -I"/builddir/build/BUILD/s390-tools-2.16.0/genprotimg/src//../" -I"/include" -DS390_TOOLS_RELEASE=2.16.0-1.fc35 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/usr/sbin -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -std=gnu11 -DPKGDATADIR="/usr/share/s390-tools/genprotimg" -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include    -Wall -Wextra -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes -Wpointer-arith -Werror -Wno-error=inline   -c utils/curl.c -o utils/curl.o
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  genprotimg.o pv/pv_stage3.o pv/pv_image.o pv/pv_comp.o pv/pv_hdr.o pv/pv_ipib.o utils/crypto.o utils/file_utils.o pv/pv_args.o utils/buffer.o pv/pv_comps.o pv/pv_error.o pv/pv_opt_item.o utils/curl.o -lglib-2.0  -lcrypto  -lcurl  -o genprotimg
/usr/bin/ld: utils/buffer.o (symbol from plugin): undefined reference to symbol 'buffer_free@@LIBSSH_4_5_0'
/usr/bin/ld: /usr/lib64/libssh.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [../../common.mak:259: genprotimg] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/s390-tools-2.16.0/genprotimg/src'
make[1]: *** [Makefile:22: all-recursive] Error 1
make[1]: Leaving directory '/builddir/build/BUILD/s390-tools-2.16.0/genprotimg'
make: *** [Makefile:43: genprotimg] Error 2
mhartmay commented 3 years ago

Thanks for reporting - I just created a fix for it.

sharkcz commented 3 years ago

Thanks, builds are now passing in Fedora.