[Home]

Summary:ASTERISK-24032: Gentoo compilation emits warning: "_FORTIFY_SOURCE" redefined
Reporter:Kilburn (maddog)Labels:
Date Opened:2014-07-11 21:02:28Date Closed:2014-08-17 17:36:55
Priority:MinorRegression?
Status:Closed/CompleteComponents:General
Versions:11.11.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 1.8.diff
( 1) 10.diff
( 2) 11.diff
( 3) 12.diff
( 4) 13.diff
( 5) config.log
( 6) makeopts
( 7) makeopts.embed_rules
( 8) makeopts.in
( 9) trunk.diff
Description:running make with asterisk 11.11.0, I get

<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

Changelog show changes against ast 1.8 but do not know if this was carried over to ast 11.

Thanks
Comments:By: Rusty Newton (rnewton) 2014-07-14 13:50:06.366-0500

Does this prevent you from building Asterisk or cause an issue other than the warning?

Please describe your OS and build environment, plus how to reproduce the issue and attach your config.log and makeopts files.

Thanks!

By: Kilburn (maddog) 2014-07-21 04:46:36.784-0500

This does not prevent the build, but it throws these errors.

This is on a Gentoo 64 bit. To reproduce the issue, just run make.

Files attached


By: Kilburn (maddog) 2014-07-30 21:01:45.881-0500

Ping. Any suggestions. I would like to roll out AST 11.11

Thanks

By: Matt Jordan (mjordan) 2014-07-30 22:44:10.382-0500

The issue tracker is not a support forum. Whether or not you choose to roll out a version of Asterisk is completely up to you.

As it is, I will say this:
# I have not seen this issue on Asterisk 11.11.0 or in the Asterisk 11 branch
# We routinely test with CentOS, Ubuntu, and Debian. I have not seen this issue on any of those distros.
# We do not have continuous integration services that run Gentoo, nor am I looking to add that at this time.

If someone can provide a fix for this that help the build process on Gentoo that would be great, but it is unlikely to be a high priority.

As far as the information provided so far on this issue, all your configure log shows is that {{FORTIFY_SOURCE}} is supported, which is not surprising.

Can you provide the full output of the build leading up to the warning? Note that you should build with {{make NOISY_BUILD=yes}} to show the full output including the warning.

By: cloos (cloos) 2014-07-31 01:20:25.160-0500

The usual way around this is to unset _FORTIFY_SOURCE before setting it.

Ie, setting AST_FORTIFY_SOURCE to "U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" instead of "-D_FORTIFY_SOURCE=2".


By: cloos (cloos) 2014-07-31 01:28:18.289-0500

I should add, Gentoo patches gcc adding to gcc/c-family/c-cppbuiltin.c:

+  /* Fortify Source enabled by default w/optimization.  */
+  cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+

This can be seen by running:

:; gcc -O2 -dM -E - </dev/null |grep FORT
#define _FORTIFY_SOURCE ((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)

Some other dists do this – or something like it – too.


By: Matt Jordan (mjordan) 2014-08-14 09:38:26.045-0500

If someone would like to provide a patch to Asterisk's build system to prevent this warning, I think we'd be fine reviewing it and having it included for those distros that require this.

However, since Gentoo is not a system that we typically target or test with, I don't think this issue will receive much attention without a patch.

By: cloos (cloos) 2014-08-14 10:03:26.664-0500

Here are diffs against each of the 1.8+ branches and against trunk.

By: Kilburn (maddog) 2014-08-14 16:56:49.280-0500

I can confirm that the diffs cause NO warning messages or errors.
Thanks

By: Boyan Bonev (BuSteR) 2014-08-19 17:33:36.512-0500

1.8.diff is not working for me with asterisk 1.8.30 and 1.8.29
GCC - 4.7.3



By: cloos (cloos) 2014-08-19 18:25:55.673-0500

The patch as I posted only modifies configure.ac; to use it with one of the tar releases you need to run ./bootstrap.sh after patching.

The svn commit (rev 421227 for 1.8) also updates configure.

If you have an svn checkout of branches/1.8, then:

 :; svn diff  -r421226:r421227 --force

will generate a diff including the changes to configure.

You also can see the complete diff at:

 http://svnview.digium.com/svn/asterisk?view=revision&revision=421227

from which you can get the patches for both files:

 http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=patch&r1=421227&r2=421226
 http://svnview.digium.com/svn/asterisk/branches/1.8/configure?view=patch&r1=421227&r2=421226