Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure on Buildroot #17

Closed
fperrad opened this issue May 28, 2015 · 7 comments
Closed

build failure on Buildroot #17

fperrad opened this issue May 28, 2015 · 7 comments

Comments

@fperrad
Copy link
Contributor

fperrad commented May 28, 2015

see this build failure on
http://autobuild.buildroot.net/results/940/9404e004ac24c5f3eedc8e7bc8afadd35983de70/build-end.log

/home/peko/autobuild/instance-2/output/host/usr/bin/i686-linux-gcc -static -lm -Wl,-E -o perl perlmain.o libperl.a lib/auto/B/B.a lib/auto/Devel/Peek/Peek.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a lib/auto/GDBM_File/GDBM_File.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/SDBM_File/SDBM_File.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a lib/auto/XS/APItest/APItest.a lib/auto/XS/Typemap/Typemap.a lib/auto/arybase/arybase.a lib/auto/attributes/attributes.a lib/auto/mro/mro.a lib/auto/re/re.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Filter/Util/Call/Call.a lib/auto/IPC/SysV/SysV.a lib/auto/MIME/Base64/Base64.a lib/auto/List/Util/Util.a lib/auto/Socket/Socket.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/Unicode/Normalize/Normalize.a lib/auto/Data/Dumper/Dumper.a lib/auto/IO/IO.a lib/auto/Math/BigInt/FastCalc/FastCalc.a lib/auto/Cwd/Cwd.a lib/auto/Storable/Storable.a lib/auto/threads/threads.a lib/auto/threads/shared/shared.a -lm -lcrypt -ldl -lgdbm -lm -lrt -lpthread -lpthread 
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setregid.os): In function `__GI_setregid':
setregid.c:(.text+0x0): multiple definition of `setregid'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setregid.os):pthread_setregid.c:(.text+0x0): first defined here
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setresgid.os): In function `__GI_setresgid':
setresgid.c:(.text+0x0): multiple definition of `setresgid'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setresgid.os):pthread_setresgid.c:(.text+0x0): first defined here
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setresuid.os): In function `__GI_setresuid':
setresuid.c:(.text+0x0): multiple definition of `setresuid'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setresuid.os):pthread_setresuid.c:(.text+0x0): first defined here
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setreuid.os): In function `__GI_setreuid':
setreuid.c:(.text+0x0): multiple definition of `setreuid'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setreuid.os):pthread_setreuid.c:(.text+0x0): first defined here
libperl.a(doio.o): In function `Perl_apply':
doio.c:(.text+0x3352): warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam':
POSIX.c:(.text+0x2c33): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
libperl.a(pp_sys.o): In function `Perl_pp_ghostent':
pp_sys.c:(.text+0x9881): warning: gethostbyaddr is obsolescent, use getaddrinfo() instead.
pp_sys.c:(.text+0x9811): warning: gethostbyname is obsolescent, use getnameinfo() instead.
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmerrno.o): In function `gdbm_strerror':
gdbmerrno.c:(.text+0x26): undefined reference to `libintl_dgettext'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmfetch.o): In function `gdbm_fetch':
gdbmfetch.c:(.text+0x69): undefined reference to `libintl_dgettext'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmseq.o): In function `get_next_key':
gdbmseq.c:(.text+0xb6): undefined reference to `libintl_dgettext'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmstore.o): In function `gdbm_store':
gdbmstore.c:(.text+0x1a2): undefined reference to `libintl_dgettext'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(bucket.o): In function `_gdbm_write_bucket':
bucket.c:(.text+0x108): undefined reference to `libintl_dgettext'
/home/peko/autobuild/instance-2/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(bucket.o):bucket.c:(.text+0x19b): more undefined references to `libintl_dgettext' follow
collect2: error: ld returned 1 exit status

the problem occurs with this setting:

  • BR2_STATIC_LIBS=y
  • and packages perl, gdbm, gettext selected

This defconfig allows to reproduce it, with buildroot-2015.05-rc3.

