Bug 109259 - Mesa compiled with LLVM/clang-7.0 segfaults
Summary: Mesa compiled with LLVM/clang-7.0 segfaults
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 18.3
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
Depends on:
Reported: 2019-01-09 12:47 UTC by Tomasz Paweł Gajc
Modified: 2019-01-09 18:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Paweł Gajc 2019-01-09 12:47:31 UTC

we have noticed that mesa-18.3.x segfault when it is compiled with LLVM/clang-7.0.x and run on older hardware.

After some deep digging we noticed this may be related to missing AVX instructions on these machines, even if we build for generic x86_64, i686 targets.

Fast workaround for eliminating segfaults was to build Mesa with gcc :(

Rebuilding Mesa with LLVM/clang-7.0.1 still segfaults. 

Our users have reported this occurs on:
r600 driver
nvidia gfx card
AMD Athlon II X4 620
AMD Phenom II x4 N930
Intel Quad 9650
Intel i3 530

Links to bug reports:
Comment 1 Tomasz Paweł Gajc 2019-01-09 12:48:21 UTC
Build logs for mesa compiled with LLVM/clang-7.0.1 can be found here
Comment 2 Tomasz Paweł Gajc 2019-01-09 12:54:29 UTC
When building mesa with clang these flags are used
-pthread -mavx2 -mfma -mbmi2 -mf16c -DKNOB_ARCH=KNOB_ARCH_AVX2 
 with gcc
[-pthread -mavx -DKNOB_ARCH=KNOB_ARCH_AVX
Comment 3 Dylan Baker 2019-01-09 18:12:15 UTC
I'm confused, you're targeting generic x86_64, but compiling with -mavx and -mavx2?

Additionally, there's a bug with SWR (I can't find it right now), due to global constructors that mean that if you build SWR you have to have the special instructions it relies on.

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.