harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Migliore <enrico.migli...@fatti.com>
Subject Re: opinions on structure packing in C?
Date Fri, 07 Oct 2005 18:01:45 GMT

> Why would people want to recompile libc?
> geir
> On Oct 7, 2005, at 12:16 PM, Dan Lydick wrote:
>> It seems that not all versions of 'libc' are compiled
>> with the same flags.  Furthermore, the edition that I
>> am using (GCC 3.3.3 on Solaris 9) apparently does not
>> use all the same flags all the way around.  I am
>> suspicious of this because I was able to compile
>> everything but code that used fprintf(3) and sprintf(3)
>> with -fpack-struct, yet had to compile code that
>> invoked those library(3) calls _without_ it!  I am
>> really interested to see what other permutations of
>> this problem we find, and what solutions might present
>> themselves.
>> Probably making _absolutely_ sure that this problem
>> goes away with a recompile of 'libc' is a very good
>> idea, whether considering optimization or not.  But
>> optimization itself is a long way down the road on
>> the code I put together.  I still have one module
>> that I'm finishing up, which Geir is aware of.  But
>> let's keep this 'libc' question on the table because
>> surely other people are going to run into it when
>> they look at the code and try compiling.
>> Dan Lydick

  I've been  writing code for embedded systems for quite a while and
faced many different kind of problems when mixing my code with someone 
else's libraries.
The only way out to those problems was compiling my code with the same 
set of  flags
of the library.

Since we got GNU libc code, my suggestion is, for each architecture, 
compile _ALL_ the C code
with the same set of C flags, including the libc.

In this way, the libc and the VM will be a monolithic executable which 
will not
call the libc functions installed in the system. Yet, we will be free of 
optimizing the code
as we want.


View raw message