View Single Post
Old 06-08-2014, 09:34 AM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by knc1 View Post
Plan B:
Submit bug report to BR project about ld.so rpath tokens in 'Target Linker Options' being expanded to internal values. (Done.)

Build and use patchelf on the BR generated system libraries.
Plan B wins.

The Buildroot variable $O is part of the vary basic structure of the build system, there is no escaping it in the ld.so token: $ORIGIN.

The answer:
Build with an un-modified Buildroot, use patchelf as required on the resulting binaries.
Ref: https://github.com/NixOS/patchelf

Progress Note:
After 14 hours of beating head against wall (wall being the glibc-2.19 multi-lib loader) -
This is the best I have come up with for its search behavior:
Code:
[root@kindle bin]# LD_DEBUG=libs ./busybox
     17626:     find library=libc.so.6 [0]; searching
     17626:      search path=/mnt/us/extensions/system/lib/tls/v7l/neon/vfp:/mnt/us/extensions/system/lib/tls/v7l/neon:/mnt/us/extensions/system/lib/tls/v7l/vfp:/mnt/us/extensions/system/lib/tls/v7l:/mnt/us/extensions/system/lib/tls/neon/vfp:/mnt/us/extensions/system/lib/tls/neon:/mnt/us/extensions/system/lib/tls/vfp:/mnt/us/extensions/system/lib/tls:/mnt/us/extensions/system/lib/v7l/neon/vfp:/mnt/us/extensions/system/lib/v7l/neon:/mnt/us/extensions/system/lib/v7l/vfp:/mnt/us/extensions/system/lib/v7l:/mnt/us/extensions/system/lib/neon/vfp:/mnt/us/extensions/system/lib/neon:/mnt/us/extensions/system/lib/vfp:/mnt/us/extensions/system/lib            (RUNPATH from file ./busybox)
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/libc.so.6
     17626:     
     17626:     
     17626:     calling init: /mnt/us/extensions/system/lib/libc.so.6
     17626:     
     17626:     
     17626:     calling init: /usr/lib/libenvload.so
     17626:     
     17626:     
     17626:     initialize program: ./busybox
     17626:     
     17626:     
     17626:     transferring control: ./busybox
     17626:     
BusyBox v1.22.1 (2014-06-08 17:55:06 CDT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, addgroup, adduser, ar, arping, ash, awk, basename, blkid, bunzip2, bzcat, cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt, cksum, clear, cmp,
        cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, devmem, df, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, echo,
        egrep, eject, env, ether-wake, expr, false, fdflush, fdformat, fgrep, find, fold, free, freeramdisk, fsck, fstrim, fuser, getopt, getty, grep, gunzip, gzip,
        halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip, ipaddr, ipcrm, ipcs, iplink, iproute,
        iprule, iptunnel, kill, killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, losetup, ls, lsattr,
        lsmod, lsof, lspci, lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg, microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint, mt, mv,
        nameif, netstat, nice, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress, pivot_root, poweroff, printenv, printf, ps, pwd, rdate, readlink,
        readprofile, realpath, reboot, renice, reset, resize, rm, rmdir, rmmod, route, run-parts, runlevel, sed, seq, setarch, setconsole, setkeycodes, setlogcons,
        setserial, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, sleep, sort, start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, switch_root, sync,
        sysctl, syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, umount, uname, uniq, unix2dos, unlzma, unxz, unzip,
        uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat

     17626:     
     17626:     calling fini: ./busybox [0]
     17626:     
     17626:     
     17626:     calling fini: /usr/lib/libenvload.so [0]
     17626:     
[root@kindle bin]#
Those first 15 of the 16 look-up locations are the gnu-glibc people's idea of where we should be putting our libc. At least they are all in our */extensions/system/lib tree.
#16 is where I actually put it (and told the loader to look there).

Last edited by knc1; 06-08-2014 at 09:07 PM.
knc1 is offline   Reply With Quote