Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

libdl seems not linked when using ulibc ARM stage3

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
Author
Message
destroyedlolo
l33t
l33t
Posts: 846
Joined: Fri Jun 17, 2011 10:28 am
Location: Close to Annecy (France)
Contact:
Contact destroyedlolo
Website

libdl seems not linked when using ulibc ARM stage3

  • Quote

Post by destroyedlolo » Mon Sep 21, 2015 8:55 am

Hello,

I'm installing Gentoo on a AllWinner A13 powered tablet.

I did 2 images, both containing the same packages. One using the standard "glibc" stage3-armv7a_hardfp image, another one using stage3-armv7a_hardfp-uclibc-vanilla.

I don't have any trouble with glibc one, but some packages are falling to build on uLibc one, because it seems dl library is not linked by default.

As example, Lua is falling with following error :

Code: Select all

libtool --quiet --tag=CC --mode=link armv7a-hardfloat-linux-uclibceabi-gcc -export-dynamic -Wl,-O1 -Wl,--as-needed -o lua lua.lo liblua.la -lreadline
libtool --quiet --tag=CC --mode=link armv7a-hardfloat-linux-uclibceabi-gcc -static -export-dynamic -Wl,-O1 -Wl,--as-needed -o lua_test lua.lo liblua.la -lreadline
./.libs/liblua.so: undefined reference to `dlerror'
./.libs/liblua.so: undefined reference to `dlclose'
./.libs/liblua.so: undefined reference to `dlopen'
./.libs/liblua.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
Makefile:201: recipe for target 'lua' failed
Why this difference, and what is the correct way to correct this issue ?

Thanks

Laurent
Top
steveL
Watchman
Watchman
Posts: 5153
Joined: Wed Sep 13, 2006 1:18 pm
Location: The Peanut Gallery

  • Quote

Post by steveL » Thu Nov 26, 2015 6:29 pm

I don't have any trouble with glibc one, but some packages are falling to build on uLibc one, because it seems dl library is not linked by default.
If your analysis is correct, then this is a bug in the upstream (build-system for the) software; though it can be worked-round by adding -ldl to LDFLAGS in the ebuild.
In general, what flag to use would be checked-for by the configure script, usually autoconf-generated.

Code: Select all

<mira> µClibc can do libdl, not sure whether -ldl is required.
Your example, lua, has a very simple build-system, afair.

For a quick workaround, you would [post=513780]use package.env[/post] to add the value to LDFLAGS for whichever packages required it; then you would be in a position to report a bug for those, stating that adding -ldl to LDFLAGS fixes the issue at your end, so the maintainer can look at the specific build-system and feed a minor patch upstream.

So check if adding -ldl to LDFLAGS for lua works first:
/etc/portage/env/ldl.conf

Code: Select all

LDFLAGS="$LDFLAGS -ldl"
/etc/portage/package.env

Code: Select all

dev-lang/lua  ldl.conf
HTH,
steveL
Top
destroyedlolo
l33t
l33t
Posts: 846
Joined: Fri Jun 17, 2011 10:28 am
Location: Close to Annecy (France)
Contact:
Contact destroyedlolo
Website

  • Quote

Post by destroyedlolo » Fri Nov 27, 2015 10:55 am

Hello,

I solved the issue by adding -ldl directly in make.conf
If your analysis is correct, then this is a bug in the upstream (build-system for the) software; though it can be worked-round by adding -ldl to LDFLAGS in the ebuild.
In general, what flag to use would be checked-for by the configure script, usually autoconf-generated.
In this case, why it's working when I'm not using ulibc environment ?

Bye

Laurent
Top
steveL
Watchman
Watchman
Posts: 5153
Joined: Wed Sep 13, 2006 1:18 pm
Location: The Peanut Gallery

  • Quote

Post by steveL » Fri Nov 27, 2015 4:19 pm

steveL wrote:If your analysis is correct, then this is a bug in the upstream (build-system for the) software; though it can be worked-round by adding -ldl to LDFLAGS in the ebuild.
destroyedlolo wrote:I solved the issue by adding -ldl directly in make.conf
Cool.
In general, what flag to use would be checked-for by the configure script, usually autoconf-generated.
In this case, why it's working when I'm not using ulibc environment ?
Because it is not always needed, depending on the platform, which may not support dlsym at all; ergo it gets sorted out in configure.ac.

POSIX does not mandate -ldl, so strictly speaking it should not be required on a POSIX-compliant system. cf: man c99
So glibc provides it in libc, which is always searched, but may be specified early.

Nonetheless, that is precisely the role of a configure script: to establish what is supported, and whether eg: -ldl needs to be added, or not, or its functionality is unsupported.
Top
destroyedlolo
l33t
l33t
Posts: 846
Joined: Fri Jun 17, 2011 10:28 am
Location: Close to Annecy (France)
Contact:
Contact destroyedlolo
Website

  • Quote

Post by destroyedlolo » Sat Nov 28, 2015 4:41 pm

Ok, thanks for your explanation.

Next time I'll update my tablet, I'll note failing packages and open ticket for them.

Bye

Laurent
Top
steveL
Watchman
Watchman
Posts: 5153
Joined: Wed Sep 13, 2006 1:18 pm
Location: The Peanut Gallery

  • Quote

Post by steveL » Sun Nov 29, 2015 3:51 pm

destroyedlolo wrote:Ok, thanks for your explanation.

Next time I'll update my tablet, I'll note failing packages and open ticket for them.
You're welcome :-)

That's all anyone could ask, so thanks.
Top
Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic