Hi Kevin,

Le 20/02/2020 à 23:07, Kevin Brace a écrit :
Hi Xavier,

I have not heard from you for a while.
How have you been?

I'm doing fine, thanks. I'm quite busy with life in general, and part of both my pro and spare time is quite full with various opensource stuff. Unfortunately not much of it is dedicated to openchrome, and I'm now left with only one x86_64 machine still able to run openchrome, due to lot of distros dropping i386 support, which most of my VIA boards are. However, I still keep an eye on what is going on here and I still take care of the very first package I pushed to Fedora, which is the openchrome driver :-)

    Xavier, for this issue, can you open a bug report with 
https://bugs.freedesktop.org?
I do not really use the latest compiler for testing, so I was not aware of this 
issue.
You will need to attach a text file with relevant error messages indicating 
which extern variables are causing the issue.

This issue is only visible with GCC 10, and I don't think any stable distro ships with it yet. I'm seeing this on Fedora 32, which has not even reached beta, so I'm probably the first one to notice.

Actually, I thing the behavior can be reproduced with any GCC version. GCC 10 enabled -fno-common by default, but this flag is available in earlier GCC as well, so one can reproduce the GCC 10 behavior easily. For the same reason, the build failure can be worked around quite easily too with GCC 10.

The errors are like :
/usr/bin/ld: .libs/via_exa.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_driver.h:365: multiple definition of `iga2_crtc_funcs'; .libs/via_analog.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_driver.h:365: first defined here

/usr/bin/ld: .libs/via_exa.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_driver.h:364: multiple definition of `iga1_crtc_funcs'; .libs/via_analog.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_driver.h:364: first defined here

