Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 May 2004 20:14:26 +0200
From:      Volker Stolz <vs@FreeBSD.org>
To:        ports@FreeBSD.org
Subject:   Failing cc -pipe nevertheless generates object file?
Message-ID:  <20040503181426.GB12673@i2.informatik.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help
A port compiles a program which, if build successfully,
serves as a kind of configuration-option. Therefore it uses a separate
CC and a LD-phase. If it doesn't build, the port
simply uses a different set of options. Additionally, the port checks
if the binary works. Now, if I compile with -pipe,
and since the port links with a library which provides it's own main(),
the following will happen: cc -pipe fails, but creates an object file,
LD will happily provide main() from the library and it looks as though
things worked!

Adapted sample:

work@menelaos [20:03:24]> rm foo
work@menelaos [20:03:27]> cc -pipe -c -O  -g -I/usr/local/include     -DMACHTYPE_ -I src/ -I build/FreeBSD/ -I external/src/    progs/taucs_cilk_test.c  -ofoo
progs/taucs_cilk_test.c:8: cilk.h: No such file or directory
progs/taucs_cilk_test.c:12: syntax error before `int'
progs/taucs_cilk_test.c:17: syntax error before `int'
progs/taucs_cilk_test.c: In function `main':
progs/taucs_cilk_test.c:22: `spawn' undeclared (first use in this function)
progs/taucs_cilk_test.c:22: (Each undeclared identifier is reported only once
progs/taucs_cilk_test.c:22: for each function it appears in.)
progs/taucs_cilk_test.c:22: syntax error before `f'
progs/taucs_cilk_test.c:24: `sync' undeclared (first use in this function)
work@menelaos [20:03:29]> file foo
foo: ELF 32-bit LSB relocatable, Intel 80386, version 1 (FreeBSD), not stripped
work@menelaos [20:03:30]> rm foo
work@menelaos [20:03:35]> cc  -c -O  -g -I/usr/local/include     -DMACHTYPE_ -I src/ -I build/FreeBSD/ -I external/src/    progs/taucs_cilk_test.c  -ofoo
progs/taucs_cilk_test.c:8: cilk.h: No such file or directory
work@menelaos [20:03:40]> file foo
foo: can't stat `foo' (No such file or directory).

Is this expected behaviour? I'm currently working around this by
adding " || rm foo" to the offending invocation so that LD will fail.
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
Neu! Ändern Sie den Anfangstag Ihrer Woche



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040503181426.GB12673>