I have already send a related patch which only fixes a dependency issue.

@fperrad
Copy link
Contributor Author

fperrad commented May 30, 2015

with only the package perl, the build fails too, see http://autobuild.buildroot.net/results/93c/93c213edd4554f9cfe000b22c263d233e059a731/build-end.log

/ssd1/thomas/autobuild/instance-3/output/host/usr/bin/i686-linux-gcc -static -lm -Wl,-E -o perl perlmain.o libperl.a lib/auto/B/B.a lib/auto/Devel/Peek/Peek.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/SDBM_File/SDBM_File.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a lib/auto/XS/APItest/APItest.a lib/auto/XS/Typemap/Typemap.a lib/auto/arybase/arybase.a lib/auto/attributes/attributes.a lib/auto/mro/mro.a lib/auto/re/re.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Filter/Util/Call/Call.a lib/auto/IPC/SysV/SysV.a lib/auto/MIME/Base64/Base64.a lib/auto/List/Util/Util.a lib/auto/Socket/Socket.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/Unicode/Normalize/Normalize.a lib/auto/Data/Dumper/Dumper.a lib/auto/IO/IO.a lib/auto/Math/BigInt/FastCalc/FastCalc.a lib/auto/Cwd/Cwd.a lib/auto/Storable/Storable.a lib/auto/threads/threads.a lib/auto/threads/shared/shared.a -lm -lcrypt -ldl -lm -lrt -lpthread -lpthread 
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setregid.os): In function `__GI_setregid':
setregid.c:(.text+0x0): multiple definition of `setregid'
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setregid.os):pthread_setregid.c:(.text+0x0): first defined here
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setresgid.os): In function `__GI_setresgid':
setresgid.c:(.text+0x0): multiple definition of `setresgid'
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setresgid.os):pthread_setresgid.c:(.text+0x0): first defined here
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setresuid.os): In function `__GI_setresuid':
setresuid.c:(.text+0x0): multiple definition of `setresuid'
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setresuid.os):pthread_setresuid.c:(.text+0x0): first defined here
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(setreuid.os): In function `__GI_setreuid':
setreuid.c:(.text+0x0): multiple definition of `setreuid'
/ssd1/thomas/autobuild/instance-3/output/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pthread_setreuid.os):pthread_setreuid.c:(.text+0x0): first defined here
libperl.a(doio.o): In function `Perl_apply':
doio.c:(.text+0x3352): warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam':
POSIX.c:(.text+0x2c33): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
libperl.a(pp_sys.o): In function `Perl_pp_ghostent':
pp_sys.c:(.text+0x9881): warning: gethostbyaddr is obsolescent, use getaddrinfo() instead.
pp_sys.c:(.text+0x9811): warning: gethostbyname is obsolescent, use getnameinfo() instead.
collect2: error: ld returned 1 exit status

I found a workaround which is to remove pthread from libswanted in https://github.com/arsv/perl-cross/blob/master/cnf/hints/default

@arsv
Copy link
Owner

arsv commented Jun 3, 2015

Ok, fixed I think. Please try building with these patches if possible (allstatic branch).

8c217c0
59ecb92

There were two separate issues with that build actually, it configured dynaloader despite being told not to, and it built threads module with no -Dusethreads specified.

The first issue was masked because the prebuilt toolchain was not built with BR2_STATIC_LIBS, but it popped up immediately once I switched to building a local toolchain.

The second one is what caused those linking errors, but it looks like that's only a part of the problem.
If I'm not mistaken, uClibc should allow linking with -lpthread -lc, even all-static.

@fperrad
Copy link
Contributor Author

fperrad commented Jun 5, 2015

the branch allstatic fixes the problem with BR2_STATIC_LIBS=y when perl is alone.

with perl, gdbm and gettext, I still have a linking problem:

