On systems using dsymutil the check for the "-g" flag was failing not
because the compiler didn't provide it but because of `/dev/null`
being used as output file.
---
This happened on MacOS where I discovered the issue executing `cc -g -v
-o /dev/null check.c`. Here's the relevant part of the output (I'm adding
it here just in case someone searches for this error):
...
"/Library/Developer/CommandLineTools/usr/bin/dsymutil" -o /dev/null.dSYM /dev/null
error: cannot parse the debug map for '/dev/null': The file was not recognized as a valid object file
clang: error: dsymutil command failed with exit code 1 (use -v to see invocation)
config.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.sh b/config.sh
index fd6a325..179515c 100644
--- a/config.sh
+++ b/config.sh
@@ -73,7 +73,7 @@ test_cflags() {
werror="-Werror"
;;
esac
- if $CC $werror "$@" -o /dev/null "$outdir"/check.c >/dev/null 2>&1
+ if $CC $werror "$@" -o "$outdir"/check "$outdir"/check.c >/dev/null 2>&1
then
append_cflags "$@"
else
--
2.20.1 (Apple Git-117)