freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Position Independent Port of FreeType2


From: mpsuzuki
Subject: Re: [ft-devel] Position Independent Port of FreeType2
Date: Wed, 21 Jan 2009 02:32:57 +0900

On Wed, 21 Jan 2009 00:34:37 +0800
"Dmitry Timoshkov" <address@hidden> wrote:

>"Mickey Gabel" <address@hidden> wrote:
>
>>   const int x = 0; /* no problem */
>>   const int* p = &x; /* needs address fixup - can't be used in PIC */
>>   char  *list1[] = {"zero", "one", "two"}; /* pointers need fixup */
>>   char  list2[3][5] = {"zero", "one", "two"}; /* OK, no problem */
>> 
>> FT2 uses lots a lot of such constants, such as arrays of pointers to 
>> structs and function tables. This is pervasive throughout all parts of FT2.
>> 
>> The Changes
>> -----------
>> I propose adding an FT_CONFIG_OPTION_PIC switch that if defined, will 
>> allow FT2 to compile to PIC:
>> * The previously global const structures will now be part of some 
>> internal structure. For example inside FT_LibraryRec_ (there are other 
>> options).
>> * Additional init functions will be called at library init (during 
>> FT_Init_FreeType) that will generate the structures, arrays, tables, and 
>> pointers at run time.
>> * Ideally, each structure/table/array/whatever only needs to be written 
>> once (via a macro?), and depending on FT_CONFIG_OPTION_PIC either a 
>> global const is generated, or a struct member with a matching init 
>> function to be called.
>> * From what I could see, most parts of FT2 use such global constants.
>> * Ideally, the internal FT2 API would not be modified.
>> * We only use a subset (around 25% maybe?) of FT2.
>
>I'd suggest to get a compiler that is able to generate the PIC code without
>requiring to add ugly code modifications you are proposing. For instance
>gcc for a linux platform does generate PIC code just fine.

http://en.wikipedia.org/wiki/BREW does not mention, but
http://ja.wikipedia.org/wiki/BREW mentions about the
exist of GCC for BREW (it's not official compiler and
nobody provides the commercial support). However, I think
you won't switch from the officially supported environment
(RVCT) to GCC.

I'm suspicious whether most FT2 maintainers find any
worth to modify FT2 fitting to RVCT. Because, BREW is
quite different from most FT2 developers are working for,
and they cannot get free SDKs and emulators.

Talking about my case, if I could have SDKs and emulators
(or real machine) and it's a marginal case of possible
implementation of C89, I would be interested in. But BREW
is not...

If few people decide to work for you, unfortunately, you
have to modify FT2 code by yourself. The only thing FT2
maintainers can do is a review for your patch and comment
if it's applied to CVS /or not.

Regards,
mpsuzuki




reply via email to

[Prev in Thread] Current Thread [Next in Thread]