Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Failed static build net-ftp/lftp-4.9.2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
losinka
n00b
n00b


Joined: 15 Jan 2022
Posts: 4

PostPosted: Sun Jan 16, 2022 9:14 pm    Post subject: [SOLVED] Failed static build net-ftp/lftp-4.9.2 Reply with quote

Help, please. I can't build static net-ftp/lftp-4.9.2 - it crashes on configure, complaining about missing of readline library. But readline, as well as all the other libraries needed for static build, is present. Other packages like tmux, tar, hping-3, mtr, dbus, bash, etc are built without problems.

Code:

...
checking for Readline headers in /usr/include/readline... found
checking for Readline libraries... not found
checking for Readline... no
configure: error: cannot find readline library, install readline-devel package

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/net-ftp/lftp-4.9.2/work/lftp-4.9.2/config.log
 * ERROR: net-ftp/lftp-4.9.2::gentoo failed (configure phase):
 *   econf failed
 *
 * Call stack:
 *               ebuild.sh, line  127:  Called src_configure
 *             environment, line 1620:  Called econf '--enable-ipv6' '--enable-nls' '--with-libidn2' '--without-socksdante' '--with-openssl=/usr' '--without-gnutls' '--enable-packager-mode' '--sysconfdir=/etc/lftp' '--with-modules' '--with-readline=/usr' '--without-included-regex'
 *        phase-helpers.sh, line  711:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=net-ftp/lftp-4.9.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-ftp/lftp-4.9.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-ftp/lftp-4.9.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-ftp/lftp-4.9.2/temp/environment'.
 * Working directory: '/var/tmp/portage/net-ftp/lftp-4.9.2/work/lftp-4.9.2'
 * S: '/var/tmp/portage/net-ftp/lftp-4.9.2/work/lftp-4.9.2'

>>> Failed to emerge net-ftp/lftp-4.9.2, Log file:

>>>  '/var/tmp/portage/net-ftp/lftp-4.9.2/temp/build.log'


profile: default/linux/amd64/17.0/musl (exp)

/var/tmp/portage/net-ftp/lftp-4.9.2/temp/build.log

/var/tmp/portage/net-ftp/lftp-4.9.2/work/lftp-4.9.2/config.log

emerge --info '=net-ftp/lftp-4.9.2::gentoo'

/var/tmp/portage/net-ftp/lftp-4.9.2/temp/environment

ll /usr/lib

Thanks.


Last edited by losinka on Mon Jan 17, 2022 5:50 pm; edited 2 times in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21586

PostPosted: Sun Jan 16, 2022 10:28 pm    Post subject: Re: Failed static build net-ftp/lftp-4.9.2 Reply with quote

losinka wrote:
Help, please. I can't build static net-ftp/lftp-4.9.2
Why are you trying to build this as a statically linked program? That is not generally as well supported. The usual way to build something as a static program is to set USE=static, so that Portage can arrange for the appropriate supporting static libraries to be installed and appropriate flags to be passed. Often, supporting static libraries are not by default, because they are rarely needed. This particular package lacks USE=static, which is a hint that it it not well supported.
losinka wrote:
it crashes on configure, complaining about missing of readline library. But readline, as well as all the other libraries needed for static build, is present.
From your config.log:
/var/tmp/portage/net-ftp/lftp-4.9.2/work/lftp-4.9.2/config.log:
configure:57338: checking for Readline libraries
configure:57366: x86_64-gentoo-linux-musl-g++ -o conftest -O2 -pipe -static -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines  -I/usr/include/readline -Wl,-O1 -Wl,--as-needed -L/usr/lib conftest.cpp -ltinfo  -lreadline >&5
/usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: /usr/lib/libreadline.a(display.o): in function `_rl_move_cursor_relative':
(.text+0xea3): undefined reference to `tputs'
More undefined references follow, but even one is fatal. Your readline.a can only be linked if the caller also then links to a library that provides tputs (and the other symbols needed; see your log for the full list). For a dynamic library, readline.so would have a DT_NEEDED entry to automatically link to the dynamic library that provides the needed symbols. For a static library, it is your responsibility to link in the supporting symbols.
losinka wrote:
profile: default/linux/amd64/17.0/musl (exp)
Why are you using musl?
emerge --info '=net-ftp/lftp-4.9.2::gentoo':
CFLAGS="-O2 -pipe -static"
While this may work in some cases, it will likely cause other problems as you continue.
Back to top
View user's profile Send private message
losinka
n00b
n00b


Joined: 15 Jan 2022
Posts: 4

PostPosted: Sun Jan 16, 2022 11:21 pm    Post subject: Reply with quote

Quote:
Why are you trying to build this as a statically linked program? That is not generally as well supported.

I know, but I need it for my other host (storage).

Quote:
While this may work in some cases, it will likely cause other problems as you continue.

I do this for a static build only. By default I remove the "-static" from CFLAGS etc.

Quote:
Why are you using musl?

This lib is not so fat.

Quote:
More undefined references follow, but even one is fatal. Your readline.a can only be linked if the caller also then links to a library that provides tputs (and the other symbols needed; see your log for the full list). For a dynamic library, readline.so would have a DT_NEEDED entry to automatically link to the dynamic library that provides the needed symbols. For a static library, it is your responsibility to link in the supporting symbols.

Thank you very much! It's already a step forward.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21586

PostPosted: Sun Jan 16, 2022 11:54 pm    Post subject: Reply with quote

You are building this on one system, and then copying it somewhere else? Is the other host built on an incompatible libc?

If you remove -static from CFLAGS, then I think you are doing using the package manager inefficiently. You would be better off using package.env to tell Portage to apply the flags to those packages where you want it, rather than explicitly adding and removing the flag in make.conf for different packages.

Be aware that programs are often not tested as extensively on musl. You may encounter build failures on musl that would not happen when using glibc. Such failures are worth fixing, but you will spend more effort trying to make a system use musl than you would using glibc.
Back to top
View user's profile Send private message
losinka
n00b
n00b


Joined: 15 Jan 2022
Posts: 4

PostPosted: Mon Jan 17, 2022 8:28 am    Post subject: Reply with quote

Quote:
You are building this on one system, and then copying it somewhere else?

Yes (--buildpkgonly).

Quote:
Is the other host built on an incompatible libc?

My storage (Qnap) has a musl. The OS there is very truncated and I'm missing certain binaries (utils).

Quote:
If you remove -static from CFLAGS, then I think you are doing using the package manager inefficiently. You would be better off using package.env to tell Portage to apply the flags to those packages where you want it, rather than explicitly adding and removing the flag in make.conf for different packages.

I use "-static" for a emerge -v --buildpkgonly... only. I don't need "-static" in other cases.
Back to top
View user's profile Send private message
losinka
n00b
n00b


Joined: 15 Jan 2022
Posts: 4

PostPosted: Mon Jan 17, 2022 1:58 pm    Post subject: Reply with quote

Solved. LIBS="-l:libreadline.a -l:libncursesw.a -l:libtinfo.a -l:libidn2.a -l:libunistring.a" solves it.

@Hu: thank you, thank you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum