bugThe FreeType Project - Bugs: bug #35644, Cross-compile FreeType for Android...

 
 

bug #35644: Cross-compile FreeType for Android ARM

Submitted by:  Sylvain Beucler <Beuc>
Submitted on:  Mon 27 Feb 2012 08:56:06 PM UTC  
 
Severity: 3 - NormalItem Group: Hack required
Status: FixedPrivacy: Public
Assigned to: suzuki toshiya <mpsuzuki>Open/Closed: Closed
Planned Release: 2.4.10

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 22 Mar 2012 06:03:17 AM UTC, comment #16:

You should add some ranting :-)

Werner LEMBERG <wl>
Project Administrator
Thu 22 Mar 2012 01:30:11 AM UTC, comment #15:

Oops, I found this bug had been reported 3 years ago!
http://code.google.com/p/android/issues/detail?id=1952
Its status is still new :-(

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 21 Mar 2012 06:46:31 AM UTC, comment #14:

Thanks! Just I updated GIT repository.

Yes, I will report this issue and submit a patch by myself.
It's a pity that Bionic libc has no its own forum to maintain it :-(

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Tue 20 Mar 2012 07:51:28 PM UTC, comment #13:

Hi,

The program runs fine on my device!

Apparently there isn't a bug reporting system specific to bionic libc, you need to use the Android one:
- http://source.android.com/source/report-bugs.html
- source.android.com/source/submit-patches.html

Are you willing to report it?

Sylvain Beucler <Beuc>
Tue 20 Mar 2012 12:09:01 PM UTC, comment #12:

Sorry for your inconvenience caused by my tarball with legacy
config.sub that cannot recognize Android platform. I wish the
built library works well on your device.

I think this issue should be reported to Bionic libc maintainers.
If you know their bugzilla or any other forum to report it,
please let me know. It would be easy to post a patch to fix
this issue, if their direction (C89 mode should be rejected,
or supported) is fixed.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Tue 20 Mar 2012 11:19:41 AM UTC, comment #11:

Hi,

It builds!

But I had to update builds/unix/config.sub :

I'm going to test the built library on my device tonight.

Should we file a bug at Android so as to entice them into fixing bionic libc?

Sylvain Beucler <Beuc>
Mon 19 Mar 2012 11:49:07 PM UTC, comment #10:

Here I upload tarball including testing configure script.

(file #25411)

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Mon 19 Mar 2012 06:28:08 PM UTC, comment #9:

Simply call the top-level `autogen.sh' script.

Werner LEMBERG <wl>
Project Administrator
Mon 19 Mar 2012 05:32:11 PM UTC, comment #8:

Hi Suzuki Toshiya (not sure what your first name is - mine is Sylvain, not Beucler, btw),

Can you give me some clues about how to regenerate the autoconf-based files? autoreconf in builds/unix causes an error from autoheader, and then I got a version mismatch error from libtool.

I'm running Debian Wheezy/testing here.

Sylvain Beucler <Beuc>
Mon 19 Mar 2012 03:45:45 PM UTC, comment #7:

Attached is a patch to improve configure.ac.
It checks if "-pedantic", "-ansi" works correctly,
and if it works correctly, add them to XX_ANSIFLAGS.
In Android case, "-pedantic" is added, but "-ansi"
is not added. Beucler, could you check please?

(file #25406)

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Mon 19 Mar 2012 02:42:52 PM UTC, comment #6:

Now I'm writing a patch to improve configure in FreeType2,
but here is more detailed analysis how the error occurs.
platforms/android-9/arch-x86/usr/include/stdint.h has
following conditional definitions for 64bit types:

typedef __int8_t int8_t;
typedef __uint8_t uint8_t;
typedef __int16_t int16_t;
typedef __uint16_t uint16_t;
typedef __int32_t int32_t;
typedef __uint32_t uint32_t;
#if defined(_STDC_INT64_)
typedef __int64_t int64_t;
typedef __uint64_t uint64_t;
#endif

Although internal types (__int64_t, __uint64_t) seem to be
available always, _STDC_INT64_ is required to use
int64_t, uint64_t.

However,
lib/gcc/i686-android-linux/4.4.3/include-fixed/sys/types.h
does not check _STDC_INT64_ (as shown in the first post
of this item) and tries to use int64_t, uint64_t even if
they are unavailable. Thus, error is caused. types.h should
check _STDC_INT64_.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Mon 19 Mar 2012 02:23:41 AM UTC, comment #5:

The compile error is because that configure script of FreeType2
adds "-pedantic -ansi" to catch the problems in building.
If I use these options, even hello-world cannot be compiled
as far as including some system header files.
The solution would be:

[FreeType2 side solution] configure should check "-pedantic
-ansi" works or not, even if we use GCC. If it does not work,
dropping "-ansi" and trying "-pedantic" only.

[Android side solution] the integrity/consistency of the libc
headers in the case that uint64_t/int64_t is unavailable by
"-ansi". If android libc maintainer does not want the developers
to build something with "-ansi", some error should be returned.

Anyway, an assumption "-ansi -pedantic" is always available
and working in GCC variants would not be pedantic, it should
be improved :-)

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Mon 19 Mar 2012 01:54:18 AM UTC, comment #4:

Sorry for quite slow activity about this issue,
today finally I could prepare my environment to cross-build
for Android (I was trying to understand how to use SDK
which is provided without C compiler - the required was
just NDK!). I could reproduce the issue.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 29 Feb 2012 08:14:34 AM UTC, comment #3:

Nice, let me know if I can help.

My notes at:
http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android#FreeType
should help you getting started with the Android NDK and its cross-compiler.

Sylvain Beucler <Beuc>
Wed 29 Feb 2012 06:07:55 AM UTC, comment #2:

Hmm, this issue seems to be related with libc for Android
(bionic libc). To reproduce the issue, learn the standard
process to build something for Android, and consider the
appropriate fix, please give me a few weeks to setup my
machines for the environment.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 29 Feb 2012 05:45:28 AM UTC, comment #1:

I take the liberty to assign this problem to Toshiya-san :-)

Werner LEMBERG <wl>
Project Administrator
Mon 27 Feb 2012 08:56:06 PM UTC, original submission:

Hi,

I noticed that you need to set CFLAGS="-std=gnu99" to cross-compile FreeType for Android ARM, otherwise there seem to be a confusion with BSD_VISIBLE as described at this page:
http://groups.google.com/group/android-ndk/browse_thread/thread/bc50ad2d4885d816

The build looks like:

The last file at line 125:

(I had mentioned this on Planet GNU but obviously you people missed it ;))

Any idea on why the CFLAGS="-std=gnu99" work-around is necessary?

Context info: this page explains in detail how FreeType is compiled for Android and how it's used in the Android build system :
http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android#FreeType

Cheers!

Sylvain Beucler <Beuc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #25411:  freetype-2.4.9.tar.xz added by mpsuzuki (1MB - application/octet-stream)
file #25406:  mps20120320a.diff added by mpsuzuki (2kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mpsuzuki (Posted a comment)
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by Beuc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 24 Apr 2012 01:31:28 PM UTCwlOpen/ClosedOpen=>Closed
    Wed 21 Mar 2012 06:46:31 AM UTCmpsuzukiStatusReady For Test=>Fixed
      Planned ReleaseNone=>2.4.10
    Mon 19 Mar 2012 11:49:07 PM UTCmpsuzukiAttached File-=>Added freetype-2.4.9.tar.xz, #25411
    Mon 19 Mar 2012 03:45:45 PM UTCmpsuzukiAttached File-=>Added mps20120320a.diff, #25406
      StatusConfirmed=>Ready For Test
    Mon 19 Mar 2012 01:54:18 AM UTCmpsuzukiStatusNone=>Confirmed
    Wed 29 Feb 2012 05:45:28 AM UTCwlAssigned toNone=>mpsuzuki

    Back to the top


    Powered by Savane 3.1-cleanup