Re: getpagesize() problems
"Indan Zupancic" <[email protected]>
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
On Sun, August 9, 2009 11:26, Michele Alberti wrote: >>> This works fine for me (apart from the fact that sys/user.h does not >>> exist for dietlibc and PAGE_SIZE is defined in sys/shm.h). >> >> it works for you?! Maybe i'm not good in compiling and linking with >> non-standard tools. >> I'm telling this because I tried to use sys/shm.h but it gives me >> error: PAGE_SIZE undeclared. >> This is the command I made to compile and link: >> >> $cc -static -o pagesize pagesize.c -nostdlib ../dietlibc.a -lgcc >> /usr/bin/ld warns me that it can not find the _start symbol. >> Running that example segfault immediately. >> >> So I tried the other example, ld warns me again, but the example works well. > > I also try to use your "diet" wrapper and all the examples code work > well. The command: > > $./diet gcc -o pagesize pagesize.c > > ***But I have to use the other way, not with the "diet" wrapper, but > with the "dietlibc.a" library.*** You probably also need to link in dietlibc's start.o. Run diet with the -v option to see which options are needed. Greetings, Indan