libfirm / cparser

C99 parser and frontend for libfirm
http://pp.ipd.kit.edu/firm
GNU General Public License v2.0
336 stars 38 forks source link

A few quality of life improvements to the driver. #14

Closed ibara closed 4 years ago

ibara commented 6 years ago

Hi --

This pull requests implements a number of quality of life improvements to the cparser driver, especially but not exclusively on OpenBSD.

First, the most general quality of life improvement: teach cparser about the linker flag -fuse-ld. Both clang and gcc use this flag to link against a linker other than the installed default. gcc accepts -fuse-ld=bfd and -fuse-ld=gold while clang accepts both of those plus -fuse-ld=lld. Since cparser simply uses another C compiler for linking, I think adding this option makes sense, since I presume most users of cparser are using some sort of Unix, where clang and/or gcc is the system C compiler.

Next is to teach cparser about the -nopie option. OpenBSD uses this instead of -no-pie.

Next is to set up OpenBSD to default to -fPIC. I am not 100% sure if the location I chose in src/driver/target.c is the most ideal spot, but I hope the intent is clear.

Finally, add OpenBSD to the list of system targets in cparser.1.

Thanks!

johannes-bucher commented 4 years ago

All of your contributions are now included in cparser/libfirm.