Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497122 - Hardened/Toolchain on the wiki is missing something about -fno-strict-overflow
Summary: Hardened/Toolchain on the wiki is missing something about -fno-strict-overflow
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-05 08:42 UTC by Agostino Sarubbo
Modified: 2014-10-17 19:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2014-01-05 08:42:41 UTC
I just do not see anything about it.
Comment 1 Agostino Sarubbo gentoo-dev 2014-02-16 15:01:27 UTC
ping
Comment 2 Agostino Sarubbo gentoo-dev 2014-03-10 06:12:05 UTC
another ping
Comment 3 Anthony Basile gentoo-dev 2014-10-17 19:17:58 UTC
I'm not sure why this should be in the hardened wiki.  -fno-strict-overflow stops gcc from assuming that signed overflow won't happen and prevents certain optimization based on that assumption at -O2 and above.

For example, 

   int i = 0;
   for(;;) {
      if (i + 1 < 0) {
          printf("how can this be?! i = %d\n", i);
          exit(0);
      }
      i++;
   }

will sign overflow i and yield true when i = 2147483647.  -fstrict-overflow would say to the compiler "go ahead and assume (i+1<0) is always false and do you optimization tricks based on that assumption."  -fno-strict-overflow says, no don't assume that when you optimize.

I hope this helps.  If you want to add it to some wiki somewhere, go ahead, but I don't see it as specifically hardened.