<html><head></head><body><div>Hi All,</div><div><br></div><div>On Mon, 2024-10-28 at 23:32 +0100, Abou Al Montacir wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Hi Peter,</div><div><br></div><div>On Mon, 2024-10-28 at 12:32 +0000, Peter B wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>A further thought on this subject.<br></div><div><br></div><div>It would of course would be preferable to build with -pie,<br></div><div>rather than override the warning, if it works.<br></div></blockquote><div>Yes, but as we did not have a new FPC version, I doubt it will work.</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div><br></div><div>Does anyone know for sure whether there is still any issue here with armhf?<br></div></blockquote><div>I suppose yes, but we can have a trial.</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div><br></div><div>pie is disabled in the lazarus build for armhf,<br></div><div>but I have two fpc packages that build with -pie on armhf<br></div><div>and both are passing autopkgtest.<br></div></blockquote><div>Lazarus is unlikely to be compared to other projects as it is far bigger than any other FPC compiled program.</div><div>However, we can try and see what issue will raise.</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div><br></div><div><br></div><div>Another question;<br></div><div>-pie is disabled on three architectures, armhf, ppc64 & ppc64el.<br></div><div>but there are only two lintian warnings. Any ideas?</div></blockquote><div>No idea</div></blockquote><div><br></div><div>I would propose that, instead of letting each program bother with hardening alone, FPC provides a facility to help.</div><div><br></div><div>The solution I imagine is that we provide a hardening configuration file (let's call it <i><b>hardening</b></i>) in FPC configuration directory (<i><b>/etc/fpc-${VERSION}.cfg.d</b></i>).</div><div>This way any program that want to enforce hardening, just add <i><b>@hardening</b></i> compiler option and it is done with hardening.</div><div>A basic example will be: <i><b>fpc @hardening myprog</b></i></div><div><br></div><div>Now the content of the file may vary between targets. For example it can be empty for those that do not support PIE and other hardening option, but not for amd64.</div><div>Something like this:</div><pre>#IFDEF CPUAMD64</pre><pre>-XD</pre><pre>#ENDIF</pre><pre><br></pre><pre>#IFDEF CPUI386</pre><pre>-XD</pre><pre>#ENDIF</pre><pre><br></pre><pre>#IFDEF CPUARMEL</pre><pre>-XD</pre><pre>#</pre><pre><br></pre><pre>#IFDEF CPUARM64</pre><pre>-XD</pre><pre>#</pre><pre><br></pre><pre>#SECTION FPC_LINK_DYNAMIC</pre><pre>#WRITE Enabled Hardening for Dynamically Linked Executable</pre><pre><br></pre><pre># Enable Position Independent Code (-fPIC)</pre><pre>-Cg</pre><pre><br></pre><pre># Force dynamic linker</pre><pre>-k--dynamic-linker=/lib64/ld-linux-x86-64.so.2</pre><pre><br></pre><pre># Enabled Position Independent Executable (-fPIE)</pre><pre>-k-pie</pre><pre>-k-znow</pre><div><br></div><div>This forces all programs to be dynamically linked (even if not needed) and to be PIE.</div><div>If everyone is OK, I can prepare an upload with that change.</div><pre>-- <br></pre><pre>Cheers,
Abou Al Montacir</pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"></blockquote></body></html>