Busybox make, modify my /dev/null on host

Denys Vlasenko vda.linux at googlemail.com
Thu Feb 14 09:38:13 UTC 2008


On Thursday 14 February 2008 09:54, Christian MICHON wrote:
> On Thu, Feb 14, 2008 at 8:42 AM, Denys Vlasenko
> <vda.linux at googlemail.com> wrote:
> >
> >  "gcc file.c -o /dev/null" used to delete /dev/null if compile failed.
> >  It never "used to work" as expected in this case, until this bug was fixed.
> 
> could you give me a real life file.c example ? small preferably.
> I cannot reproduce this on DetaolB v0.8.1 which contains gcc-3.4.6

# cat file.c
int main() {
    doesnt_exist();
}

# gcc -v
Reading specs from /.share/usr/app/gcc-3.4.3/bin/../lib/gcc/i386-pc-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/usr/app/gcc-3.4.3 --exec-prefix=/usr/app/gcc-3.4.3 --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/app/gcc-3.4.3/libexec --datadir=/usr/app/gcc-3.4.3/share --sysconfdir=/etc --sharedstatedir=/usr/app/gcc-3.4.3/var/com --localstatedir=/usr/app/gcc-3.4.3/var --libdir=/usr/lib --includedir=/usr/include --infodir=/usr/info --mandir=/usr/man --with-slibdir=/usr/app/gcc-3.4.3/lib --with-local-prefix=/usr/local --with-gxx-include-dir=/usr/app/gcc-3.4.3/include/g++-v3 --enable-languages=c,c++ --with-system-zlib --disable-nls --enable-threads=posix i386-pc-linux-gnu
Thread model: posix
gcc version 3.4.3

# ls -l /dev/null
crwxrwxrwx    1 root     root       1,   3 Feb 14 07:04 /dev/null

# gcc file.c -o /dev/null
/tmp/ccopqxnU.o: In function `main':
file.c:(.text+0x1d): undefined reference to `doesnt_exist'
collect2: ld returned 1 exit status

# ls -l /dev/null
ls: /dev/null: No such file or directory



The same experiment on the very same machine with gcc 4.2.1
doesn't delete /dev/null.
--
vda



More information about the busybox mailing list