LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
LinkBack Search this Thread
Old 03-17-2013, 03:30 PM   #1
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 301

Rep: Reputation: 59
Problems compiling curl in toolchain


I just started with lfs 7.3. I have compiled the toolchain and want to compile pacman inside the toolchain, to install the whole system with pacman. I did that with 7.2. The needed extra packages are: zlib openssl libarchive curl pacman, in that order. I have problems with curl. I tried both version 7.29.0 and 7.28.1, which I used successfully in 7.2, and both gives the same error.

For some reason ld is looking for librtmp.so.0, which belongs to rtmpdump, but it should _not_ add support for it. From my buildlog:
Code:
[...]
checking for RTMP_Init in -lrtmp... yes
checking librtmp/rtmp.h usability... no
checking librtmp/rtmp.h presence... no
checking for librtmp/rtmp.h... no
[...]
configure: Configured to build curl/libcurl:

  curl version:     7.29.0
  Host setup:       x86_64-unknown-linux-gnu
  Install prefix:   /tools
  Compiler:         gcc
  SSL support:      enabled (OpenSSL)
  SSH support:      no      (--with-libssh2)
  zlib support:     enabled
  krb4 support:     no      (--with-krb4*)
  GSSAPI support:   no      (--with-gssapi)
  SPNEGO support:   no      (--with-spnego)
  TLS-SRP support:  enabled
  resolver:         default (--enable-ares / --enable-threaded-resolver)
  ipv6 support:     no      (--enable-ipv6)
  IDN support:      no      (--with-{libidn,winidn})
  Build libcurl:    Shared=yes, Static=no
  Built-in manual:  enabled
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors:   enabled (--disable-verbose)
  SSPI support:     no      (--enable-sspi)
  ca cert bundle:   /etc/ssl/certs/ca-certificates.crt
  ca cert path:     no
  LDAP support:     no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)
  LDAPS support:    no      (--enable-ldaps)
  RTSP support:     enabled
  RTMP support:     no      (--with-librtmp)
  metalink support: no      (--with-libmetalink)
  Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP

[...]

/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../x86_64-unknown-linux-gnu/bin/ld: warning: librtmp.so.0, needed by ../lib/.libs/libcurl.so, not found (try using -rpath or -rpath-link)
curl-tool_util.o: In function `tool_tvnow':
tool_util.c:(.text+0xf): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make[2]: *** [curl] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/curl-7.29.0/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/curl-7.29.0/src'
make: *** [all-recursive] Error 1
I ran ldd on that file:
Code:
lfs:/mnt/lfs/sources$ ldd /mnt/lfs/sources/curl-7.29.0/lib/.libs/libcurl.so
	linux-vdso.so.1 (0x00007fff3cb10000)
	librtmp.so.0 => not found
	libssl.so.1.0.0 => /tools/lib/libssl.so.1.0.0 (0x00007f7db880a000)
	libcrypto.so.1.0.0 => /tools/lib/libcrypto.so.1.0.0 (0x00007f7db8427000)
	libz.so.1 => /tools/lib/libz.so.1 (0x00007f7db8210000)
	libc.so.6 => /tools/lib/libc.so.6 (0x00007f7db7e62000)
	libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f7db7c5d000)
	libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f7db7a48000)
	/tools/lib64/ld-linux-x86-64.so.2 (0x00007f7db8ccb000)
That is quite different than libcurl.so in 7.2, both the one in the toolchain and the one in the final system (i.e. the host)
Code:
lfs:/mnt/lfs/sources$ ldd /home/user/Data/tmp/libcurl.so.4.3.0 
	linux-vdso.so.1 (0x00007ffffbbff000)
	librt.so.1 => /tools/lib/librt.so.1 (0x00007fe20b81a000)
	libssl.so.1.0.0 => /tools/lib/libssl.so.1.0.0 (0x00007fe20b5b0000)
	libcrypto.so.1.0.0 => /tools/lib/libcrypto.so.1.0.0 (0x00007fe20b1cd000)
	libz.so.1 => /tools/lib/libz.so.1 (0x00007fe20afb6000)
	libc.so.6 => /tools/lib/libc.so.6 (0x00007fe20ac08000)
	libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007fe20a9ea000)
	/tools/lib64/ld-linux-x86-64.so.2 (0x00007fe20bc79000)
	libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fe20a7e6000)
	libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007fe20a5d1000)
According to the log from my previous build it uses the exact same configure option. The only difference was that rtmpdump was not installed in the host (Slackware), so it said:
Code:
checking for RTMP_Init in -lrtmp... no
The build instructions I use are:
Code:
patch -Np1 -i ../curl-7.29.0-upstream_fixes-1.patch
sed -i '/--static-libs)/{N;s#echo .*#echo #;}' curl-config.in

./configure --prefix=/tools --disable-static  
make
make install
Except from the patch, that is the exact same as I used in 7.2.

So, what is wrong? Why is it looking for rtmpdump's shared library?
 
Old 03-18-2013, 11:21 AM   #2
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 301

Original Poster
Rep: Reputation: 59
So this was actually 2 problems. One was that curl wanted to use rtmpdump's shared library when it was installed. I solved that by temporarily remove rtmpdump. (Having a packagemanager is great. )

The second problem was about the error
Code:
curl-tool_util.o: In function `tool_tvnow':
tool_util.c:(.text+0xf): undefined reference to `clock_gettime'
Google showed me a lot of questions about that error. Most of them said one should use '-lrt', but I didn't understand how to use it when I didn't run gcc manually, as in the examples. A few errors later, what finally worked, was that I first run:
Code:
export LIBS=-lrt
and then run my buildscript. Then it compiled.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compiling eglibc with Linaro toolchain ammayappan Linux - Embedded & Single-board computer 7 02-07-2012 01:40 AM
[SOLVED] Cross compiling software for arm with a proprietary toolchain prushik Linux - Software 6 03-17-2011 01:38 PM
cross compiling a driver on fedora12-i686 for the target ppc860 using ELDK toolchain saidi08 Linux - Newbie 1 01-01-2011 09:42 AM
Cross compiling GNU toolchain. pwrichards Linux - Newbie 0 11-30-2007 07:41 AM
Building cross-compiling toolchain radhapriya Linux - Software 1 06-25-2004 12:01 AM


All times are GMT -5. The time now is 12:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration