bugThe FreeType Project - Bugs: bug #44747, Build failure targeting arm64....

 
 

bug #44747: Build failure targeting arm64. FT_CONFIG_OPTION_NO_ASSEMBLER required.

Submitted by:  Alex Markley <alexmarkley>
Submitted on:  Mon 06 Apr 2015 05:58:23 PM UTC  
 
Severity: 3 - NormalItem Group: Hack required
Status: InvalidPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: None

Add a New Comment(Rich 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)

Mon 13 Apr 2015 04:41:23 AM UTC, comment #6:

Thanks, closing.

Unfortunately, there is no `informative' tag or something else so that later visitors find it easily. Perhaps you can send your results to the FreeType mailing list so that others benefit also...

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 12 Apr 2015 10:41:33 PM UTC, comment #5:

I uploaded my build script example (again EXAMPLE ONLY) as ios_build_example.sh to compensate for the strange formatting in my earlier post.

Alex Markley <alexmarkley>
Sun 12 Apr 2015 10:39:10 PM UTC, comment #4:

Again, great feedback. I checked https://wiki.debian.org/Arm64Port and I checked the Android SDK toolkit names, and I determined that the GNU-blessed name of the architecture is apparently "aarch64".

As a result of this feedback, I cleaned up my build environment variables and ./configure invocation, and now manual patching is NOT required to successfully build for iOS on arm64.

Just in case someone else on the internet runs into this problem, here is exactly what I did to produce my build:

unset _IOS_ __OSX__ _MINGW_ XCODE_DEFAULTROOT XCODE_DEVROOT XCODE_SDKROOT IPHONEOS_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PATH CFLAGS LDFLAGS CPPFLAGS CXXFLAGS CC LD CPP CXX CXXCPP AR AS NM RANLIB STRIP NASM
export _IOS_='1'
export XCODE_DEFAULTROOT='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'
export XCODE_DEVROOT='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'
export XCODE_SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk'
export PKG_CONFIG_PATH=''
export PKG_CONFIG_LIBDIR='/Users/alex/MacBuild/inde-ios-libs/lib/pkgconfig'
export PATH='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Users/alex/MacBuild/inde-ios-libs/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/alex/.local/bin:/Users/alex/bin'
export CFLAGS='-g -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -miphoneos-version-min=5.1.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include -I/Users/alex/MacBuild/inde-ios-libs/include'
export LDFLAGS=' -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -miphoneos-version-min=5.1.1 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib -I/Users/alex/MacBuild/inde-ios-libs/lib'
export CXXFLAGS='-g -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -miphoneos-version-min=5.1.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include -I/Users/alex/MacBuild/inde-ios-libs/include'
export CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc'
export LD='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld'
export CXX='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++'
export AR='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar'
export AS='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/as'
export NM='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/nm'
export RANLIB='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib'
export STRIP='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip'
export NASM='/opt/local/bin/nasm'

./configure --host=aarch64-apple-darwiniphoneos --prefix=/Users/alex/MacBuild/inde-ios-libs --enable-shared=no --enable-static=yes

Note that anyone hoping to use that shell snippet will need to alter all of the paths to fit their unique environment. You can't just cut and paste or you'll be sorry.

Note also that this process just produces arm64 binaries, not lipo'd "fat" multi-architecture binaries. You need to do more scripting to accomplish that. (I have been working on exactly that kind of scripting, which is why you will see variables defined above that are not strictly necessary for freetype.)

Thanks again, and sorry for the unhelpful bug reports.

Alex Markley <alexmarkley>
Sat 11 Apr 2015 07:33:18 AM UTC, comment #3:

`arm64' is not a valid target, and you should rather use on the existing ones. Please have a look at the GNU config git repository at

http://git.savannah.gnu.org/cgit/config.git

and check which one of the already defined ARM targets fits your platform (I guess it's `armv8' or `armv8lb'). Given that FreeType's `configure' script is generated while building the tarball, you should do a checkout of FreeType's git repository and base your work on it.

If you compile FreeType unchanged: Why do you get compilation errors? Which compiler symbol is defined on your box that makes FreeType compile ARM assembler code (I suspect `__arm__')?

Note that there exists an ARM64 port of Debian, cf.

https://wiki.debian.org/Arm64Port

One of the ported packages is certainly FreeType. Please check how they are doing it!

Can you provide assembler code for ARM64?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 07 Apr 2015 05:17:43 PM UTC, comment #2:

Thanks for the follow-up. I'm not a very accomplished assembly programmer, so any patch is unlikely to come from me. (I wouldn't rule it out though, I might be curious enough to attempt a patch myself.)

However, I have two thoughts:

One, the build system failing to detect an unsupported machine architecture and blindly referencing incompatible assembly code seems like a bug. Ideally freetype should build (albiet without optimizations) correctly on arm64, right?

Two, is there any chance that FT_CONFIG_OPTION_NO_ASSEMBLER is related to my other bug report at https://savannah.nongnu.org/bugs/?44746 ? If there is an issue related to disabling assembly optimizations, then simply adding arm64 assembly will further mask the problem.

Thanks again for discussing this issue with me.

Alex Markley <alexmarkley>
Tue 07 Apr 2015 05:03:45 PM UTC, comment #1:

You correctly identified the problem: arm64 assembler is not implemented yet. Patches welcome.

Alexei Podtelezhnikov <podtelez>
Project Member
Mon 06 Apr 2015 05:58:23 PM UTC, original submission:

This affects freetype 2.5.5 targeting iOS on arm64 (probably any software platform).

After getting autoconf to accept the target host (config.sub requires a patch to accept arm64), make fails with a large number of assembly-related errors.

I have attached a file containing the error messages as well as a patch to force FT_CONFIG_OPTION_NO_ASSEMBLER during the build.

At this point, I am able to build freetype, but the library does not appear to run properly, as you can see in my other bug report.

Alex Markley <alexmarkley>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #33655:  ios_build_example.sh added by alexmarkley (3KiB - application/x-sh)
file #33568:  errors.txt added by alexmarkley (14KiB - text/plain)
file #33569:  freetype.ios.preconfig.patch added by alexmarkley (2KiB - application/octet-stream)

 

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 podtelez (Posted a comment)
  • -unavailable- added by alexmarkley (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 13 Apr 2015 04:41:23 AM UTCwlStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Sun 12 Apr 2015 10:40:20 PM UTCalexmarkleyAttached File-=>Added ios_build_example.sh, #33655
    Sat 11 Apr 2015 07:33:42 AM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl
    Mon 06 Apr 2015 05:58:23 PM UTCalexmarkleyAttached File-=>Added errors.txt, #33568
      Attached File-=>Added freetype.ios.preconfig.patch, #33569

    Back to the top


    Powered by Savane 3.1-cleanup1