mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Christian Melki <christian.melki@t2data.com>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] pkg-config-wrapper libdir confusion, ABI dynamic-linker path.
Date: Fri, 23 Apr 2021 10:17:35 +0200	[thread overview]
Message-ID: <b5d740fa-8f11-7689-210b-88764be588a2@t2data.com> (raw)
In-Reply-To: <20210423073918.GG4162561@pengutronix.de>

On 4/23/21 9:39 AM, Michael Olbrich wrote:
> On Thu, Apr 22, 2021 at 09:59:06PM +0200, Christian Melki wrote:
>> I'm using a crosstool-ng toolchain which adheres to the ld.so ABI path
>> for x86_64 (glibc).
>>
>> Afaiu, ptxdist does not like multilib.
>> But it will happily get the dynamic-linker path which contain a multilib
>> description or just a regular lib64 path.
>>
>> https://git.pengutronix.de/cgit/ptxdist/tree/scripts/lib/ptxd_make_00-init.sh#n169
>>
>> This might be a symbolic link to the real dynamic linker, because a
>> demultilibbed toolchain must still adhere to the ABI specifications.
>> For x86_64: 64-bit, hard-float, LE: /lib64/ld-linux-x86-64.so.2
>>
>> So ptxdist will use lib64 as it's base for libdirs placing various
>> libraries in a lib64 path.
> 
> Right, that was contributed a long time ago. But since I don't have a
> test-case for this, the support for this has not been maintained.
> 
> 
>> But when using the pkg-config-wrapper it looks like all libraries are
>> only statically set from a something /lib path.
>>
>> https://git.pengutronix.de/cgit/ptxdist/tree/scripts/pkg-config-wrapper#n19
> 
> Right, and here it get's ugly. I don't want to rely on some external
> environment variable here. Maybe just search for the paths:
> 
> libdir=( $(find ${prefix} -maxdepth 3 -type d -name pkgconfig )
> 
> Would care to provide a patch for this?
> 
> Michael
> 

Sounds resonable. I can try that and provide a patch that (if?) works
for my case atleast. I'll rebuild a ct-ng toolchain without demultilibbing.

Maybe the following is valuable for someone reading this in the future.
I tinkered with ct-ng glibc extra params passed to configuration and
found these two to be useful to play with in situations like these.

# Forcibly try to set a libpath.
CT_GLIBC_EXTRA_CONFIG_ARRAY="libc_cv_slibdir=/lib"

# Make recognize multiple trusted directories upon start.
# Useful when ABI-spec is looking for /lib64 but stuff is elsewhere.
# The rest is managed with the regular ld.so path options.
CT_GLIBC_CONFIGPARMS="user-defined-trusted-dirs=/lib:/lib64"

>> So building a library yields:
>> $ ls -la platform-tracker/sysroot-target/usr/lib64/libmnl.so*
>> lrwxrwxrwx 2 xxx users    15 Apr 22 21:01
>> platform-tracker/sysroot-target/usr/lib64/libmnl.so -> libmnl.so.0.2.0*
>> lrwxrwxrwx 2 xxx users    15 Apr 22 21:01
>> platform-tracker/sysroot-target/usr/lib64/libmnl.so.0 -> libmnl.so.0.2.0*
>> -rwxr-xr-x 2 xxx users 77216 Apr 22 21:01
>> platform-tracker/sysroot-target/usr/lib64/libmnl.so.0.2.0*
>>
>> $ ls -la platform-tracker/sysroot-target/usr/lib64/pkgconfig/libmnl.pc
>> -rw-r--r-- 2 xxx users 318 Apr 22 21:01
>> platform-tracker/sysroot-target/usr/lib64/pkgconfig/libmnl.pc
>>
>> In the search for the library:
>> PKG_CONFIG_DEBUG_SPEW variable enabling debug spew
>> Adding directory
>> '/home/xxx/work/tracker/bin/platform-tracker/sysroot-target/usr/lib/pkgconfig'
>> from PKG_CONFIG_PATH
>> Adding directory
>> '/home/xxx/work/tracker/bin/platform-tracker/sysroot-target/usr/share/pkgconfig'
>> from PKG_CONFIG_PATH
>> Global variable definition 'pc_sysrootdir' = '/'
>> Global variable definition 'pc_top_builddir' = '$(top_builddir)'
>> Error printing enabled by default due to use of output options besides
>> --exists, --atleast/exact/max-version or --list-all. Value of
>> --silence-errors: 0
>> Error printing enabled
>> Adding virtual 'pkg-config' package to list of known packages
>> Looking for package 'libmnl'
>> Looking for package 'libmnl-uninstalled'
>> No package 'libmnl' found
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
>>
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


  reply	other threads:[~2021-04-23  8:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 19:59 Christian Melki
2021-04-23  7:39 ` Michael Olbrich
2021-04-23  8:17   ` Christian Melki [this message]
2021-04-24 17:02   ` Christian Melki
2021-04-25  7:18     ` Michael Olbrich
2021-05-03 13:43       ` Christian Melki
2021-05-07  7:15         ` [ptxdist] [PATCH] pkg-config-wrapper: calculate the system paths dynamically as well Michael Olbrich
2021-05-07 11:14           ` Christian Melki
2021-05-07 12:14             ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5d740fa-8f11-7689-210b-88764be588a2@t2data.com \
    --to=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox