Recent

Author Topic: [SOLVED]Do we have the plan about adding option -fPIE?  (Read 1927 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3310
    • StrumPract is the musicians best friend
I use this and it works for all my Unix releases (Linux, FreeBSD, NetBSD, MacOs):

Code: Pascal  [Select][+][-]
  1. -Cg -k-pie -k-znow

I only have problems with OpenBSD amd64/aarch64, here the result dont show a pie executable.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

MarkMLl

  • Hero Member
  • *****
  • Posts: 7511
Without wanting to divert the thread, I can confirm that -k (or the equivalent, as shown, from the Lazarus IDE) is useful for all sorts of things.

The important thing is no extra spaces, and the right number of dashes as required by the linker.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dbannon

  • Hero Member
  • *****
  • Posts: 3019
    • tomboy-ng, a rewrite of the classic Tomboy
Proper hardening needs -

 -Cg  -k-pie -k-znow

As I mentioned above. And demonstrated with (any recent) 'file' command.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TYDQ

  • Full Member
  • ***
  • Posts: 102
Proper hardening needs -

 -Cg  -k-pie -k-znow

As I mentioned above. And demonstrated with (any recent) 'file' command.

Davo
I was told that there is a -static-pie option in gcc,Do we have the plan that adding -static-pie?

dbannon

  • Hero Member
  • *****
  • Posts: 3019
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Do we have the plan about adding option -fPIE?
« Reply #19 on: August 21, 2024, 01:35:45 am »
While obviously I have no idea whats planned its worth noting that those PIE options are not there for FPC, they are passed directly to the linker. Maybe the same applies to -statis-pie ?

Further research is indicated ....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TYDQ

  • Full Member
  • ***
  • Posts: 102
Re: Do we have the plan about adding option -fPIE?
« Reply #20 on: August 21, 2024, 02:10:11 am »
While obviously I have no idea whats planned its worth noting that those PIE options are not there for FPC, they are passed directly to the linker. Maybe the same applies to -statis-pie ?

Further research is indicated ....

Davo
However,the linker's(ld's) -static-pie option is depracated now,I don't know why depracate that.
But gcc still have this option.

TYDQ

  • Full Member
  • ***
  • Posts: 102
Re: Do we have the plan about adding option -fPIE?
« Reply #21 on: August 22, 2024, 12:16:45 pm »
While obviously I have no idea whats planned its worth noting that those PIE options are not there for FPC, they are passed directly to the linker. Maybe the same applies to -statis-pie ?

Further research is indicated ....

Davo
I have discovered that combine -k-pie -k--no-dynamic-linker can make static pie.

 

TinyPortal © 2005-2018