/home/fperrad/checkout/BR/build/perl/host/usr/bin/i686-linux-gcc -static -lm -Wl,-E -o perl perlmain.o libperl.a lib/auto/arybase/arybase.a lib/auto/attributes/attributes.a lib/auto/B/B.a lib/auto/Devel/Peek/Peek.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a lib/auto/GDBM_File/GDBM_File.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a lib/auto/mro/mro.a lib/auto/Opcode/Opcode.a lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/POSIX/POSIX.a lib/auto/re/re.a lib/auto/SDBM_File/SDBM_File.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Filter/Util/Call/Call.a lib/auto/IPC/SysV/SysV.a lib/auto/MIME/Base64/Base64.a lib/auto/List/Util/Util.a lib/auto/Socket/Socket.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/Unicode/Normalize/Normalize.a lib/auto/Data/Dumper/Dumper.a lib/auto/IO/IO.a lib/auto/Math/BigInt/FastCalc/FastCalc.a lib/auto/Cwd/Cwd.a lib/auto/Storable/Storable.a -lm -lcrypt -lgdbm -lm -lrt
libperl.a(doio.o): In function `Perl_apply':
doio.c:(.text+0x3352): warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam':
POSIX.c:(.text+0x2c33): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
libperl.a(pp_sys.o): In function `Perl_pp_ghostent':
pp_sys.c:(.text+0x9881): warning: gethostbyaddr is obsolescent, use getaddrinfo() instead.
pp_sys.c:(.text+0x9811): warning: gethostbyname is obsolescent, use getnameinfo() instead.
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmerrno.o): In function `gdbm_strerror':
gdbmerrno.c:(.text+0x26): undefined reference to `libintl_dgettext'
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmfetch.o): In function `gdbm_fetch':
gdbmfetch.c:(.text+0x69): undefined reference to `libintl_dgettext'
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmseq.o): In function `get_next_key':
gdbmseq.c:(.text+0xb6): undefined reference to `libintl_dgettext'
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(gdbmstore.o): In function `gdbm_store':
gdbmstore.c:(.text+0x1a2): undefined reference to `libintl_dgettext'
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(bucket.o): In function `_gdbm_write_bucket':
bucket.c:(.text+0x108): undefined reference to `libintl_dgettext'
/home/fperrad/checkout/BR/build/perl/host/usr/i686-buildroot-linux-uclibc/sysroot/usr/lib/libgdbm.a(bucket.o):bucket.c:(.text+0x19b): more undefined references to `libintl_dgettext' follow
collect2: error: ld returned 1 exit status

@arsv
Copy link
Owner

arsv commented Jun 14, 2015

If I'm not mistaken, this is not related to perl-cross at all.
When gdbm is built with NLS, it must be linked as -lgdbm -lintl, but ext/GDBM_File/Makefile.PL only requests -lgdbm.

I see two possible solutions here, either patching (conditionally) Makefile.PL for that module, or allowing -Aperllibs=... to work as expected in perl-cross and passing -Aperllibs=-lintl conditionally in perl.mk. Or maybe adding some other workaround there for perllibs.

There's a problem however, I could only get GDBM to use gettext by setting GDBM_CONF_OPTS = --enable-nls explicitly in gdbm.mk. It is not built like this by default. Can you please check how you get gettext calls in GDBM?

The config I used: https://gist.github.com/arsv/cb5f82dfec55ade37fa4

@fperrad
Copy link
Contributor Author

fperrad commented Jun 15, 2015

First, thanks for your efforts.

The branch allstatic solves most of the BR build issues. So, I think this work must be released.

For the remaining issue with gdbm, may be, try to send a patch to the Perl5 upstream.

@arsv
Copy link
Owner

arsv commented Jun 28, 2015

Ok, changes merged into master and 0.9.7 release tagged.

perl-5.22.0 support will be a separate version, it needs some unrelated changes anyway.

@fperrad
Copy link
Contributor Author

fperrad commented Jun 29, 2015

Thanks

@fperrad fperrad closed this as completed Jun 29, 2015
gevans pushed a commit to hashrabbit/buildroot that referenced this issue Jun 29, 2015
fix some build failures,
see arsv/perl-cross#17

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants