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.
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!