Bug 94398 - libpciaccess configure script identifies PGI compilers as GCC
Summary: libpciaccess configure script identifies PGI compilers as GCC
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/pciaccess (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
Depends on:
Reported: 2016-03-04 22:21 UTC by Adam Stewart
Modified: 2018-08-10 20:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

STDOUT/STDERR from build process (8.51 KB, text/plain)
2016-03-04 22:21 UTC, Adam Stewart
no flags Details
config.log (85.08 KB, text/plain)
2016-03-04 22:22 UTC, Adam Stewart
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Stewart 2016-03-04 22:21:19 UTC
Created attachment 122113 [details]
STDOUT/STDERR from build process


I am unable to build libpciaccess 0.13.4 using our PGI 15.10 compilers. We are running CentOS 6 on an x86_64 platform.

I have attached the relevant config.log and the build output. Configure passes but make fails. At the bottom of the build.out file, you'll notice several complaints about undefined references. Are you able to reproduce this problem or is there a problem with our compilers/dependencies?

Adam Stewart

Laboratory Computing Resource Center
Argonne National Laboratory
Comment 1 Adam Stewart 2016-03-04 22:22:05 UTC
Created attachment 122114 [details]
Comment 2 Alan Coopersmith 2016-03-04 22:27:25 UTC
This seems to be a problem with your compilers not being compatible with the
definitions provided for those in the system headers - the relevant bit of
src/linux_sysfs.c is:

#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
#include <sys/io.h>
#define inb(x) -1
#define inw(x) -1
#define inl(x) -1
#define outb(x,y) do {} while (0)
#define outw(x,y) do {} while (0)
#define outl(x,y) do {} while (0)
#define iopl(x) -1
Comment 3 Adam Stewart 2016-03-04 22:29:33 UTC
Wow, thanks for the fast response!

Does this mean that libpciaccess does not support the latest PGI compilers or is there a bug in the PGI compilers that I should report?

Comment 4 Alan Coopersmith 2016-03-04 22:33:07 UTC
Unfortunately, the bug seems to be an incompatibility between the PGI compilers
and the Centos headers - I don't have either handy here to say which is at
fault, but think pciaccess is just caught in the middle and would work if you
fixed that.

That said, since no one in X.Org has access to PGI compilers, we can't claim
to provide support for them, but we don't refuse fixes if those who do have
access provide patches.
Comment 5 Adam Stewart 2016-03-04 22:40:04 UTC
Ok, I'll try to get in touch with PGI and see if they have any thoughts on this issue. In the meantime, feel free to mark this issue as resolved. Thank you for your time!
Comment 6 Adam Stewart 2016-03-22 15:43:37 UTC
I just wanted to mention that I submitted a bug report with PGI and they logged it as TPR 22355. The report can be viewed at:

Comment 7 Adam Stewart 2017-01-30 20:56:31 UTC
The PGI developers believe they have a solution for this problem.

> It is a header file issue. Workaround is to add
> -D__GNUC__=3
> to your compile line.

I don't know any more details than that, but if you want to try writing a patch to do that, I would be more than happy to test it with my PGI compiler license. Otherwise I'll try to add CFLAGS manually myself.
Comment 8 Adam Stewart 2017-01-31 16:01:50 UTC
Ok, adding `CFLAGS=-D__GNUC__=3` gets me past the original problem I reported. However, a new problem arises:

pgcc-Error-Unknown switch: -fno-strict-aliasing

I believe that your configure script isn't properly detecting the PGI compilers and tries to add GCC-only flags. Any suggestions as to how I can get past this problem?
Comment 9 Adam Stewart 2017-01-31 16:32:48 UTC
Actually, looking more closely at the configure script, it looks like it is checking whether or not __GNUC__ is defined. If so, it detects it as GCC. I wonder if the fix for the other problem is causing this new problem.
Comment 10 GitLab Migration User 2018-08-10 20:18:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libpciaccess/issues/7.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.