Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 430136 (PR54182) - sys-devel/gcc: use -fvisibility=hidden with -fPIE (?)
Summary: sys-devel/gcc: use -fvisibility=hidden with -fPIE (?)
Status: RESOLVED UPSTREAM
Alias: PR54182
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR54182
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 06:31 UTC by wbrana
Modified: 2012-08-11 07:58 UTC (History)
1 user (show)

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


Attachments
modified 06_all_gcc46_esp.h.patch from piepatches (06_all_gcc46_esp.h.patch,6.76 KB, text/plain)
2012-08-06 06:31 UTC, wbrana
Details
modified specs file (specs.471.txt,6.47 KB, text/plain)
2012-08-06 13:05 UTC, wbrana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wbrana 2012-08-06 06:31:39 UTC
Created attachment 320544 [details]
modified 06_all_gcc46_esp.h.patch from piepatches

gcc could use -fvisibility=hidden with -fPIE
Comment 1 wbrana 2012-08-06 09:45:41 UTC
It seems that it isn't already needed.
Comment 2 wbrana 2012-08-06 10:01:14 UTC
I was wrong. It is still needed. Hardened gcc 4.7.1 should, but doesn't use -fvisibility=hidden if -fno-PIE isn't used.
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2012-08-06 11:43:55 UTC
-fvisibility-hidden is not a flag that you enable globally.
Comment 4 wbrana 2012-08-06 11:46:41 UTC
Non-hardened gcc has -fvisibility=hidden enabled globally.
Also hardened gcc with enable -fvisibility=hidden with -fno-PIE.
Comment 5 wbrana 2012-08-06 12:01:45 UTC
Also hardened gcc enable -fvisibility=hidden with -fno-PIE.
Comment 6 wbrana 2012-08-06 13:05:14 UTC
Created attachment 320558 [details]
modified specs file

previous modified patch can't be used.
gcc has to dump specs file with -dumpspecs after compilation
at line 168 "-fPIE" has to be replaced with "-fPIE -fvisibility=hidden"
modified specs file has to be stored in directory
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1
Comment 7 Magnus Granberg gentoo-dev 2012-08-06 15:03:26 UTC
(In reply to comment #4)
> Non-hardened gcc has -fvisibility=hidden enabled globally.
> Also hardened gcc with enable -fvisibility=hidden with -fno-PIE.

(In reply to comment #5)
> Also hardened gcc enable -fvisibility=hidden with -fno-PIE.

What do you get if you add -fPIE -pie to the command line for the no hardened one?
Comment 8 wbrana 2012-08-06 16:07:40 UTC
-fPIE -pie disabled -fvisibility=hidden with non-hardened one
Comment 9 SpanKY gentoo-dev 2012-08-06 16:38:22 UTC
this is something to suggest on the upstream gcc-patches@gcc.gnu.org list
Comment 10 wbrana 2012-08-10 19:02:26 UTC
I opened upstream bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54182
Comment 11 wbrana 2012-08-10 21:34:41 UTC
Why it has to fixed upstream?
Vanilla GCC is broken and doesn't use PIE by default. Gentoo Hardened fixed it. Why Gentoo Hardened can't fix also -fvisibility=hidden?
Comment 12 wbrana 2012-08-11 07:58:08 UTC
Upstream doesn't want to fix it.