<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13937</bug_id>
          
          <creation_ts>2020-06-11 03:18:22 +0000</creation_ts>
          <short_desc>llvm-config does not work any more with multilib</short_desc>
          <delta_ts>2020-11-19 16:16:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>backport 3.1</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yann Dirson">ydirson</reporter>
          <assigned_to name="Yann Dirson">ydirson</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87458</commentid>
    <comment_count>0</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2020-06-11 03:18:22 +0000</bug_when>
    <thetext>In dunfell, when using multilib, llvm-config looks for libs in usr/lib and fails:

 # $LLVM_CONFIG --shared-mode
 llvm-config: error: component libraries and shared library

 llvm-config: error: missing: /home/yann/yocto/meta-blade/meta-shadow-os/build-boxv1-dunfell/tmp/work/dbfp4-shadow-linux/mesa/2_20.0.2-r0/recipe-sysroot/usr/lib/llvm9.0.1/libLLVMDemangle.a
 ...
 llvm-config: error: missing: /home/yann/yocto/meta-blade/meta-shadow-os/build-boxv1-dunfell/tmp/work/dbfp4-shadow-linux/mesa/2_20.0.2-r0/recipe-sysroot/usr/lib/llvm9.0.1/libLLVMXRay.a
 # echo $?
 1

This in turn causes an obscure exception in meson when trying to configure mesa.

Looks like the YOCTO_ALTERNATE_EXE_PATH patch has become insufficient, llvm-config insists on using &quot;$whatever/lib/llvm9.0.1/&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87459</commentid>
    <comment_count>1</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2020-06-11 03:37:57 +0000</bug_when>
    <thetext>Looks like they have a LLVM_LIBDIR_SUFFIX setable on meson command line, to cope with this naming scheme, but then it&apos;s dating back to 2014.  Not sure why it
breaks with dunfell and works with warrior...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87461</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2020-06-11 07:48:38 +0000</bug_when>
    <thetext>Are you doing to encounter the llvm-config error? Is that normally built? Maybe you can provide full build steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87471</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-06-11 14:20:20 +0000</bug_when>
    <thetext>&quot;[OE-core] [PATCH] meson: backport library ordering fix&quot; might fix this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87522</commentid>
    <comment_count>4</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2020-06-19 07:12:59 +0000</bug_when>
    <thetext>I updated meson to the version that adds this fix master to master, but the
problem is still there.

As for how it is built, I &quot;just&quot; use our custom not-public-yet layer, which
includes pieces of meta-amd (they have dropped support for amdfalconx86 long
ago, and we need their packaging changes to allow building both the VA state
tracker and va-x11).

I&apos;ll try reproduce with a minimal deviation from poky.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87546</commentid>
    <comment_count>5</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2020-06-23 05:34:26 +0000</bug_when>
    <thetext>Submitted https://github.com/mesonbuild/meson/issues/7371 for meson bombing out instead of catching the error.

The OE-level issue is only that llvm-config does not grok multi-lib.

The problem triggers when PACKAGECONFIG &quot;gallium-llvm&quot; is activated on mesa,
and multilib is active.

It can be reproduced in a dunfell poky build for a qemux86-64 target, by adding this to local.conf:

DISTRO_FEATURES_remove = &quot;wayland nfs irda pcmcia usbgadget 3g nfc ptest bluetooth bluez5&quot;
DISTRO_FEATURES += &quot;x11 opengl&quot;
PACKAGECONFIG_append_pn-mesa = &quot; gallium-llvm&quot;
MULTILIBS ?= &quot;&quot;
require conf/multilib.conf


There is a patch in meta-amd that seems to address this:
https://git.yoctoproject.org/cgit/cgit.cgi/meta-amd/tree/meta-amd-bsp/recipes-core/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch

However, it does not seem to be sufficient, digging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87571</commentid>
    <comment_count>6</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2020-06-24 11:28:43 +0000</bug_when>
    <thetext>Error on my seide, the patch in meta-amd works perfectly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88634</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2020-11-19 16:16:11 +0000</bug_when>
    <thetext>Looks like this was fixed in meson so closing. If it&apos;s still affecting master or a release, please re-open and/or send a fix to the list.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>