digitalmars.D.learn - Why is the fPIC switch missing?
- Emmanuelle (10/11) Sep 22 2019 Hello. My problem is exactly what it says on the title: my dmd
- Emmanuelle (3/3) Sep 22 2019 Forgot to say: dmd v2.088.0. Also, weirdly enough, `dmd
- Daniel Kozak (3/6) Sep 22 2019 https://forum.dlang.org/post/qqxmnoshytmzflviwhcz@forum.dlang.org
- Daniel Kozak (4/15) Sep 22 2019 It seems it is not available for windows and MacOS:
- Boris Carvajal (5/7) Sep 23 2019 I think it's not needed. The generated code on Windows is always
- IGotD- (3/10) Sep 23 2019 Is PIC really enabled by default for Windows 32-bit binaries.
- Vladimir Panteleev (9/14) Sep 23 2019 I believe Windows uses relocations. Relocations require patching
Hello. My problem is exactly what it says on the title: my dmd (windows 7, x64) doesn't seem to have -fPIC: ---dmd -fPICError: unrecognized switch '-fPIC' run `dmd` to print the compiler manual run `dmd -man` to open browser on manual --- `dmd --help` also doesn't have anything about fPIC. Sorry if I'm being dense but why is that? Is it only available on Linux? Thank you!
Sep 22 2019
Forgot to say: dmd v2.088.0. Also, weirdly enough, `dmd --version` outputs `DMD32 D Compiler v2.088.0-dirty`. Why is "dirty" there?
Sep 22 2019
On Mon, Sep 23, 2019 at 3:35 AM Emmanuelle via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:Forgot to say: dmd v2.088.0. Also, weirdly enough, `dmd --version` outputs `DMD32 D Compiler v2.088.0-dirty`. Why is "dirty" there?https://forum.dlang.org/post/qqxmnoshytmzflviwhcz forum.dlang.org
Sep 22 2019
On Mon, Sep 23, 2019 at 3:35 AM Emmanuelle via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:Hello. My problem is exactly what it says on the title: my dmd (windows 7, x64) doesn't seem to have -fPIC: ---It seems it is not available for windows and MacOS: https://github.com/dlang/dmd/blob/639c67162b2be90ebf8dc9a9f8118cb2a9606569/src/dmd/cli.d#L323dmd -fPICError: unrecognized switch '-fPIC' run `dmd` to print the compiler manual run `dmd -man` to open browser on manual --- `dmd --help` also doesn't have anything about fPIC. Sorry if I'm being dense but why is that? Is it only available on Linux? Thank you!
Sep 22 2019
On Monday, 23 September 2019 at 01:31:03 UTC, Emmanuelle wrote:Hello. My problem is exactly what it says on the title: my dmd (windows 7, x64) doesn't seem to have -fPIC:I think it's not needed. The generated code on Windows is always position independent. Still, DMD should warn about it and keep compiling like GCC, not fail miserably.
Sep 23 2019
On Monday, 23 September 2019 at 08:19:35 UTC, Boris Carvajal wrote:On Monday, 23 September 2019 at 01:31:03 UTC, Emmanuelle wrote:Is PIC really enabled by default for Windows 32-bit binaries.Hello. My problem is exactly what it says on the title: my dmd (windows 7, x64) doesn't seem to have -fPIC:I think it's not needed. The generated code on Windows is always position independent. Still, DMD should warn about it and keep compiling like GCC, not fail miserably.
Sep 23 2019
On Monday, 23 September 2019 at 08:19:35 UTC, Boris Carvajal wrote:On Monday, 23 September 2019 at 01:31:03 UTC, Emmanuelle wrote:I believe Windows uses relocations. Relocations require patching the image after loading using a relocation table. Position-independent code does not require relocations, it is ready to run from any address straight after loading. This allows multiple copies of programs or libraries to be loaded at the same time in different processes at different addresses (with ASLR), but share their physical memory pages.Hello. My problem is exactly what it says on the title: my dmd (windows 7, x64) doesn't seem to have -fPIC:I think it's not needed. The generated code on Windows is always position independent.
Sep 23 2019