Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 581402

Summary: Compiling dev-libs/libgcrypt-1.7.0 with gcc-4* and -O[23] CFLAGS fails with "undefined reference to `__warn_memset_zero_len'"
Product: Gentoo Linux Reporter: Peter Levine <plevine457>
Component: Current packagesAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED NEEDINFO    
Severity: normal CC: k_f, plevine457, tdalman
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
libgcrypt-1.7.0.ebuild.patch

Description Peter Levine 2016-04-27 22:49:40 UTC
Using -O2 or -O3 CFLAGS and compiling with x86_64-pc-linux-gnu-gcc-4.9.2 or cross-compiling with armv7a-hardfloat-linux-gnueabi-gcc-4.9.2 causes failure in the compile phase with error "./.libs/libgcrypt.so: undefined reference to `__warn_memset_zero_len'". This is a known problem with gcc-4*. It builds fine with -O1 or when using gcc-5*.
Comment 1 Peter Levine 2016-04-27 22:51:05 UTC
Created attachment 432352 [details]
emerge --info
Comment 2 Peter Levine 2016-04-27 22:57:26 UTC
Created attachment 432354 [details, diff]
libgcrypt-1.7.0.ebuild.patch

Patch for libgcrypt-1.7.0.ebuild to change -O? to -O1 when using gcc-4*
Comment 3 Kristian Fiskerstrand (RETIRED) gentoo-dev 2016-06-17 20:48:42 UTC
(In reply to Peter Levine from comment #2)
> Created attachment 432354 [details, diff] [details, diff]
> libgcrypt-1.7.0.ebuild.patch
> 
> Patch for libgcrypt-1.7.0.ebuild to change -O? to -O1 when using gcc-4*

(In reply to Peter Levine from comment #0)
> Using -O2 or -O3 CFLAGS and compiling with x86_64-pc-linux-gnu-gcc-4.9.2 or
> cross-compiling with armv7a-hardfloat-linux-gnueabi-gcc-4.9.2 causes failure
> in the compile phase with error "./.libs/libgcrypt.so: undefined reference
> to `__warn_memset_zero_len'". This is a known problem with gcc-4*. It builds
> fine with -O1 or when using gcc-5*.

its not a generic issue, I'm building it successfully with -O2 and gcc 4.9.3. Do you have any references for the known issues? Also, please add configure and build logs
Comment 4 Mark Tomich 2016-06-23 10:05:44 UTC
(In reply to Peter Levine from comment #0)
> Using -O2 or -O3 CFLAGS and compiling with x86_64-pc-linux-gnu-gcc-4.9.2 or
> cross-compiling with armv7a-hardfloat-linux-gnueabi-gcc-4.9.2 causes failure
> in the compile phase with error "./.libs/libgcrypt.so: undefined reference
> to `__warn_memset_zero_len'". This is a known problem with gcc-4*. It builds
> fine with -O1 or when using gcc-5*.

Like Peter, I can't compile libgcrypt with gcc v4.9.3 and -O2.  However -O1 works.
Comment 5 Kristian Fiskerstrand (RETIRED) gentoo-dev 2016-06-23 10:14:31 UTC
(In reply to Mark Tomich from comment #4)
> (In reply to Peter Levine from comment #0)
> > Using -O2 or -O3 CFLAGS and compiling with x86_64-pc-linux-gnu-gcc-4.9.2 or
> > cross-compiling with armv7a-hardfloat-linux-gnueabi-gcc-4.9.2 causes failure
> > in the compile phase with error "./.libs/libgcrypt.so: undefined reference
> > to `__warn_memset_zero_len'". This is a known problem with gcc-4*. It builds
> > fine with -O1 or when using gcc-5*.
> 
> Like Peter, I can't compile libgcrypt with gcc v4.9.3 and -O2.  However -O1
> works.

Can you provide details as requested in comment 3?
Comment 6 Kristian Fiskerstrand (RETIRED) gentoo-dev 2016-07-11 11:30:28 UTC
(In reply to Kristian Fiskerstrand from comment #5)
> (In reply to Mark Tomich from comment #4)
> > (In reply to Peter Levine from comment #0)
> > > Using -O2 or -O3 CFLAGS and compiling with x86_64-pc-linux-gnu-gcc-4.9.2 or
> > > cross-compiling with armv7a-hardfloat-linux-gnueabi-gcc-4.9.2 causes failure
> > > in the compile phase with error "./.libs/libgcrypt.so: undefined reference
> > > to `__warn_memset_zero_len'". This is a known problem with gcc-4*. It builds
> > > fine with -O1 or when using gcc-5*.
> > 
> > Like Peter, I can't compile libgcrypt with gcc v4.9.3 and -O2.  However -O1
> > works.
> 
> Can you provide details as requested in comment 3?

Closing needinfo, reopen if able to reproduce and provide needed debug details as requested