/usr/bin/ld: .libs/via_exa.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_vt1632.h:54: multiple definition of `via_vt1632_funcs'; .libs/via_analog.o:/builddir/build/BUILD/xf86-video-openchrome-20200131/src/via_vt1632.h:54: first defined here

Grepping the build log, the affected vars are :
iga1_crtc_funcs
iga2_crtc_funcs
via_sii164_funcs
via_vt1632_funcs

I will drop all of that in a proper bug report with full build log asap.

I'm attaching a quickly hacked patch that fixes the link issue, but I'm not confident it's okay. Only build tested, not run tested anyway. the patch is against 0.6.209, I'll submit a proper patch once you've looked at it and I've tested for real.

Regards,
Xavier



Regards,

Kevin Brace
Brace Computer Laboratory blog
https://bracecomputerlab.com


Date: Mon, 17 Feb 2020 18:21:05 +0100
From: Xavier Bachelot <xav...@bachelot.org>
To: openchrome-devel@lists.freedesktop.org
Subject: [openchrome-devel] Build failure with GCC 10
Message-ID: <a3efba25-5eae-f0e9-b682-435a90f44...@bachelot.org>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Kevin,

openchrome fails to link when using GCC 10 which now defaults to
-fno-common, as explained here:
https://gcc.gnu.org/gcc-10/porting_to.html#common

Regards,
Xavier


_______________________________________________
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


diff -Naur xf86-video-openchrome-20200131.orig/src/via_driver.h xf86-video-openchrome-20200131/src/via_driver.h
--- xf86-video-openchrome-20200131.orig/src/via_driver.h	2020-02-21 10:52:01.523263642 +0100
+++ xf86-video-openchrome-20200131/src/via_driver.h	2020-01-23 01:27:57.000000000 +0100
@@ -361,8 +361,8 @@
 void viaProcessOptions(ScrnInfoPtr pScrn);
 
 /* In via_display.c. */
-const xf86CrtcFuncsRec iga1_crtc_funcs;
-const xf86CrtcFuncsRec iga2_crtc_funcs;
+extern xf86CrtcFuncsRec iga1_crtc_funcs;
+extern xf86CrtcFuncsRec iga2_crtc_funcs;
 
 /* In via_exa.c. */
 Bool viaInitExa(ScreenPtr pScreen);
diff -Naur xf86-video-openchrome-20200131.orig/src/via_sii164.h xf86-video-openchrome-20200131/src/via_sii164.h
--- xf86-video-openchrome-20200131.orig/src/via_sii164.h	2020-02-21 10:52:52.587481902 +0100
+++ xf86-video-openchrome-20200131/src/via_sii164.h	2020-01-23 01:27:57.000000000 +0100
@@ -51,7 +51,7 @@
 } viaSiI164Rec, *viaSiI164RecPtr;
 
 
-const xf86OutputFuncsRec via_sii164_funcs;
+extern xf86OutputFuncsRec via_sii164_funcs;
 
 Bool viaSiI164Probe(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus);
 void viaSiI164Init(ScrnInfoPtr pScrn);
diff -Naur xf86-video-openchrome-20200131.orig/src/via_vt1632.h xf86-video-openchrome-20200131/src/via_vt1632.h
--- xf86-video-openchrome-20200131.orig/src/via_vt1632.h	2020-02-21 10:53:44.302702683 +0100
+++ xf86-video-openchrome-20200131/src/via_vt1632.h	2020-01-23 01:27:57.000000000 +0100
@@ -51,7 +51,7 @@
 } viaVT1632Rec, *viaVT1632RecPtr;
 
 
-const xf86OutputFuncsRec via_vt1632_funcs;
+extern xf86OutputFuncsRec via_vt1632_funcs;
 
 Bool viaVT1632Probe(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus);
 void viaVT1632Init(ScrnInfoPtr pScrn);
diff -Naur xf86-video-openchrome-20200131.orig/src/via_display.c xf86-video-openchrome-20200131/src/via_display.c
--- xf86-video-openchrome-20200131.orig/src/via_display.c	2020-01-23 01:27:57.000000000 +0100
+++ xf86-video-openchrome-20200131/src/via_display.c	2020-02-21 11:32:04.897052977 +0100
@@ -3492,7 +3492,7 @@
         free(crtc->driver_private);
 }
 
-const xf86CrtcFuncsRec iga1_crtc_funcs = {
+extern xf86CrtcFuncsRec iga1_crtc_funcs = {
     .dpms                   = iga1_crtc_dpms,
     .save                   = iga1_crtc_save,
     .restore                = iga1_crtc_restore,
@@ -3897,7 +3897,7 @@
     viaIGA2SetHIStartingAddress(crtc);
 }
 
-const xf86CrtcFuncsRec iga2_crtc_funcs = {
+extern xf86CrtcFuncsRec iga2_crtc_funcs = {
     .dpms                   = iga2_crtc_dpms,
     .save                   = iga2_crtc_save,
     .restore                = iga2_crtc_restore,
diff -Naur xf86-video-openchrome-20200131.orig/src/via_sii164.c xf86-video-openchrome-20200131/src/via_sii164.c
--- xf86-video-openchrome-20200131.orig/src/via_sii164.c	2020-01-23 01:27:57.000000000 +0100
+++ xf86-video-openchrome-20200131/src/via_sii164.c	2020-02-21 11:33:42.114499095 +0100
@@ -400,7 +400,7 @@
 {
 }
 
-const xf86OutputFuncsRec via_sii164_funcs = {
+extern xf86OutputFuncsRec via_sii164_funcs = {
     .create_resources   = via_sii164_create_resources,
     .dpms               = via_sii164_dpms,
     .save               = via_sii164_save,
diff -Naur xf86-video-openchrome-20200131.orig/src/via_vt1632.c xf86-video-openchrome-20200131/src/via_vt1632.c
--- xf86-video-openchrome-20200131.orig/src/via_vt1632.c	2020-01-23 01:27:57.000000000 +0100
+++ xf86-video-openchrome-20200131/src/via_vt1632.c	2020-02-21 11:33:01.730313892 +0100
@@ -412,7 +412,7 @@
 {
 }
 
-const xf86OutputFuncsRec via_vt1632_funcs = {
+extern xf86OutputFuncsRec via_vt1632_funcs = {
     .create_resources   = via_vt1632_create_resources,
     .dpms               = via_vt1632_dpms,
     .save               = via_vt1632_save,
_______________________________________________
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to