This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting host and target size and alignment information at build time?


Please don't reply to an existing thread to post a new question.

On Fri, Apr 11, 2008 at 08:52:11PM +1000, Tim Josling wrote:
> I have found tm.h, and also bconfig.h, config.h and tconfig.h. The sizes
> are more or less OK as there are macros for sizes, apart from pointer
> sizes in some cases. The alignment is the main problem; the alignments
> for i386 are not constants but function calls and vary in certain
> scenarios.

Simply put, you can't do this.  All of these things can depend on
command line options.

Why not get it out of GCC later?  You don't need to hack up GCC to do
that.

> 1. Have some sort of install process which compiles and that extracts
> the information out of the target compiler. Eg I could write a small
> program which prints out the __alignof__ values and sizeof values for
> various data items. This information then gets stored somewhere that it
> can be used by the Lisp code.

Yes.  Or you can do it without execution in a number of ways, either
by assigning these to constants or using the negative array size error
that autoconf uses to determine sizes by binary search (int foo[4 -
sizeof(int)], et cetera).

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]