All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vincent Davis Jr" <vince@underview.tech>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] llvm: fix native llvm-config RUNPATH
Date: Sun, 13 Nov 2022 11:17:04 -0800	[thread overview]
Message-ID: <3205.1668367024981923542@lists.openembedded.org> (raw)
In-Reply-To: <CANNYZj_hMQeMh-Rp-fJ=nezRUcwaOk3mMpX4iKSxAEia7tmZeg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3116 bytes --]

Hey,

Desired outcome is for mesa meson configure to succeeded by updating
RUNPATH on llvm-config native binary required by mesa when gallium-llvm
included. When running bitbake -c devshell mesa. Then chrpath -l on llvm-config

Should return on TARGET_ARCH x86_64
$ORIGIN/../lib64:$ORIGIN/../../lib64
not
$ORIGIN/../lib:$ORIGIN/../../lib

SNAPSHOT OF FAILURE
*************************************************************************************************************************
File "/../../../mesa/<version>/recipe-sysroot-native/usr/lib/python3.11/re/__init__.py", line 223, in finditer
return _compile(pattern, flags).finditer(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
*************************************************************************************************************************

Reason for above failure, at least for me, when TARGET_ARCH = x86_64 you run into
bellow when running llvm-config --help or variant commands directly.

llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

Because of that when mesa configure executes llvm-config --version the string is not returned. Thus, leading
to above error.

If you run chrpath -l on llvm-config you see

$ORIGIN/../lib:$ORIGIN/../../lib:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

When target architecture is x86_64 those folders don't exists in recipe-sysroot of a recipe that requires llvm-native.

The llvm_sysroot_preprocess_native function in current MR addresses that problem by
making RUNPATH target architecture dependent.

As to why RUNPATH includes both the original RUNPATH and the update target architecture
dependent directory name the llvm recipe requires the llvm-native llvm-config binary to
compile, but the build libs are stored in lib directory not lib64. Tried everything I could
think of change that not much can be done about that. When llvm-native gets included
in another recipe however libs are located at $ORIGIN/../lib64:$ORIGIN/../../lib64, at least
for TARGET ARCH x86_64.

As for the second problem llvm-config --libdir returns

/../../../../../../mesa/2_22.2.2-r0/recipe-sysroot/usr/lib

instead of

/../../../../../../mesa/2_22.2.2-r0/recipe-sysroot/usr/lib64

Which causes mesa configure to fail as ../../mesa/2_22.2.2-r0/recipe-sysroot/usr/lib doesn't exist.

According to https://github.com/llvm/llvm-project/blob/a11cd0d94ed3cabf0998a0289aead05da94c86eb/llvm/CMakeLists.txt#L399
and https://github.com/llvm/llvm-project/blob/a11cd0d94ed3cabf0998a0289aead05da94c86eb/llvm/CMakeLists.txt#L389

LLVM_LIBDIR_SUFFIX variable is used to set command. MR addresses that by setting the LLVM_LIBDIR_SUFFIX
variable. The reason I decided to use HOST_ARCH instead of TARGET_ARCH is because bitbake sets
HOST_ARCH = "${TARGET_ARCH}" in bitbake.conf, but I'll admit there's ignorance on my part in terms
of what I think that variable is set to and what class-native it used for.

:)

[-- Attachment #2: Type: text/html, Size: 3781 bytes --]

  reply	other threads:[~2022-11-13 19:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13  8:44 [PATCH] llvm: fix native llvm-config RUNPATH Vincent Davis Jr
2022-11-13 17:44 ` [OE-core] " Alexander Kanavin
2022-11-13 19:17   ` Vincent Davis Jr [this message]
2022-11-13 21:54     ` Alexander Kanavin
2022-11-13 21:55       ` Alexander Kanavin
2022-11-14  0:09         ` Vincent Davis Jr
2022-11-14  0:40           ` Vincent Davis Jr
2022-11-14 12:17             ` [OE-core] " Alexander Kanavin
     [not found]             ` <172772A94B18DE42.10474@lists.openembedded.org>
2022-11-14 13:36               ` Alexander Kanavin
2022-11-14 14:46                 ` Vincent Davis Jr

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=3205.1668367024981923542@lists.openembedded.org \
    --to=vince@underview.tech \
    --cc=openembedded-core@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.