Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606740 - dev-libs/libgcrypt - .libs/libgcrypt.so: undefined reference to '__warn_memset_zero_len'
Summary: dev-libs/libgcrypt - .libs/libgcrypt.so: undefined reference to '__warn_memse...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mikle Kolyada (RETIRED)
URL:
Whiteboard:
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2017-01-21 22:44 UTC by Martin Mokrejš
Modified: 2020-12-01 12:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,146.59 KB, text/plain)
2017-01-21 22:44 UTC, Martin Mokrejš
Details
random-drbg-dont-memset-zero.patch (0001-random-random-drbg.c-Don-t-memset-if-length-is-zero.patch,1.41 KB, patch)
2017-01-25 17:02 UTC, Kristian Fiskerstrand (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2017-01-21 22:44:09 UTC
Hi,
  is this a compiler issue?

libtool: compile:  x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -I. -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random -I.. -I../src -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/src -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -c /scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random/random-drbg.c  -fPIC -DPIC -o .libs/random-drbg.o


...

In file included from /usr/include/string.h:635:0,
                 from /scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random/random-drbg.c:149:
In function 'memset',
    inlined from 'drbg_hmac_update' at /scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random/random-drbg.c:1024:7:
/usr/include/bits/string3.h:86:7: warning: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters
       __warn_memset_zero_len ();
       ^


...

/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -m32  -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall    -Wl,--version-script=/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/src/libgcrypt.vers -version-info 21:5:1 -Wl,-O1 -Wl,--as-needed -o libgcrypt.la -rpath /usr/lib32 libgcrypt_la-visibility.lo libgcrypt_la-misc.lo libgcrypt_la-global.lo libgcrypt_la-sexp.lo libgcrypt_la-hwfeatures.lo libgcrypt_la-stdmem.lo libgcrypt_la-secmem.lo libgcrypt_la-missing-string.lo libgcrypt_la-fips.lo libgcrypt_la-hmac256.lo libgcrypt_la-context.lo  hwf-x86.lo ../cipher/libcipher.la ../random/librandom.la ../mpi/libmpi.la ../compat/libcompat.la  -lgpg-error 
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -m32  -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall  -Wl,-O1 -Wl,--as-needed -o dumpsexp dumpsexp-dumpsexp.o  
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -Wl,-O1 -o dumpsexp dumpsexp-dumpsexp.o  -Wl,--as-needed
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -m32 -DSTANDALONE  -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall  -Wl,-O1 -Wl,--as-needed -o hmac256 hmac256-hmac256.o  
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -DSTANDALONE -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -Wl,-O1 -o hmac256 hmac256-hmac256.o  -Wl,--as-needed
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC  .libs/libgcrypt_la-visibility.o .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-hwfeatures.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-fips.o .libs/libgcrypt_la-hmac256.o .libs/libgcrypt_la-context.o .libs/hwf-x86.o  -Wl,--whole-archive ../cipher/.libs/libcipher.a ../random/.libs/librandom.a ../mpi/.libs/libmpi.a ../compat/.libs/libcompat.a -Wl,--no-whole-archive  -Wl,--as-needed -lgpg-error  -m32 -O2 -maes -mpclmul -mpopcnt -mavx -march=native -Wl,--version-script=/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/src/libgcrypt.vers -Wl,-O1   -Wl,-soname -Wl,libgcrypt.so.20 -o .libs/libgcrypt.so.20.1.5
libtool: link: (cd ".libs" && rm -f "libgcrypt.so.20" && ln -s "libgcrypt.so.20.1.5" "libgcrypt.so.20")
libtool: link: (cd ".libs" && rm -f "libgcrypt.so" && ln -s "libgcrypt.so.20.1.5" "libgcrypt.so")
libtool: link: ( cd ".libs" && rm -f "libgcrypt.la" && ln -s "../libgcrypt.la" "libgcrypt.la" )
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -m32  -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall  -Wl,-O1 -Wl,--as-needed -o mpicalc mpicalc-mpicalc.o libgcrypt.la  -lgpg-error 
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -Wl,-O1 -o .libs/mpicalc mpicalc-mpicalc.o  -Wl,--as-needed ./.libs/libgcrypt.so -lgpg-error
./.libs/libgcrypt.so: undefined reference to `__warn_memset_zero_len'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:714: mpicalc] Error 1
make[2]: Leaving directory '/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5-abi_x86_32.x86/src'


# emerge --info '=dev-libs/libgcrypt-1.7.5-r1::gentoo'
Portage 2.3.3 (python 2.7.12-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.23-r3, 4.9.2-default-pciehp x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.9.2-default-pciehp-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.3
KiB Mem:    16375748 total,    647716 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 21 Jan 2017 21:30:01 +0000
sh bash 4.4_p11
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p11::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo, 2.27::gentoo
sys-devel/gcc:            4.3.6-r1::gentoo, 4.4.7::gentoo, 4.6.4::gentoo, 4.7.4::gentoo, 4.8.5::gentoo, 4.9.3::gentoo, 5.3.0::gentoo, 5.4.0-r2::gentoo, 6.2.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /scratch/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

science
    location: /home/mmokrejs/proj/sci
    masters: gentoo
    priority: 0

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 1

layman
    location: /var/lib/layman
    masters: gentoo
    priority: 2

haskell
    location: /var/lib/layman/haskell
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x OPERA-2014 RAR"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.2/conf /usr/share/maven-bin-3.3/conf /var/bind /var/lib/hsqldb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native"
DISTDIR="/scratch/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news noclean nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/scratch/var/tmp"
USE="X acpi alsa amd64 amr apache apache2 apulse asm avx berkdb bindist bluetooth boost bzip2 cairo cgi cli coin consolekit cracklib crypt cryptlib cups cxx dbus device-mapper dhcp directfb dri drm dvd emboss encode fax fbcon ffmpeg flac fontconfig fortran gbm gcrypt gd gdbm geoip gimp glpk gmp gnutls gpm gtk hal hpijs hwdb iconv id3tag imaging innodb inotify java javafx javascript jce jpeg jpg js jscript keymap ladspa lapack laptop lcms libnotify lm_sensors mad matroska mmx mmxext modemmanager modules mpi mpich2 multilib mysql ncurses nfs nls nptl nptlonly nscd nsplugin ntfsprogs ocr ogg opengl openmp pam parport pcre pdf perl php png policykit polkit ppds pppd python qt3support readline rendering resolvconf scanner sctp seccomp server session slideshow sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification suexec svg syslog tcl tcpd threads tiff tk truetype udev unicode upower usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xattr xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias authz_host auth_basic auth_digest cgi cgid deflate dir env filter include info mem_cache mime mime_magic negotiation remoteip setenvif status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-US en en-GB cs" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en_GB en cs" OFFICE_IMPLEMENTATION="libreoffice" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby21 ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="vesa vmware fbdev intel i915 i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Martin Mokrejš 2017-01-21 22:44:38 UTC
Created attachment 460842 [details]
build.log
Comment 2 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-01-25 17:02:05 UTC
Created attachment 461416 [details, diff]
random-drbg-dont-memset-zero.patch
Comment 3 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-01-25 17:03:00 UTC
(In reply to Kristian Fiskerstrand from comment #2)
> Created attachment 461416 [details, diff] [details, diff]
> random-drbg-dont-memset-zero.patch

Can you try applying this patch (on a non-production-system, if it fixes the build error I'll upstream it to get a qualified opinion I'm not doing something stupid with the random number generator.
Comment 4 Martin Mokrejš 2017-01-25 19:14:55 UTC
Thank you, looks it is without errors and warnings now:

/bin/sh ../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -I. -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random -I..  -I../src -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/src   -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -c -o random-drbg.lo /scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random/random-drbg.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -I. -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random -I.. -I../src -I/scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/src -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -fvisibility=hidden -Wall -c /scratch/var/tmp/portage/dev-libs/libgcrypt-1.7.5-r1/work/libgcrypt-1.7.5/random/random-drbg.c  -fPIC -DPIC -o .libs/random-drbg.o

It installed fine.
Comment 5 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-01-25 21:27:59 UTC
(In reply to Martin Mokrejš from comment #4)
> Thank you, looks it is without errors and warnings now:

https://lists.gnupg.org/pipermail/gnupg-devel/2017-January/032502.html
Comment 6 Aaron W. Swenson gentoo-dev 2017-12-22 16:48:17 UTC
I ran into this same issue with 1.8.2. The attached patch worked for me.

Since upstream decided not to include it, can we get a revbump with it attached?
Comment 7 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-12-22 17:24:08 UTC
(In reply to Aaron W. Swenson from comment #6)
> I ran into this same issue with 1.8.2. The attached patch worked for me.
> 
> Since upstream decided not to include it, can we get a revbump with it
> attached?

That would mean we would have to carry it indefinitely, if you are interesting in having it applied, as a next step, could you please bring up the relevant discussion again upstream with some arguments for why it should be applied?
Comment 8 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-12-22 17:46:25 UTC
(In reply to Kristian Fiskerstrand from comment #7)
> (In reply to Aaron W. Swenson from comment #6)
> > I ran into this same issue with 1.8.2. The attached patch worked for me.
> > 
> > Since upstream decided not to include it, can we get a revbump with it
> > attached?
> 
> That would mean we would have to carry it indefinitely, if you are
> interesting in having it applied, as a next step, could you please bring up
> the relevant discussion again upstream with some arguments for why it should
> be applied?

Which gcc version are you using, or preferably a full emerge --info? as I recall this isn't an issue with newer versions of gcc