Re: how to compile without libc (so not static)

2000-02-08 Thread John Polstra
In article <[EMAIL PROTECTED]>, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > I suspect that "gcc" isn't the standard FreeBSD C compiler in your > > case. Try "which gcc" and find out. It works fine for me on both > > -stable and -current with "cc": > > It is an older one indeed. [...] > St

Re: how to compile without libc (so not static)

2000-02-07 Thread Marco van de Voort
> I suspect that "gcc" isn't the standard FreeBSD C compiler in your > case. Try "which gcc" and find out. It works fine for me on both > -stable and -current with "cc": It is an older one indeed. > blake$ cc -v -nostdlib hello.c > Using builtin specs. > gcc version 2.95.2 19991024 (release) >

Re: how to compile without libc (so not static)

2000-02-07 Thread John Polstra
In article <[EMAIL PROTECTED]>, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > I finished the syscalls, so now I moved on the initialisation code. > > To test that I try to create an empty binary, which doesn't link to libc: > > I've put in an hour effort, and wrote the following C file: >

Re: how to compile without libc (so not static)

2000-02-07 Thread Marco van de Voort
> >grep exit *.o > > > >in /usr/lib doesn't find me that label. > > > >What am I missing? > > Try this instead: > > nm /usr/lib/libc.a | grep exit I'm aware of that! That is libc which I'm trying to avoid here! (see man gcc, search for -nostdlib) I was referering to excuting gcc with -

Re: how to compile without libc (so not static)

2000-02-05 Thread Marco van de Voort
> 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 m

Re: how to compile without libc (so not static)

2000-02-04 Thread Ollivier Robert
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... > grep exit *.o nm(1) is your Dear FriendĀ® here. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- [EMAIL PROTE

Re: how to compile without libc (so not static)

2000-02-04 Thread Warner Losh
In message <[EMAIL PROTECTED]> Marco van de Voort writes: : /usr/lib/crt1.o: In function `_start': : /usr/lib/crt1.o(.text+0x4f): undefined reference to `atexit' : /usr/lib/crt1.o(.text+0x5c): undefined reference to `atexit' : /usr/lib/crt1.o(.text+0x6f): undefined reference to `exit' : in /usr/li

how to compile without libc (so not static)

2000-02-04 Thread Marco van de Voort
I finished the syscalls, so now I moved on the initialisation code. To test that I try to create an empty binary, which doesn't link to libc: I've put in an hour effort, and wrote the following C file: int main (void) { return 0; } gcc -nostdlib empty.c /usr/lib/crti.o /usr/lib/crt0.o -o emp