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

Bug 492752

Summary: net-libs/gnutls-3.2.7 build failure on arm, amd64-fbsd: undefined reference to `rpl_strerror'
Product: Gentoo Linux Reporter: Chí-Thanh Christopher Nguyễn <chithanh>
Component: [OLD] LibraryAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl, bsd+disabled, jeanfrancis, taborda, zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 492522    
Attachments: build.log
Build failure on ARM
ARM config.log
strerror-test.c
strerror-test.c
Proposed patch coming from an upstream commit
x86_64 config.log

Description Chí-Thanh Christopher Nguyễn gentoo-dev 2013-11-28 00:58:00 UTC
Created attachment 364110 [details]
build.log

net-libs/gnutls-3.2 no longer builds on amd64-fbsd. This is a regression from 3.1.10, which builds fine using the old ebuild from the CVS attic.

libtool: link: x86_64-gentoo-freebsd9.1-gcc -O2 -pipe -march=btver1 -o ex-client
-dtls ex-client-dtls.o  ./.libs/libexamples.a ../../lib/.libs/libgnutls.so -L/us
r/lib -lz -lrt -lhogweed -lnettle -lgmp ../../gl/.libs/libgnu.a /usr/lib/libicon
v.so -lintl -Wl,-rpath -Wl,/var/tmp/portage/net-libs/gnutls-3.2.7/work/gnutls-3.
2.7/lib/.libs
../../lib/.libs/libgnutls.so: undefined reference to `rpl_strerror'
Comment 1 Jean-Francis Roy 2013-11-29 02:38:22 UTC
I can reproduce this bug on ARMv7 architecture.

This is a Funtoo installation, but this package has no changes, and is certainly reproducible on an ARMv7 Gentoo installation.

I will attach my build.log, if that can help.
Comment 2 Jean-Francis Roy 2013-11-29 02:38:47 UTC
Created attachment 364168 [details]
Build failure on ARM
Comment 3 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 19:40:31 UTC
Hi,

I need the config.log to see why strerr was not detected to be supported.

Thanks!
Comment 4 Jean-Francis Roy 2013-11-29 21:45:49 UTC
Created attachment 364224 [details]
ARM config.log

Here is mine. I had to gzip it, bugzilla didn't like its size!
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 22:01:36 UTC
configure:19924: armv7a-hardfloat-linux-gnueabi-gcc -c -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  conftest.c >&5
conftest.c:224:21: error: conflicting types for 'strerror_r'
/usr/include/string.h:438:14: note: previous declaration of 'strerror_r' was here
configure:19924: $? = 1

