Some versions of ld accept /dev/null as a valid input file. Others will
not. The latter versions will give false negatives for --buil-id support,
which breaks linking of Pintos userspace programs. So use a different
method, that I hope will be more reliable, to detect --build-id support.
Reported by Joseph Huang <jdhuang@stanford.edu>.
endif
# Turn off --build-id in the linker, which confuses the Pintos loader.
-ifeq ($(strip $(shell $(LD) --build-id=none -e 0 /dev/null -o /dev/null 2>&1; echo $$?)),0)
+ifeq ($(strip $(shell $(LD) --help | grep -q build-id; echo $$?)),0)
LDFLAGS += -Wl,--build-id=none
endif