Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC

Lists: pgsql-committerspgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-09-30 00:07:48
Message-ID: E1TI74W-0003HZ-63@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Disable _FORTIFY_SOURCE with ICC

There are apparently some incompatibilities, per buildfarm.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/97ec9621572054be96b0447395f5fa2438a4d6cb

Modified Files
--------------
src/template/linux | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)


From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-02 16:05:49
Message-ID: CAEYLb_Xhg0z+PAdwzWoOr0QmrPNmXwGY19cFL9oqbo5n3GLFKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 30 September 2012 01:07, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Disable _FORTIFY_SOURCE with ICC

I'm having some problems of my own with this. Specifically:

gcc -O0 -g -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -fexcess-precision=standard -g -I../../src/port -DFRONTEND
-I../../src/include -D_GNU_SOURCE -D_FORTIFY_SOURCE=2
-I/usr/include/libxml2 -c -o qsort.o qsort.c -MMD -MP -MF
.deps/qsort.Po
In file included from /usr/include/stdio.h:28:0,
from ../../src/include/c.h:67,
from qsort.c:46:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]
...
[peter(at)peterlaptop port]$ gcc --version
gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
...

--
Peter Geoghegan http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-05 02:55:41
Message-ID: 1349405741.23971.3.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, 2012-10-02 at 17:05 +0100, Peter Geoghegan wrote:
> On 30 September 2012 01:07, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > Disable _FORTIFY_SOURCE with ICC
>
> I'm having some problems of my own with this. Specifically:
>
> gcc -O0 -g -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels
> -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
> -fwrapv -fexcess-precision=standard -g -I../../src/port -DFRONTEND
> -I../../src/include -D_GNU_SOURCE -D_FORTIFY_SOURCE=2
> -I/usr/include/libxml2 -c -o qsort.o qsort.c -MMD -MP -MF
> .deps/qsort.Po
> In file included from /usr/include/stdio.h:28:0,
> from ../../src/include/c.h:67,
> from qsort.c:46:
> /usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE
> requires compiling with optimization (-O) [-Wcpp]
> ...
> [peter(at)peterlaptop port]$ gcc --version
> gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
> ...

Which glibc version is this? (Run /lib/libc.so)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Subject: Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-05 03:22:25
Message-ID: 27654.1349407345@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On Tue, 2012-10-02 at 17:05 +0100, Peter Geoghegan wrote:
>> /usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE
>> requires compiling with optimization (-O) [-Wcpp]

> Which glibc version is this? (Run /lib/libc.so)

I've seen this warning in recent Fedora builds, though not on my F16
production box. Some googling suggests the locution

#if __OPTIMIZE__
#define _FORTIFY_SOURCE 2
#endif

but I've not tested that.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Subject: Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-05 03:37:58
Message-ID: 27946.1349408278@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

I wrote:
> I've seen this warning in recent Fedora builds, though not on my F16
> production box. Some googling suggests the locution

> #if __OPTIMIZE__
> #define _FORTIFY_SOURCE 2
> #endif

> but I've not tested that.

A bit later: testing on an F17 box (glibc-2.15-56.fc17.x86_64)
confirms Peter G's complaint, and also confirms that putting
the above into port/linux.h (instead of the template file) fixes the
problem. Don't know how to disable it on ICC, but I suppose there's
some way to test for ICC via an #if.

regards, tom lane


From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-08 13:39:10
Message-ID: CAEYLb_Xwg-WEJoSh-eNSgJQHS1UOEaRZGQepuNk7-=ZOkJW0Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 5 October 2012 04:37, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> A bit later: testing on an F17 box (glibc-2.15-56.fc17.x86_64)
> confirms Peter G's complaint, and also confirms that putting
> the above into port/linux.h (instead of the template file) fixes the
> problem. Don't know how to disable it on ICC, but I suppose there's
> some way to test for ICC via an #if.

I was using F17 + glibc 2.15 too.

http://www.acsu.buffalo.edu/~charngda/icc.html indicates that ICC
defines a macro __ICC, which evaluates to an integer constant
representing the ICC version numbers. I guess that that particular
source isn't very trustworthy, but that's what we have a build farm
for.

Small patch that hopefully fixes everything for everyone is attached.
However, when I build at -O2 with the system GCC (on the same F17 box
with no changes to CFLAGS; just "./configure --with-libxml
--prefix=/home/peter/pgsql --enable-depend") this patch (when applied
to today's master) sees the following warnings raised:

zic.c: In function ‘writezone’:
zic.c:1752:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1753:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1754:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1755:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1756:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1757:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1758:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1759:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1760:3: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1772:4: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c:1785:4: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c: In function ‘puttzcode64’:
zic.c:1514:2: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
zic.c: In function ‘puttzcode’:
zic.c:1505:2: warning: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result [-Wunused-result]
In file included from gram.y:13502:0:
scan.c: In function ‘yy_try_NUL_trans’:
scan.c:16247:23: warning: unused variable ‘yyg’ [-Wunused-variable]

--
Peter Geoghegan http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Attachment Content-Type Size
fortify_source_fix.2012_10_08.patch application/octet-stream 1.0 KB

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-10 10:29:35
Message-ID: CAEYLb_VpHrv5-kgZMU6pnrbyNPoE9RtsV8_djXgf76WSijvdpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 8 October 2012 14:39, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> Small patch that hopefully fixes everything for everyone is attached.

Will someone take a look at this, please?

--
Peter Geoghegan http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Disable _FORTIFY_SOURCE with ICC
Date: 2012-10-11 01:46:15
Message-ID: 1349919975.2028.0.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Wed, 2012-10-10 at 11:29 +0100, Peter Geoghegan wrote:
> On 8 October 2012 14:39, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> > Small patch that hopefully fixes everything for everyone is attached.
>
> Will someone take a look at this, please?

I've removed it. It had too many problems.