OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Toolchain
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version openwrt-19.07
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Nikolai Zhubr - 13.05.2021

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

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.

Nikolai Zhubr commented on 13.05.2021 17:31

* meant 19.07.7

Nikolai Zhubr commented on 13.05.2021 18:16

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...

Nikolai Zhubr commented on 13.05.2021 20:17

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.

Nikolai Zhubr commented on 13.05.2021 21:02

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

Project Manager
Baptiste Jonglez commented on 14.05.2021 21:12

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.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing