Opened 20 months ago

Last modified 19 months ago

#71649 assigned defect

xorg-server-legacy fails to build with mesa @24.3.2: error: redefinition of typedef 'GLsync'

Reported by: barracuda156 Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: Cc:
Port: xorg-server-legacy, mesa

Description

libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../hw/xfree86/os-support -I../hw/xfree86/os-support/bus -I../hw/xfree86/common -I../hw/xfree86/dri -I../hw/xfree86/dri2 -I../mi -I../present -isystem/opt/local/include/LegacySupport -I/opt/local/include -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I../include -I../include -I../Xext -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow -I../miext/damage -I../render -I../randr -I../fb -I../dbe -I../present -pipe -Os -arch ppc -D_THREAD_SAFE -pthread -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA -MT glxdriswrast.lo -MD -MP -MF .deps/glxdriswrast.Tpo -c glxdriswrast.c  -fno-common -DPIC -o .libs/glxdriswrast.o
In file included from glxdriswrast.c:39:
/opt/local/include/GL/internal/dri_interface.h:445: error: redefinition of typedef 'GLsync'
/opt/local/include/GL/glext.h:1367: error: previous declaration of 'GLsync' was here
depbase=`echo glxdricommon.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ../libtool  --tag=CC   --mode=compile /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../include  -I../hw/xfree86/os-support -I../hw/xfree86/os-support/bus -I../hw/xfree86/common -I../hw/xfree86/dri -I../hw/xfree86/dri2 -I../mi -I../present -isystem/opt/local/include/LegacySupport -I/opt/local/include -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I../include -I../include -I../Xext  -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow  -I../miext/damage -I../render -I../randr -I../fb -I../dbe -I../present  -pipe -Os -arch ppc -D_THREAD_SAFE -pthread -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA -MT glxdricommon.lo -MD -MP -MF $depbase.Tpo -c -o glxdricommon.lo glxdricommon.c &&\
	mv -f $depbase.Tpo $depbase.Plo
make[1]: *** [glxdriswrast.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../hw/xfree86/os-support -I../hw/xfree86/os-support/bus -I../hw/xfree86/common -I../hw/xfree86/dri -I../hw/xfree86/dri2 -I../mi -I../present -isystem/opt/local/include/LegacySupport -I/opt/local/include -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I../include -I../include -I../Xext -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow -I../miext/damage -I../render -I../randr -I../fb -I../dbe -I../present -pipe -Os -arch ppc -D_THREAD_SAFE -pthread -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA -MT glxdricommon.lo -MD -MP -MF .deps/glxdricommon.Tpo -c glxdricommon.c  -fno-common -DPIC -o .libs/glxdricommon.o
In file included from glxdricommon.c:36:
/opt/local/include/GL/internal/dri_interface.h:445: error: redefinition of typedef 'GLsync'
/opt/local/include/GL/glext.h:1367: error: previous declaration of 'GLsync' was here
make[1]: *** [glxdricommon.lo] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67/glx'
make: *** [all-recursive] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67" && /usr/bin/make -j6 -w all V=1 
Exit code: 2
Error: Failed to build xorg-server-legacy: command execution failed

Attachments (1)

main.log (1.2 MB) - added by barracuda156 20 months ago.

Download all attachments as: .zip

Change History (6)

Changed 20 months ago by barracuda156

Attachment: main.log added

comment:1 Changed 20 months ago by barracuda156

In turn, with gcc14 it fails on:

libtool: compile:  /opt/local/bin/gcc-mp-14 -DHAVE_CONFIG_H -I. -I../include -isystem/opt/local/include/LegacySupport -I/opt/local/include -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I../include -I../include -I../Xext -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow -I../miext/damage -I../render -I../randr -I../fb -I../dbe -I../present -pipe -Os -arch ppc -D_THREAD_SAFE -pthread -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA -MT render.lo -MD -MP -MF .deps/render.Tpo -c render.c  -fno-common -DPIC -o .libs/render.o
picture.c: In function 'CreateSolidPicture':
picture.c:876:26: error: array subscript 'union _SourcePict[0]' is partly outside array bounds of 'unsigned char[16]' [-Werror=array-bounds=]
  876 |     pPicture->pSourcePict->type = SourcePictTypeSolidFill;
      |                          ^~
picture.c:870:45: note: object of size 16 allocated by 'malloc'
  870 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
picture.c: In function 'CreateLinearGradientPicture':
picture.c:908:26: error: array subscript 'union _SourcePict[0]' is partly outside array bounds of 'unsigned char[28]' [-Werror=array-bounds=]
  908 |     pPicture->pSourcePict->linear.type = SourcePictTypeLinear;
      |                          ^~
picture.c:901:45: note: object of size 28 allocated by 'malloc'
  901 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
picture.c: In function 'CreateConicalGradientPicture':
picture.c:991:26: error: array subscript 'union _SourcePict[0]' is partly outside array bounds of 'unsigned char[24]' [-Werror=array-bounds=]
  991 |     pPicture->pSourcePict->conical.type = SourcePictTypeConical;
      |                          ^~
picture.c:984:45: note: object of size 24 allocated by 'malloc'
  984 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient));
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [picture.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67/render'
make: *** [all-recursive] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_x11_xorg-server-legacy/xorg-server-legacy/work/xorg-server-16f52e51a203bdb90de5d94478aa9bca4e9c2e67" && /usr/bin/make -j6 -w all V=1 
Exit code: 2

comment:2 Changed 20 months ago by barracuda156

This looks like a bug in mesa, since its headers are merely pulled in here.

Upd. Opened an issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12378

Last edited 20 months ago by barracuda156 (previous) (diff)

comment:3 Changed 20 months ago by barracuda156

Fixed in upstream in https://gitlab.freedesktop.org/mesa/mesa/-/commit/346f4d3c11b7299b10617606d8c830c4ccf1ff48 This is a critical issue and the fix should be backported.

comment:4 Changed 20 months ago by barracuda156

Owner: set to jeremyhu
Status: newassigned

comment:5 Changed 19 months ago by kencu (Ken)

Fixing the build of xorg-server-legacy to build with the newer gcc versions might still be needed at some point.

I previously fixed xorg-server to build with non-Apple gcc versions back here 6 years ago, when gcc6 was current:

https://trac.macports.org/ticket/57333#comment:14

Some version of those fixes is still needed.

Using:

#define __private_extern__  __attribute__((visibility("hidden")))

still seems like the more appropriate fix for that issue, and is deserving of a retry at some point.

The patch to fix the error building xorg-server with newer gcc versions is here:

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256

https://gitlab.freedesktop.org/ofourdan/xserver/-/commit/53173fdab492f0f638f6616fcf01af0b9ea6338d

Last edited 19 months ago by kencu (Ken) (previous) (diff)
Note: See TracTickets for help on using tickets.