bugThe FreeType Project - Bugs: bug #25588, Does not compile for ARM

 
 

bug #25588: Does not compile for ARM

Submitted by:  Matt Godbolt <moog>
Submitted on:  Sat 14 Feb 2009 08:02:13 PM UTC  
 
Severity: 3 - NormalItem Group: Hack required
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.9

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 15 Feb 2009 07:55:52 AM UTC, comment #2:

Applied, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 14 Feb 2009 08:05:46 PM UTC, comment #1:

Apologies for the confusion, I had diffed the files the wrong way around. The patch should be:

--- freetype-2.3.8-orig/builds/unix/ftconfig.in 2008-10-04 12:29:37.000000000 +0100
+++ freetype-2.3.8/builds/unix/ftconfig.in 2009-02-14 19:16:14.000000000 +0000
@@ -305,7 +305,7 @@
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
- "orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
+ "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b) );
return a;

(plus, really I ought to have fixed the formatting at the same time. For clarity of the single-line change, I haven't done so even in this revised patch).

Matt Godbolt <moog>
Sat 14 Feb 2009 08:02:13 PM UTC, original submission:

The current CVS head and also 2.3.8 have a compilation error for ARM. I was cross-compiling with gcc3.4.4, so it may be a gcc-specific issue, but the source has a non-standard ARM opcode which fails to compile.

In order to compile, a simple patch needs to be made:

--- freetype-2.3.8/builds/unix/ftconfig.in 2009-02-14 19:16:14.000000000 +0000
+++ freetype-2.3.8-orig/builds/unix/ftconfig.in 2008-10-04 12:29:37.000000000 +0100
@@ -305,7 +305,7 @@
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
- "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
+ "orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b) );
return a;

Put simply, the "or" instruction should be of the form "orr DEST, SRC1, SRC2". The comment on that line is correct, but the %0 operand needed to be added to make it "%0 = %0 | %2<<16".

This may build on other versions of GCC as their assemblers may infer this behaviour, but to the best of my knowledge it's non-standard.

I ran and tested my patched version and all seems well (fonts rendered fine).

Matt Godbolt <moog>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by moog (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 15 Feb 2009 07:55:52 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.9

    Back to the top


    Powered by Savane 3.1-cleanup1