Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
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.


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

Rep: Reputation: 72
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, which belongs to rtmpdump, but it should _not_ add support for it. From my buildlog:
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)


/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../x86_64-unknown-linux-gnu/bin/ld: warning:, needed by ../lib/.libs/, 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:
lfs:/mnt/lfs/sources$ ldd /mnt/lfs/sources/curl-7.29.0/lib/.libs/ (0x00007fff3cb10000) => not found => /tools/lib/ (0x00007f7db880a000) => /tools/lib/ (0x00007f7db8427000) => /tools/lib/ (0x00007f7db8210000) => /tools/lib/ (0x00007f7db7e62000) => /tools/lib/ (0x00007f7db7c5d000) => /tools/lib/ (0x00007f7db7a48000)
	/tools/lib64/ (0x00007f7db8ccb000)
That is quite different than in 7.2, both the one in the toolchain and the one in the final system (i.e. the host)
lfs:/mnt/lfs/sources$ ldd /home/user/Data/tmp/ (0x00007ffffbbff000) => /tools/lib/ (0x00007fe20b81a000) => /tools/lib/ (0x00007fe20b5b0000) => /tools/lib/ (0x00007fe20b1cd000) => /tools/lib/ (0x00007fe20afb6000) => /tools/lib/ (0x00007fe20ac08000) => /tools/lib/ (0x00007fe20a9ea000)
	/tools/lib64/ (0x00007fe20bc79000) => /tools/lib/ (0x00007fe20a7e6000) => /tools/lib/ (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:
checking for RTMP_Init in -lrtmp... no
The build instructions I use are:
patch -Np1 -i ../curl-7.29.0-upstream_fixes-1.patch
sed -i '/--static-libs)/{N;s#echo .*#echo #;}'

./configure --prefix=/tools --disable-static  
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
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 346

Original Poster
Rep: Reputation: 72
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
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:
export LIBS=-lrt
and then run my buildscript. Then it compiled.


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

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 > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

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