From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11655 invoked by alias); 7 Aug 2008 16:30:31 -0000 Received: (qmail 11646 invoked by uid 22791); 7 Aug 2008 16:30:30 -0000 X-Spam-Check-By: sourceware.org Received: from faui40.informatik.uni-erlangen.de (HELO faui40.informatik.uni-erlangen.de) (131.188.34.40) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Aug 2008 16:29:48 +0000 Received: from mocca.losoft (dslb-088-065-127-034.pools.arcor-ip.net [88.65.127.34]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: lohmann) by faui40.informatik.uni-erlangen.de (Postfix) with ESMTPSA id 5F0125F0C4; Thu, 7 Aug 2008 18:29:45 +0200 (MEST) Cc: gcc-help@gcc.gnu.org Message-Id: From: Daniel Lohmann To: Roland Kindermann In-Reply-To: <4898C839.9080707@gmx.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: Force gcc to include builtin functions in the executable Date: Fri, 08 Aug 2008 06:13:00 -0000 References: <4898C839.9080707@gmx.de> X-Mailer: Apple Mail (2.926) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00066.txt.bz2 On 05.08.2008, at 23:38, Roland Kindermann wrote: > Hello, > > I have a program that uses four builtin functions: __alloca, > ___main, _memset and _strcpy. While __alloca is compiled directly > into the executable, the other three are used from a library. Is > there a way to make gcc compile ___main, _memset and strcpy also > into the executable such that it does not use any libraries anymore? > > I already tried -nostdlib but that results in link errors. > > For those who care: The reason why I want my executable independent > from any libraries is that I perform static analysis on it and my > analysis tool is not yet able to take additional libraries into > account. You may try the explicit builtin-versions (the once that are prefixed with "__builtin_", such as "__builtin_strcpy", however, I doubt that this helps. AFAIR, builtins of library functions are just an *option* the compiler *might* use when this would result in more efficient code, but there is no way to force gcc to actually use them under all circumstances. To prevent dependencies to some C library, I would just define own versions of the respective functions. After all, they should not be that difficult to implement :-) Daniel