http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57409
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Last reconfirmed| |2013-05-25 Resolution|INVALID |--- Summary|PIE (-fPIE -pie) prevents |PIE doesn't work with GNU |any malloc on Solaris 10 |binutils on SPARC/Solaris |sparc | Ever confirmed|0 |1 Severity|major |enhancement --- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > 1) if gcc does not support pie on solaris 10 sparc (I can accept that), gcc > toolchain should detect this and protest (from ./configure) if PIE can't be > used on a given platform. Using PIE flag should make gcc return an error > "PIE no supported on this platform" Maybe, but the manual is very clear: `-pie' Produce a position independent executable on targets that support it. For predictable results, you must also specify the same set of options used for compilation (`-fpie', `-fPIE', or model suboptions) when you specify this linker option. so one could argue that it's up to the user to check that it works on a given platform. > 2) at the same time, Todd Miller (sudo developer) was able to use PIE on a > very similar machine (see > http://www.sudo.ws/pipermail/sudo-users/2013-May/005195.html) using gcc 4.8. > It looks there is a way to make gcc work with PIE. He's using the Sun tools and you're using the GNU binutils, so this may primarily be a binutils issue. Does it work with the Sun tools on your machine?