Bug 111679 - Mesa build breaks when only building radeonsi due to missing llvm coroutines symbols
Summary: Mesa build breaks when only building radeonsi due to missing llvm coroutines ...
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: not set normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-12 20:47 UTC by Shmerl
Modified: 2019-09-18 20:20 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to prevent build breakage on missing llvm coroutines (418 bytes, patch)
2019-09-12 21:02 UTC, Shmerl
Details | Splinter Review

Description Shmerl 2019-09-12 20:47:21 UTC
When building only radeonsi and radv, Mesa builds fails like this:

[1135/1135] Linking target src/gallium/targets/dri/libgallium_dri.so.
FAILED: src/gallium/targets/dri/libgallium_dri.so 
g++-9  -o src/gallium/targets/dri/libgallium_dri.so <...>
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_init.c.o): in function `init_gallivm_state':
lp_bld_init.c:(.text+0x2ad): undefined reference to `LLVMAddCoroEarlyPass'
/usr/bin/ld: lp_bld_init.c:(.text+0x2b6): undefined reference to `LLVMAddCoroSplitPass'
/usr/bin/ld: lp_bld_init.c:(.text+0x2bf): undefined reference to `LLVMAddCoroElidePass'
/usr/bin/ld: lp_bld_init.c:(.text+0x31d): undefined reference to `LLVMAddCoroCleanupPass'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
build failed!

To fix, it, llvm coroutines module can be enabled for example like this:

diff --git a/meson.build b/meson.build
index 29d7981d13d..9ca40e3e896 100644
--- a/meson.build
+++ b/meson.build
@@ -1244,7 +1244,7 @@ endif
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
 llvm_optional_modules = []
 if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
-  llvm_modules += ['amdgpu', 'native', 'bitreader', 'ipo']
+  llvm_modules += ['amdgpu', 'native', 'bitreader', 'ipo', 'coroutines']
   if with_gallium_r600
     llvm_modules += 'asmparser'
   endif
Comment 1 Shmerl 2019-09-12 21:02:53 UTC
Created attachment 145339 [details] [review]
Patch to prevent build breakage on missing llvm coroutines

Actually, I just tested, and it doesn't happen when building radv alone. So attaching a better fix.
Comment 2 tele42k3 2019-09-12 21:33:15 UTC
Hello Shmerl, this issue should have been fixed with https://gitlab.freedesktop.org/mesa/mesa/commit/8d286776b6ca177a5e55a9c706081a40ebbcf091 , did you encounter this with git master after that commit?
Comment 3 Shmerl 2019-09-12 21:37:50 UTC
(In reply to tele42k3 from comment #2)
> Hello Shmerl, this issue should have been fixed with
> https://gitlab.freedesktop.org/mesa/mesa/commit/
> 8d286776b6ca177a5e55a9c706081a40ebbcf091 , did you encounter this with git
> master after that commit?

Yes, I encountered it already after that commit. See attached patch. In particular, it happens when building for example only radeonsi and nothing else.
Comment 4 Shmerl 2019-09-17 01:25:17 UTC
Still happens on latest Mesa master. Should I make a MR in Gitlab for the fix?
Comment 5 Adam Jackson 2019-09-18 20:20:40 UTC
https://gitlab.freedesktop.org/mesa/mesa/issues/951


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.