arch/ppc/Makefile wiping out /dev/null

John Whitney jwhitney-linuxppc at sands-edge.com
Fri Apr 2 06:42:44 EST 2004


In arch/ppc/Makefile, the line

NEW_AS := $(shell echo dssall | $(AS) -o /dev/null >/dev/null 2>&1 ;
echo $$?)

is causing my host's /dev/null file to be wiped out if I don't specify
CROSS_COMPILE, and the hosts' "as" is getting called instead of the
cross-compiler.  Apparently, "as" assumes that the file specified by
"-o file" belongs to it, and deletes it if an error occurs in the
compilation process.  I get this happening to me when I issue the
command:

sudo make ARCH=ppc INSTALL_MOD_PATH=<path> modules_install

In this case, I wasn't compiling anything so I didn't specify
CROSS_COMPILE, with the aforementioned result.  I've attached a patch
for this file which changes the offending line to:

NEW_AS := $(shell echo dssall | $(AS) -o /tmp/.as.$$$$ >/dev/null 2>&1
; echo $$?)

Which appears to work as intended (at least, my 2.14 binutils
ppc7xx-linux-as returns a value of 0 for this, and the failing x86 "as"
is returning 1, which I believe is the expected behavior), and doesn't
cause /dev/null to be deleted.

John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.patch
Type: application/octet-stream
Size: 458 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20040401/3b9f900b/attachment.obj>


More information about the Linuxppc-dev mailing list