You are not logged in.

#1 2015-06-17 13:29:55

pgzh
Member
Registered: 2013-03-20
Posts: 19

[SOLVED] xorg-server build from abs fails

Hi,

ever since I installed the update to gcc-5.1.0 the building of xorg-server from abs fails:

$ makepkg -s
[...]
  CCLD     libXextdpmsstubs.la
xvdisp.c: In function ‘XineramifyXv’:
xvdisp.c:1783:37: error: array subscript is above array bounds [-Werror=array-bounds]
                 if (MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j))
                                     ^
xvdisp.c:1784:31: error: array subscript is above array bounds [-Werror=array-bounds]
                     port->info[k].id = MatchingAdaptors[k]->base_id + j;
                               ^
xvdisp.c:1786:31: error: array subscript is above array bounds [-Werror=array-bounds]
                     port->info[k].id = 0;
                               ^
cc1: some warnings being treated as errors
Makefile:777: recipe for target 'xvdisp.lo' failed
make[1]: *** [xvdisp.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
[...]
make: *** [all-recursive] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

This happens for xorg-server-1.17.1-6 and up as well as for xorg-server-1.17.2-1 .

$ gcc --version
gcc (GCC) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I searched for a solution or a patch, but couldn't find anything.
xorg-server-1.17.2 supposedly has build fixes with gcc-5.1, but obviously that didn't help much for me.

Otherwise my arch installation is up-to-date.

I'm building on x86-64 (Haswell) with

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=native -mtune=native -O3 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="-march=native -mtune=native -O3 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
LDFLAGS="-Wl,-O2,--sort-common,--as-needed,-z,relro"
MAKEFLAGS="-j16"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"

Has anyone else seen this or any idea how to fix it?

Last edited by pgzh (2015-06-19 15:03:20)

Offline

#2 2015-06-18 12:01:14

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] xorg-server build from abs fails

It seems that the culprit is the compiler optimization... just try to revert to the Arch default -O2 and see if it works.


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-06-18 17:36:42

pgzh
Member
Registered: 2013-03-20
Posts: 19

Re: [SOLVED] xorg-server build from abs fails

Using

CFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"

in makepkg.conf actually worked, I totally forgot about changing the optimization level.
Since this is the first time for a very long time I've encountered a problem with -O3, do you think this should be reported as a bug for xorg-server?
With gcc-4.9 building xorg-server with -O3 optimization level worked perfectly fine for me (I built 1.17.1 like that) and gcc-5.1 causes this culprit.

Anyways, thank you very much for your help!

Offline

#4 2015-06-19 04:59:09

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] xorg-server build from abs fails

I don't know if it is an actual bug in xorg-server code (there was a bug report for gcc for a similar error but it has been fixed recently) but it would be useful if you let the upstream know about this issue.

Also remember to mark this thread as [SOLVED]: https://bbs.archlinux.org/viewtopic.php?id=130309


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

Board footer

Powered by FluxBB