Re: getpagesize() problems

"Indan Zupancic" <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
On Tue, August 11, 2009 10:00, Michele Alberti wrote:
> 2009/8/11 Pascal Terjan <[email protected]>:
>> Le mardi 11 ao�t 2009 � 09:02 +0200, Michele Alberti a �crit :
>>> > You would need something like -I/usr/lib/dietlibc/include/
>>>
>>> Look at the command I posted before, I link the "dietlibc.a" that
>>> should do what you said.
>>
>> Why ?
>> Compiling (and first preprocessing) and linking are two different
>> operations...
>
> Maybe I'm wrong but:
>
> $cc -static -o output <some *.o files> -nostdlib -nostartfiles
> ../dietlibc.a -lgcc
>
> this command compile and link. And "-nostdlib ../dietlibc.a" is for
> telling ld to use dietlibc.a and not
> stardard glibc library. Am I wrong? Why?
>

Like I told you before, use diet with the -v option to see what compile
and link options it uses:

$ diet -v cc *.o
cc -nostdlib -static -L/opt/diet/lib-i386 /opt/diet/lib-i386/start.o *.o
-isystem /opt/diet/include -D__dietlibc__ /opt/diet/lib-i386/libc.a -lgcc

As you can see and were told before, more than just linking to libc.a is
needed, especially for compilation!

But it's better to just use the wrapper instead, as it may do other things
as well or change in the future. What is wrong with doing e.g. CC=diet cc
in your Makefile? Is it that it hardcodes the paths what makes it unsuitable
for your use? Then use the non-install version ./bin-i386/diet in the source
tree and distribute that together with at least diet's include files and libs.

Greetings,

Indan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.