Bug 1862771 - Mesa + LTO breaks some games
Summary: Mesa + LTO breaks some games
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: 33
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-02 11:15 UTC by Martin
Modified: 2023-07-29 20:41 UTC (History)
17 users (show)

Fixed In Version: mesa-20.1.6-2.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-22 07:51:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin 2020-08-02 11:15:18 UTC
Description of problem:
Some game not Start if mesa is compiled with lto
Tomb Raider
Dying Light


Version-Release number of selected component (if applicable):
mesa-dri-drivers-20.1.4-1.fc33.x86_64.

How reproducible:
often

Steps to Reproduce:
1.Install Game frome steam
2.click lanuch
3.show Running
4.then just end

Actual results:
Some game not Start

Expected results:


Additional info:
If I rebuild mesa package with out lto "%define _lto_cflags %{nil}" games normal running.

with lto appears this in build log
 
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:49:12: note: type ‘struct <anon>’ itself violates the C++ One Definition Rule
   49 |     struct {
      |            ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:51:5: note: the incompatible type is defined here

Comment 1 Martin 2020-08-02 11:23:20 UTC
Additional info:
ABRT says it end with SIGSEGV

Comment 2 Ben Cotton 2020-08-11 13:51:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 3 Kalev Lember 2020-08-21 16:41:25 UTC
Jeff, any ideas if this is a toolchain or mesa bug?

Comment 4 Jeff Law 2020-08-21 18:48:51 UTC
Not without digging deeper.  I'm in the middle of debugging an issue with scribus.

The warning noted in the description won't cause a codegen issue as it only refers to a type.

Given that disabling LTO for mesa is helpful in that we only have to look at mesa rather than the entire world :-)

Unfortunately, I don't have any steam games so someone else will need to do the next phase of digging.

Comment 5 Kalev Lember 2020-08-22 07:43:26 UTC
OK, thanks -- let's just disable LTO for mesa then.

Comment 6 Martin 2020-08-22 07:46:18 UTC
works ok with mesa-20.1.6-1.fc33, no crashing

Additional info:
With 20.2.0-rc2 crashing again with lto(but this is not yet available in Fedora and is a devel version ,build with clang and debug "-g1" ulimit -n 52000(eats too much memory when build,crash with too many open files) work ok but with lower performance).

Comment 7 Kalev Lember 2020-08-22 07:51:55 UTC
Ah hm -- maybe it's best to keep it disabled then. I'm sure 20.2.0 lands in Fedora soon.

Before I read your reply, I already went ahead and disabled LTO in mesa-20.1.6-2.fc33, https://src.fedoraproject.org/rpms/mesa/c/f009ee08a5d0c7aa2ca3b23c6bb75f855dd2c9bc

Comment 8 Martin 2020-09-18 15:23:25 UTC
just for the record lto breaks ACO (so add -fno-lto to cpp_args_aco in /src/amd/compiler/meson.build should fix this)

/usr/bin/meson test
....
59/101 mesa:amd+compiler / aco_tests                 FAIL
....

with -fno-lto in cpp_args_aco 

59/101 mesa:amd+compiler / aco_tests                 OK

Comment 9 Tomasz Kłoczko 2021-06-20 17:12:08 UTC
For me mesa from 20.3.4 to 21.1.3 compiled with latest rawhide gcc usimg LTO is crashing in nouveau_dri.so driver.
All details are in https://gitlab.freedesktop.org/mesa/mesa/-/issues/4399

Comment 10 NoraMarshall 2022-08-26 01:49:58 UTC Comment hidden (spam)
Comment 11 romulasry 2023-02-15 03:32:25 UTC
Is this still an issue?

Comment 12 Michel Dänzer 2023-02-15 15:04:25 UTC
(In reply to romulasry from comment #11)
> Is this still an issue?

Yes. Nobody has figured out why enabling LTO breaks Mesa, let alone fixed it.


Note You need to log in before you can comment on or make changes to this bug.