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

FS#3810 - Build of x86_64 target fails on x86_64 host (libtool erroneously picks /usr/lib64/libc.so) #7002

Open
openwrt-bot opened this issue May 13, 2021 · 5 comments
Labels
flyspray release/19.07 toolchain

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented May 13, 2021

zhubr:

I'm building openwrt 19.08.7 x86_64 target on an x86_64 linux box, and building fails in libpcre, with a libtool complaining that it tried to relink libpcreposix.la, and for that it found /usr/lib64/libc.so with an invalid ELF header. The complaint is true somewhat, because indeed /usr/lib64/libc.so is not an ELF on my system, but obviously it should not even be trying to pick a local system library at the first place.

There is a very old similar bugreport (solved long ago) --
https://dev.archive.openwrt.org/ticket/8399

Note: 32-bit x86 builds complete successfully on this same box.

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 13, 2021

zhubr:

  • meant 19.07.7

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 13, 2021

zhubr:

Uh, apparently the problem is quite an opposite to what I initially supposed. The failure happens in libtool at this step:

(cd .libs && rm -f libpcreposix.so.0.0.6U && mv -f libpcreposix.so.0.0.6 libpcreposix.so.0.0.6U)
mv: error while loading shared libraries: /usr/lib64/libc.so: invalid ELF header

So apparenly the system 'mv' command fails to operate, likely because libtool attempted to prevent finding local system libraries so much that even 'mv' somehow starts failing. Maybe have to look at some env vars...

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 13, 2021

zhubr:

Ok, found it.
My system 'mv' binary uses system libpcre.so and the system does not employ rpath.
Therefore, after changing to pcre/.libs (see above), 'mv' attempts to link against pcre/.libs/libpcre.so instead of regular libpcre.so and fails.
Not yet sure how to properly fix it though.

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 13, 2021

zhubr:

Ok, I've created some fix.
Not sure how good it is but it works for me here. See patch attached.

190-fix-more-libtool.patch

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 14, 2021

bjonglez:

See https://openwrt.org/submitting-patches

Note that changes to 19.07 need a very good reason to get accepted, but you can start by submitting a fix for the master branch.

@aparcar aparcar added release/19.07 toolchain labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray release/19.07 toolchain
Projects
None yet
Development

No branches or pull requests

2 participants