Can you please attach /usr/include/string.h around the line 438 so I can see the prototype of strerror_r as it is at your side?
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 22:16:04 UTC
(In reply to Alon Bar-Lev from comment #5)
> configure:19924: armv7a-hardfloat-linux-gnueabi-gcc -c -O2 -pipe
> -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  conftest.c >&5
> conftest.c:224:21: error: conflicting types for 'strerror_r'
> /usr/include/string.h:438:14: note: previous declaration of 'strerror_r' was
> here
> configure:19924: $? = 1
> 
> Can you please attach /usr/include/string.h around the line 438 so I can see
> the prototype of strerror_r as it is at your side?

No need.
Comment 7 Jean-Francis Roy 2013-11-29 22:19:40 UTC
Just in case :

#   define strerror_r __xpg_strerror_r
#  endif
# else
/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
   used.  */
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __THROW __nonnull ((2));
# endif
#endif
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 22:22:17 UTC
Created attachment 364230 [details]
strerror-test.c

This is the test that fails for you, you get status 2 which means that even there is not enough buffer, something is returned.

Please try to run the program and let's see what you got.
Comment 9 Jean-Francis Roy 2013-11-29 22:25:38 UTC
It seems it runs without issue : 

⇒  gcc test.c && ./a.out
00
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 22:27:03 UTC
(In reply to Jean-Francis Roy from comment #9)
> It seems it runs without issue : 
> 
> ⇒  gcc test.c && ./a.out
> 00

hmmm... from config.log:

configure:20012: checking whether __xpg_strerror_r works
configure:20052: armv7a-hardfloat-linux-gnueabi-gcc -o conftest -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
configure:20052: $? = 0
configure:20052: ./conftest
configure:20052: $? = 2
configure: program exited with status 2

Can you please run with exact parameters?
Comment 11 Jean-Francis Roy 2013-11-29 22:30:48 UTC
Strange!

⇒  armv7a-hardfloat-linux-gnueabi-gcc -o conftest -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  -Wl,-O1 -Wl,--as-needed test.c && ./conftest 
00


I got to go for a while, but I will check this out again when I get back...
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-29 22:36:33 UTC
Created attachment 364232 [details]
strerror-test.c

try this one...
Comment 13 Jean-Francis Roy 2013-11-29 23:17:47 UTC
⇒  armv7a-hardfloat-linux-gnueabi-gcc -o conftest -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  -Wl,-O1 -Wl,--as-needed test2.c && ./conftest                   
00

Same thing...
Comment 14 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-30 00:36:28 UTC
(In reply to Jean-Francis Roy from comment #13)
> ⇒  armv7a-hardfloat-linux-gnueabi-gcc -o conftest -O2 -pipe -march=armv7-a
> -mfpu=vfpv3-d16 -mfloat-abi=hard  -Wl,-O1 -Wl,--as-needed test2.c &&
> ./conftest                   
> 00
> 
> Same thing...

I need your help reproducing this. Build outside of portage, reproduce, copy paste the conftest.c content and try to make it fail. Only when we have predictable reproduction can we progress.
Comment 16 Jean-Francis Roy 2013-12-03 20:05:29 UTC
Created attachment 364556 [details, diff]
Proposed patch coming from an upstream commit
Comment 17 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-03 20:07:40 UTC
(In reply to Jean-Francis Roy from comment #16)
> Created attachment 364556 [details, diff] [details, diff]
> Proposed patch coming from an upstream commit

Great.

Too large patch for apply just because of this, we will wait for next version.

In the meantime, can you please check if CPPFLAGS="-Drpl_strerror=strerror" works for you?
Comment 18 Jean-Francis Roy 2013-12-03 20:22:14 UTC
It does work, indeed!
Comment 19 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-03 20:27:08 UTC
(In reply to Jean-Francis Roy from comment #18)
> It does work, indeed!

Please use this workaround until we get proper release from upstream.

For now you can put it at:

/etc/portage/env/net-libs/gnutls
---
CPPFLAGS="-Drpl_strerror=strerror"
---
Comment 20 Jean-Francis Roy 2013-12-03 20:29:43 UTC
I will do this, thanks!
Comment 21 Rick Farina (Zero_Chaos) gentoo-dev 2013-12-08 04:57:26 UTC
(In reply to Alon Bar-Lev from comment #19)
> (In reply to Jean-Francis Roy from comment #18)
> > It does work, indeed!
> 
> Please use this workaround until we get proper release from upstream.
> 
> For now you can put it at:
> 
> /etc/portage/env/net-libs/gnutls
> ---
> CPPFLAGS="-Drpl_strerror=strerror"
> ---

If this is the suggested fix why not just add it to the ebuild?
Comment 22 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-08 07:31:23 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #21)
> If this is the suggested fix why not just add it to the ebuild?

Because we could not find the root cause, as manually executing the autoconf test is working, so there might be something wrong.

And there is no other users for that platform that reported same issue.

And there is a confirmed upstream fix pending to next release.

So as long this does not effects many people and as long as I do not completely understand what the problem is, I prefer not to commit anything in this regard.
Comment 23 Joao Taborda 2013-12-09 01:14:55 UTC
I'm having the same problem with gnutls-3.2.7 on amd64

CPPFLAGS="-Drpl_strerror=strerror" does not solve the problem


emerge --info:
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.3.2, glibc-2.12.2, 2.6.32-042stab083.2 x86_64)
=================================================================
System uname: Linux-2.6.32-042stab083.2-x86_64-Intel-R-_Core-TM-_i7-3820_CPU_@_3.60GHz-with-gentoo-2.0.1
KiB Mem:     1048576 total,     82580 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sun, 08 Dec 2013 23:30:01 +0000
ld GNU ld (GNU Binutils) 2.21
ccache version 3.1.4 [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.5.2-r8::funtoo, 2.7.1, 3.1.3, 3.2.3-r2, 3.3.3
dev-util/ccache:          3.1.4
dev-util/cmake:           2.8.3-r1
sys-apps/baselayout:      2.0.1-r1
sys-apps/openrc:          0.7.0
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.2::funtoo, 1.11.1, 1.13.1
sys-devel/binutils:       2.21
sys-apps/openrc:          0.7.0
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.2::funtoo, 1.11.1, 1.13.1
sys-devel/binutils:       2.21
sys-devel/gcc:            4.3.2::funtoo, 4.5.2
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo local
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="X acl amd64 apache2 bash-completion berkdb bzip2 cairo cli consolekit cracklib crypt ctype curl cxx dri fortran gd gdbm gif git iconv imlib ipv6 jpeg jpeg2k mmx modules mpeg mudflap multilib mysql mysqli ncurses nls nptl openmp openvz pam pcre php png readline sdl session snmp socks5 sql sqlite sqlite3 sse sse2 ssl subversion svg tcpd tiff truetype unicode vhosts vim-syntax xml xmlrpc xpm zlib" ABI_X86="64" 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="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" 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" 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 24 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-09 18:35:07 UTC
(In reply to Joao Taborda from comment #23)
> I'm having the same problem with gnutls-3.2.7 on amd64

Please provide config.log
Comment 25 Joao Taborda 2013-12-09 21:11:15 UTC
Created attachment 365022 [details]
x86_64 config.log
Comment 26 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-09 21:18:52 UTC
Please try to run attachment#364232 [details] using:

$ x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe  -Wl,-O1 -Wl,--as-needed  strerror-test.c
$ ./conftest

Based on this log it should print non zero output.

We should find why it fails during configure.
Comment 27 Joao Taborda 2013-12-09 21:43:03 UTC
(In reply to Alon Bar-Lev from comment #26)
> Please try to run attachment#364232 [details] using:
> 
> $ x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe  -Wl,-O1 -Wl,--as-needed 
> strerror-test.c
> $ ./conftest
> 
> Based on this log it should print non zero output.
> 
> We should find why it fails during configure.

machina ~ # x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe  -Wl,-O1 -Wl,--as-needed  strerror-test.c
machina ~ # ./conftest 
00

I compared your strerror-test.c with the config.log and there is one difference that changes the result:
memset(buf, 0, sizeof(buf));

If i comment this line the output is:
machina ~ # x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe  -Wl,-O1 -Wl,--as-needed  strerror-test.c 
machina ~ # ./conftest 
Bad buffer? '^'
02
Comment 28 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-09 21:49:21 UTC
(In reply to Joao Taborda from comment #27)
> If i comment this line the output is:
> machina ~ # x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe  -Wl,-O1
> -Wl,--as-needed  strerror-test.c 
> machina ~ # ./conftest 
> Bad buffer? '^'
> 02

Great! that's a progress.
Any reason you are using old glibc while current stable is sys-libs/glibc-2.16.0?
Comment 29 Joao Taborda 2013-12-09 21:55:12 UTC
No reason. Just a VPS that is a little bit outdated. :)
Will have to update the whole system.
Comment 30 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-09 21:58:00 UTC
(In reply to Joao Taborda from comment #29)
> No reason. Just a VPS that is a little bit outdated. :)
> Will have to update the whole system.

I just wonder if that is the problem.
Comment 31 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-12-10 00:09:21 UTC
It fails even without glibc, using freebsd libc on amd64-fbsd.
Comment 32 Rick Farina (Zero_Chaos) gentoo-dev 2013-12-14 02:41:26 UTC
I just test build 3.2.7 on my arm box and can't replicate.  Am I missing something?
Comment 33 Jean-Francis Roy 2013-12-15 23:39:18 UTC
It might depend on your glibc version (that is newer than mine). Nevertheless, the package fails in many cases (older glibc, using BSD).

The issue is known upstream, and have hit many users. The patch I have attached is an upstream commit that fixes the issue, and will be available on the next version of gnutls.
Comment 34 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-27 19:03:24 UTC
Can you please check gnutls-3.2.8?
Comment 35 Joao Taborda 2013-12-28 00:37:41 UTC
gnutls-3.2.8 is ok
Comment 36 Alon Bar-Lev (RETIRED) gentoo-dev 2013-12-28 00:40:24 UTC
Thanks!