www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - how to pass -pie flag to dmd(or rdmd or ldc) ?

reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
Can we do this is 1 step?

```
rdmd -offoo.o -c foo.d
g++ -o foo foo.o -pie -Wl,--export-dynamic
```

Ideally something like this would be great:

```
rdmd -offoo -extra_flags=-pie foo.d
```

where -extra_flags=flag1,flag2 can takes comma separated options
Jan 25
parent Jacob Carlborg <doob me.com> writes:
On 2017-01-26 04:43, Timothee Cour via Digitalmars-d wrote:
 Can we do this is 1 step?

 ```
 rdmd -offoo.o -c foo.d
 g++ -o foo foo.o -pie -Wl,--export-dynamic
 ```

 Ideally something like this would be great:

 ```
 rdmd -offoo -extra_flags=-pie foo.d
 ```

 where -extra_flags=flag1,flag2 can takes comma separated options
Yeah, I've always wanted to be able to pass flags to the C compiler and not just the linker. -- /Jacob Carlborg
Jan 25