From owner-freebsd-ports@FreeBSD.ORG Mon May 3 11:14:29 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7829116A4E2 for ; Mon, 3 May 2004 11:14:28 -0700 (PDT) Received: from atlas.informatik.rwth-aachen.de (atlas.informatik.RWTH-Aachen.DE [137.226.194.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A19443D45 for ; Mon, 3 May 2004 11:14:27 -0700 (PDT) (envelope-from stolz@i2.informatik.rwth-aachen.de) Received: from menelaos.informatik.rwth-aachen.de (menelaos.informatik.RWTH-Aachen.DE [137.226.194.73]) 8.11.1-0.5-michaelw-20030918) with ESMTP id i43IEQ424019 for ; Mon, 3 May 2004 20:14:26 +0200 Received: (from stolz@localhost)i43IEQkA053692 for ports@FreeBSD.org; Mon, 3 May 2004 20:14:26 +0200 (CEST) (envelope-from stolz) Date: Mon, 3 May 2004 20:14:26 +0200 From: Volker Stolz To: ports@FreeBSD.org Message-ID: <20040503181426.GB12673@i2.informatik.rwth-aachen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-PGP-Key: finger vs@foldr.org X-PGP-Id: 0x3FD1B6B5 User-Agent: Mutt/1.5.4i Subject: Failing cc -pipe nevertheless generates object file? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2004 18:14:29 -0000 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