On Wed, 21 Jan 2009 00:34:37 +0800 "Dmitry Timoshkov" <dmi...@codeweavers.com> wrote:
>"Mickey Gabel" <mic...@monfort.co.il> 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 _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel