Re: Porter roll call for Debian Stretch
> On Wed, Aug 17, 2016 at 10:05:06PM +0200, email@example.com wrote:
>> * If we were to enable -fPIE/-pie by default in GCC-6, should that change
>> also apply to this port? 
> If -fPIE is the default will -fPIC override it?
> It will also default to tell the linker to use -pie, but then
> don't do it when you want to create a shared library?
I believe so. At least, Ubuntu made PIE default in their compiler
without having to change all SO packages to still build.
Admittedly, it could also be that GCC uses some built "compiler spec"
files for this case (a la an implicit "-specs=$FILE"), which are similar
to those Redhat uses for this purposes (see  for an example of such
Regardless, it seems to "just work(TM)" if you pass the proper flags
when compiling your SOs.
>>From what I understand, depending on what the .o file is going to
> be used for you want different things:
> - shared library: -fPIC
> - executable: -fPIC or -fPIE both work, but prefer -fPIE
> - static library: Same as executables
> For static libraries we now have a policy to not use -fPIC,
> should that then get replaced by using -fPIE?
Honestly, I had not thought about that. From the looks of it, de facto
we will end up with -fPIE being the default for static libraries as well.
I would be supporting that change on the assumption that it requires
less work from individual maintainers (and presumably has no notable
downsides in the final result).
 Example spec files for this case seems to be something like:
NB: I manually carved them out of a diff without testing them.