Bug 1225956 - Package xf86-video-nouveau does not build with gcc14 because of new errors
Summary: Package xf86-video-nouveau does not build with gcc14 because of new errors
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X.Org (show other bugs)
Version: Current
Hardware: Other Other
: P4 - Low : Normal (vote)
Target Milestone: ---
Assignee: Martin Jambor
QA Contact: Gfx Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: modern_C
  Show dependency treegraph
 
Reported: 2024-06-04 16:18 UTC by Martin Jambor
Modified: 2024-07-08 16:06 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
U_fb-Declare-wfbFinishScreenInit-wfbScreenInit-for-FB_.patch (1.27 KB, patch)
2024-06-13 11:51 UTC, Stefan Dirsch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2024-06-04 16:18:28 UTC
GCC 14 newly by default treats as errors a number of situations which
before were only warnings.  For more information see
https://gcc.gnu.org/gcc-14/porting_to.html and meta bug #1220571.

Because of this, package xf86-video-nouveau fails to compile.  This can be seen online
at:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/xf86-video-nouveau/standard/x86_64

It can be reproduced locally with command: osc build --clean
--alternative-project home:rguenther:nextgcc

There's a Gentoo bug which might be relevant:
https://bugs.gentoo.org/885763


The (first) error (that halts the build) is:

[   15s] nv_driver.c: In function 'NVScreenInit':
[   15s] nv_driver.c:1451:23: error: implicit declaration of function 'wfbScreenInit'; did you mean 'fbScreenInit'? [-Wimplicit-function-declaration]
[   15s]  1451 |                 ret = wfbScreenInit(pScreen, FBStart, pScrn->virtualX,
Comment 1 Stefan Dirsch 2024-06-04 22:28:20 UTC
Ok. Tried the Gentoo patch against our Xserver, but with that the Xserver build fails.

[  100s] /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: /tmp/ccrZjhf3.ltrans8.ltrans.o:(.data.rel+0x1fc8): undefined reference to `wfbFinishScreenInit'
[  100s] /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: /tmp/ccrZjhf3.ltrans8.ltrans.o:(.data.rel+0x1fd0): undefined reference to `wfbScreenInit'
Comment 2 Stefan Dirsch 2024-06-12 12:55:39 UTC
I'm afraid fixing this is beyond my skills :-(
Comment 3 Stefan Dirsch 2024-06-13 11:51:59 UTC
Created attachment 875471 [details]
U_fb-Declare-wfbFinishScreenInit-wfbScreenInit-for-FB_.patch
Comment 4 Stefan Dirsch 2024-06-13 11:52:37 UTC
Index: xorg-x11-server.changes
===================================================================
--- xorg-x11-server.changes     (revision 1255d8cf54391a590f1d676d98f5568c)
+++ xorg-x11-server.changes     (working copy)
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Tue Jun  4 20:12:15 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>
+
+- U_fb-Declare-wfbFinishScreenInit-wfbScreenInit-for-FB_.patch
+  * should fix build of xf86-video-nouveau driver with gcc14 
+    (boo#1225956) 
+
 -------------------------------------------------------------------
 Wed Apr 10 13:20:43 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>
 
Index: xorg-x11-server.spec
===================================================================
--- xorg-x11-server.spec        (revision 1255d8cf54391a590f1d676d98f5568c)
+++ xorg-x11-server.spec        (working copy)
@@ -239,6 +239,8 @@
 
 Patch1960:      u_sync-pci-ids-with-Mesa.patch
 
+Patch2000:      U_fb-Declare-wfbFinishScreenInit-wfbScreenInit-for-FB_.patch
+
 Patch1218176:   u_miCloseScreen_check_for_null_pScreen_dev_private.patch
 Patch1222442:   U_render-Avoid-possible-double-free-in-ProcRenderAddGl.patch
 
@@ -396,6 +398,7 @@
 %patch -P 1921 -p1
 %patch -P 1930 -p1
 %patch -P 1960 -p1
+%patch -P 2000 -p1
 
 %patch -P 1218176 -p1
Comment 5 Stefan Dirsch 2024-06-13 11:53:33 UTC
Martin, can you help me with that?

--> X11:XOrg/xorg-x11-server
Comment 6 Stefan Dirsch 2024-07-08 13:34:10 UTC
I wonder how this patch is supposed to work without switching to 

--> fb/meson.build
wfb_args = '-DFB_ACCESS_WRAPPER'

completely.
Comment 7 Stefan Dirsch 2024-07-08 14:06:13 UTC
I will try to drop xf86-video-nouveau package.
Comment 8 Martin Jambor 2024-07-08 14:52:40 UTC
(In reply to Stefan Dirsch from comment #2)
> I'm afraid fixing this is beyond my skills :-(

Please, always feel free to just add -fpermissive to optflags.

This is still on my list of things to look at but I'm progressing more slowly than I'd like to.
Comment 9 Stefan Dirsch 2024-07-08 15:27:20 UTC
Thanks. Fixed by now.

-------------------------------------------------------------------
Mon Jul  8 15:23:22 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>

- added "-fpermissive" to optflags to workaround fatal warnings
  with gcc14 (boo#1225956)
Comment 10 Martin Jambor 2024-07-08 15:50:22 UTC
If you don't object, I'll re-open the bug to track the use of -fpermissive (so that in a year or three I can check whether it is still necessary) and assign the bug to myself.

Thanks a lot for the workaround and all the time you have spent on this.
Comment 11 OBSbugzilla Bot 2024-07-08 16:05:03 UTC
This is an autogenerated message for OBS integration:
This bug (1225956) was mentioned in
https://build.opensuse.org/request/show/1186217 Factory / xf86-video-nouveau
Comment 12 Stefan Dirsch 2024-07-08 16:06:50 UTC
Ok. As you wish.