Makefile gcc -o /dev/null: the dissapearing of /dev/null

proton (
Sat, 29 Sep 2001 09:55:35 +0200

I noticed this a long time ago in the Linux kernel
makefiles, I thought someone would have figured it
out by now tho.

The `gcc -o /dev/null' is a really neat way of
testing if gcc works or not.

Unfortunatly it doesnt work that well if you're root.

You see, gcc uses unlink(). /dev/null doesnt take
kindly to that kind of treatment...

Ofcourse, you cant unlink /dev/null unless you are root.

In any case, the `gcc -o /dev/null' test cases probably
need to go away.

I've seen this in linux/arch/i386/Makefile for 2.4.10,
it probably exists in all previous versions as well as
in other Makefiles.

Happy kernel hacking!

ps. any replies [read: flames] would do well being CC'd
to me since I dont subscribe to linux-kernel :)
[ ]
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at