From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26874 invoked by alias); 19 Apr 2005 20:09:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26854 invoked by uid 48); 19 Apr 2005 20:09:20 -0000 Date: Tue, 19 Apr 2005 20:09:00 -0000 Message-ID: <20050419200920.26853.qmail@sourceware.org> From: "wilson at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050416104027.21055.bitmap@pan.homelinux.com> References: <20050416104027.21055.bitmap@pan.homelinux.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug driver/21055] Option -Wl,-wrap when no input file X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg02595.txt.bz2 List-Id: ------- Additional Comments From wilson at gcc dot gnu dot org 2005-04-19 20:09 ------- This is due to an internal implementation detail. The -Wl options are handled by pretending that the argument to the -Wl option is an object file name. This works because the only thing we do with object file names on the command line is to pass them to the linker. Search gcc.c for "-Wl", and note that the code increments n_infiles. Once n_infiles has been incremented, it is impossible for the gcc driver to tell whether or not the user has specified any input files. This is clearer without the other arguments. aretha$ gcc gcc: no input files aretha$ gcc -Wl,-wrap /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../lib64/crt1.o(.text+0x21): In function `_start': ../sysdeps/x86_64/elf/start.S:92: undefined reference to `main' collect2: ld returned 1 exit status The -Xlinker/-Xassembler/-Xpreprocessor options have the same problem. Incidentally, -Xassembler/-Xpreprocessor can't possibly work, as they aren't supposed to be passing options to the linker. It looks like they have never worked. The original patch from Apple has the same bug. This probably deserves another bug report. -- What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21055