From owner-freebsd-hackers Sat Feb 5 5:18:12 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from kweetal.tue.nl (kweetal.tue.nl [131.155.2.7]) by builder.freebsd.org (Postfix) with ESMTP id D809A40FB for ; Sat, 5 Feb 2000 05:18:09 -0800 (PST) Received: from hermes.tue.nl [131.155.2.46] by kweetal.tue.nl (8.9.3) for id OAA05156 (ESMTP); Sat, 5 Feb 2000 14:18:33 +0100 (MET) Received: from deathstar (n194.dial.tue.nl [131.155.209.193]) by hermes.tue.nl (Postfix) with ESMTP id 9D59F2E802 for ; Sat, 5 Feb 2000 14:18:31 +0100 (CET) From: "Marco van de Voort" To: freebsd-hackers@freebsd.org Date: Sat, 5 Feb 2000 14:16:00 +0100 Subject: Re: how to compile without libc (so not static) In-reply-to: <20000205013418.A76713@keltia.freenix.fr> References: <20000204161324.B2DE396D7@toad.stack.nl>; from marcov@stack.nl on Fri, Feb 04, 2000 at 05:13:24PM +0100 X-mailer: Pegasus Mail for Win32 (v3.12b) Message-Id: <20000205131831.9D59F2E802@hermes.tue.nl> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > According to Marco van de Voort: > > gcc -nostdlib empty.c /usr/lib/crti.o /usr/lib/crt0.o -o empty > > You mean crt1.o instead of crt0.o here right? crt0.o is the a.out version... Yup, my fault. > > grep exit *.o > > nm(1) is your Dear FriendŽ here. Grep and gcc -S also :-) Anyway I manually patched the .s sources, and now I can compile an empty gcc program. Never knew that that was so hard! gcc -nostdlib crt1.o crtbegin.o empty.c crtend.o -o empty was the final commandline I think. I manually patched crt1 to remove the libc init and the (two!) atexit calls. Marco van de Voort (MarcoV@Stack.nl) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message