Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#35066 - [mesa] Crash with statically linked llvm

Attached to Project: Arch Linux
Opened by John Kåre Alsaker (JKA) - Thursday, 02 May 2013, 21:21 GMT
Last edited by Andreas Radke (AndyRTR) - Saturday, 25 May 2013, 08:50 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

mesa doesn't build correctly when llvm is statically linked. llvm needs to be built with --enable-shared and mesa with --with-llvm-shared-libs for things to work correctly.

A crash happens when mesa loads multiple libraries which are statically linked to llvm.

Related upstream bug: https://bugs.freedesktop.org/show_bug.cgi?id=61364
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Saturday, 25 May 2013, 08:50 GMT
Reason for closing:  Fixed
Comment by Dave Reisner (falconindy) - Thursday, 02 May 2013, 21:28 GMT
Notice that there's a comment in the PKGBUILD for mesa:

# --with-llvm-shared-libs \ # enabling this would force us to move llvm-amdgpu-snapshot from community to extra, delay it until llvm 3.3 / Mesa 9.2/10.0
Comment by John Kåre Alsaker (JKA) - Thursday, 02 May 2013, 21:59 GMT
If you want the R600 LLVM backend enabled, llvm-amdgpu-snapshot will have to be installed with mesa.
Comment by Jay True (GlacJAY) - Monday, 06 May 2013, 01:05 GMT
When compiled using llvm-andgpu-snapshot, my vmware guest can't start X with xf86-video-vmware. Change to offical llvm package solved the problem.
Comment by Armin K. (Krejzi) - Wednesday, 08 May 2013, 10:07 GMT
I have specificaly created llvm-r600 in AUR because of this. It includes clang, compiler-rt and is from 3.3 svn. I primary use it for OpenCL with R600 which requires mesa to be built against llvm shared libraries. No problems here anymore.
Comment by Laurent Carlier (lordheavy) - Friday, 10 May 2013, 17:05 GMT
@Armin K.

Only Tom Stellar branch is the only one certified to work with mesa-9.1.x.
Your AUR package is only certifed to work with mesa from the mesa git trunk (9.2-devel).

@Other

I will try to provide mesa packages with tstellar's llvm lib dynamically linked, then let say if it work without regressions.
Comment by Armin K. (Krejzi) - Friday, 10 May 2013, 19:56 GMT
Yeah, I am aware of that, and I use llvm svn just because I wanted to make Mesa-git package with OpenCL library which has seen some improvements over 9.1. Not so long ago, llvm-r600 was 3.2 with patches from Tom Stellard.

I've also suggested to include *official* Tom Stellard's patches into ArchLinux llvm, but you can see the answer for yourself.

https://mailman.archlinux.org/pipermail/arch-general/2013-March/033029.html
Comment by Laurent Carlier (lordheavy) - Tuesday, 14 May 2013, 17:56 GMT
You can use following repo, mesa is built with tstellar's llvm branch. It doesn't conflict with default llvm installation.
Just add this on the top of your pacman.conf repo list:

[mesa-llvm-shared]
Server = http://pkgbuild.com/~lcarlier/mesa-llvm-shared/$arch

Currently only x86_64 is provided.
Comment by Jan de Groot (JGC) - Tuesday, 14 May 2013, 21:47 GMT
Thanks for that. Can you provide PKGBUILDs or patches so we can integrate this in our official builds?

The problem we have now is that if we patch our LLVM build with Tom Stellards patches, we will be forced to keep LLVM at 3.2 until Mesa 9.2 gets released. Your solution adds shared libraries to the amdgpu snapshot, which doesn't conflict with our default LLVM build, so your solution is probably the best way to fix this.
Comment by Laurent Carlier (lordheavy) - Wednesday, 15 May 2013, 07:43 GMT
I've also pushed the splitted llvm-amdgpu-snpshot package in community repo.
   PKGBUILD (5.8 KiB)
Comment by Armin K. (Krejzi) - Wednesday, 15 May 2013, 09:37 GMT
@Jan de Groot

Mesa 9.1.2 can be built with LLVM 3.3svn revision 181113, and I built the package two or three days before 3.3 was branched, so I see no problems why you'd need to wait for Mesa 9.2 to upgrade LLVM to 3.3. When Arch upgraded LLVM to 3.2, Mesa 9.0 needed several upstream patches.

I've used these patches to get 9.1.2 to build against LLVM 3.3svn rev 181113

http://cgit.freedesktop.org/mesa/mesa/patch/?id=ead4db420e9e5408f41c70768a290592a384aedb
http://cgit.freedesktop.org/mesa/mesa/patch/?id=4742f9b00b804dd01eb9955dd386a2373cd8eb36
http://cgit.freedesktop.org/mesa/mesa/patch/?id=6249db73ea580e6a54874235ffb3a7d42ac63bb4
http://cgit.freedesktop.org/mesa/mesa/patch/?id=7cd248aa7938a068663fcd605169b7d4e21636bf
http://cgit.freedesktop.org/mesa/mesa/patch/?id=a0c8942bb4742b4bd22f494cea4dcd59d9ca99ab
http://cgit.freedesktop.org/mesa/mesa/patch/?id=cd84353d576246273d1c6ae8e96b65217be15ebc

My initial suggestion was to split shared llvm library into libllvm package. The pastebin links containing PKGBUILDs in my mailing list RFC are gone though and I don't have them arround anymore.
Comment by Jan de Groot (JGC) - Thursday, 23 May 2013, 08:38 GMT
I will probably implement this for Mesa 9.1.3. Is it a problem if it's going to depend on a community package, or should we move llvm-amdgpu-snapshot to extra for this?
Comment by Laurent Carlier (lordheavy) - Thursday, 23 May 2013, 08:46 GMT
AFAIK, you will have to move the package to extra repo. Dependency on community packages are only allowed for optional dependencies (or building dependencies).
Comment by Andreas Radke (AndyRTR) - Thursday, 23 May 2013, 16:07 GMT
I'm a bit afraid of unwanted side effects. We could have llvm-amdgpu-lib-snapshot and stable llvm on a system at the same time.

/usr/lib/llvm/libLLVM-3.2.so and
/usr/lib/llvm/libLLVM-3.2svn.so.

Comment by Jan de Groot (JGC) - Thursday, 23 May 2013, 22:16 GMT
What side effects? The fact that mesa shrinks to a small package and that we're running a supported configuration should be enough to motivate this change. Apps will most likely never link to two versions of llvm, and in case they do through loading dri drivers, they would crash with the static version anyways.
Comment by Andreas Radke (AndyRTR) - Friday, 24 May 2013, 19:05 GMT
Please check 9.1.3-1 in testing with llvm-shared-libs enabled - llvm-amdgpu-snapshot has been moved to extra.

Loading...