OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • 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/

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, and for that it found /usr/lib64/ with an invalid ELF header. The complaint is true somewhat, because indeed /usr/lib64/ 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) –

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 && mv -f
mv: error while loading shared libraries: /usr/lib64/ 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 and the system does not employ rpath.
Therefore, after changing to pcre/.libs (see above), 'mv' attempts to link against pcre/.libs/ instead of regular 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.


Project Manager
Baptiste Jonglez commented on 14.05.2021 21:12


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.


Available keyboard shortcuts


Task Details

Task Editing