Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662722 - media-libs/mesa does not set LLVM_CONFIG for cross compilation
Summary: media-libs/mesa does not set LLVM_CONFIG for cross compilation
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Bug, UPSTREAM
: 679960 736450 (view as bug list)
Depends on:
Blocks: cross-compile 662720
  Show dependency tree
 
Reported: 2018-08-03 14:46 UTC by Richard Yao (RETIRED)
Modified: 2022-02-03 08:04 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch against sys-devel/llvm (llvm-config-sh.patch,8.34 KB, patch)
2019-05-05 20:11 UTC, James Le Cuirot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2018-08-03 14:46:52 UTC
When cross compiling media-libs/mesa, LLVM_CONFIG is not set for cross compilation and builds fail. The llvm-config is actually a compiled binary, so it will fail to execute unless qemu-user and binfmt_misc are setup, but with those two in place, setting LLVM_CONFIG externally works. I don't have a fix in LLVM yet, but I am opening this so that it can block the tracker bug for cross compilation issues.

If the x11 team is okay with me patching the ebuild, I could probably write an ebuild patch to fix the issue and punt the problem entirely to mesa.
Comment 1 Matt Turner gentoo-dev 2018-08-03 19:09:46 UTC
I'm not interested in fixing any issues related to the autotools build system. 18.2.0 will be released soon and it will use Meson in Gentoo.
Comment 2 Richard Yao (RETIRED) gentoo-dev 2018-08-04 00:01:27 UTC
(In reply to Matt Turner from comment #1)
> I'm not interested in fixing any issues related to the autotools build
> system. 18.2.0 will be released soon and it will use Meson in Gentoo.

The behavior is the same whether it is autotools or meson. I was thinking that the ebuild could have a small detection function that it could use to set the variable in the environment to handle it. No build system changes would be necessary, provided llvm-config gets switched to use a script.
Comment 3 Matt Turner gentoo-dev 2019-03-10 19:06:53 UTC
*** Bug 679960 has been marked as a duplicate of this bug. ***
Comment 4 tt_1 2019-03-10 19:10:03 UTC
Could you post the ebuild patch, if you happen to have made one up in the meantime?
Comment 5 James Le Cuirot gentoo-dev 2019-05-05 20:11:27 UTC
Created attachment 575344 [details, diff]
Patch against sys-devel/llvm

I try very hard to avoid QEMU when cross-compiling as it can throw up a lot of other issues. I initially thought llvm-config would return the wrong paths anyway but I now know that it returns paths relative to itself so it may work in that respect. I've taken a different approach though by writing a poor man's shell script equivalent of llvm-config to use when cross-compiling. It's quite small and relatively accurate. I'm not sure mgorny will buy it though.
Comment 6 Matt Turner gentoo-dev 2020-08-10 23:15:04 UTC
*** Bug 736450 has been marked as a duplicate of this bug. ***
Comment 7 hanetzer 2020-08-15 12:35:30 UTC
Regarding #736450 which was marked as a duplicate of this bug, the
final build error with the edited llvm.eclass is caused by the inclusion
of a multilib-wrapped header, llvm-config.h, which conditionally includes
'real' llvm-config headers for {i686,x86_64}-pc-linux-gnu targets but
not any for the LLVM_TARGETS flags (I have set AArch64,AMDGPU,ARM,BPF)

Not currently in a position to reupload the data from the dup'd bug,
but there's some info there which may be of use to solving the issue.
Comment 8 hanetzer 2020-08-15 15:17:39 UTC
Another bit of information. using llvm-config.h from the cross-sysroot
and manually editing the wrapped header to use it, in addition to using
get_llvm_config -b in llvm.eclass allows compilation to get further
along, up to the linking phase, but fails finding -lLLVM-10.

Will be attaching info when I'm back to my primary machine.
Comment 9 tt_1 2022-02-03 08:04:01 UTC
I don't see this fixed:

FAILED: src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_state_fs.c.o 
In file included from ../mesa-9999/src/gallium/auxiliary/gallivm/lp_bld.h:49,
                 from ../mesa-9999/src/gallium/auxiliary/gallivm/lp_bld_type.h:42,
                 from ../mesa-9999/src/gallium/drivers/llvmpipe/lp_state_fs.c:77:
/usr/lib/llvm/12/include/llvm/Config/llvm-config.h:43:3: error: #error "No ABI matched, please report a bug to bugs.gentoo.org"
   43 | # error "No ABI matched, please report a bug to bugs.gentoo.org"
      |   ^~~~~