Page 1 of 1

Xcode errors/warnings when building for iOS

Posted: Mon May 02, 2016 3:51 am
by theCodeCat
Hi,
I used the latest version of renpy and renios to make an Xcode project on a Mac computer running OSX 10.11.4 (El Capitan) with Xcode 7.3
I just installed all the software today, so it should be very up to date.

However when I build the project I get a couple warnings about absolute addressing.
The exact warnings are:

Code: Select all

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _ff_sws_alphablendaway from /Users/ianleslie/Documents/XCode Renpy Projects/MD/prebuilt/debug/lib/libswscale.a(alphablend.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
ld: warning: 32-bit absolute address out of range (0x1009DF9B8 max is 4GB): from fft32_vfp + 0x00000020 (0x002F3B0C) to 0x1009DF9B8
ld: warning: 32-bit absolute address out of range (0x1009DFA6F max is 4GB): from _ff_decode_block_coeffs_armv6 + 0x00000554 (0x002FC2C0) to 0x1009DFA6F
ld: warning: 32-bit absolute address out of range (0x1009DFAAC max is 4GB): from bl_put_bilin_v_armv6 + 0x00000084 (0x002FE594) to 0x1009DFAAC
ld: warning: 32-bit absolute address out of range (0x1009DFA70 max is 4GB): from bl_put_bilin_v_armv6 + 0x00000080 (0x002FE594) to 0x1009DFA70
ld: warning: 32-bit absolute address out of range (0x1009DFAC0 max is 4GB): from _ff_put_vp8_epel8_h4v6_neon + 0x00000104 (0x003008FC) to 0x1009DFAC0
ld: warning: 32-bit absolute address out of range (0x1009DFAC0 max is 4GB): from _ff_put_vp8_bilin4_hv_neon + 0x0000007C (0x003013E8) to 0x1009DFAC0
ld: warning: 32-bit absolute address out of range (0x100A9318C max is 4GB): from _usedpools + 0x00000004 (0x00A93194) to 0x100A9318C
ld: warning: 32-bit absolute address out of range (0x100A9318C max is 4GB): from _usedpools + 0x00000000 (0x00A93194) to 0x100A9318C
The app still builds successfully and I was able to upload and run it on a tablet, however the app always crashes a minute or so after starting up and I strongly suspect this has to do with the warnings.

I looked into the first warning a bit and "libswscale" is part of the FFmpeg library. The app is supposed to play a short movie clip after starting up, which is it hasn't been doing so far. I think the problem with the FFmpeg library that is triggering the warnings is also causing the app to crash, so fixing these warnings is important.

I think the FFmpeg library isn't being built with the necessary options to make it "PIE", which may require adding the options covered in this stackoverflow post: http://stackoverflow.com/questions/3614 ... on-android
I've tried building the FFmpeg library myself but without any luck. I don't have any experience building libraries like this, so it all feels kind of overwhelming.

Anyways, if I could get some help here it would be very much appreciated. :)

Re: Xcode errors/warnings when building for iOS

Posted: Mon May 02, 2016 8:06 pm
by PyTom
What device are you targeting here?

Re: Xcode errors/warnings when building for iOS

Posted: Mon May 02, 2016 11:51 pm
by theCodeCat
The device I tried it on is an iPad running version 9.3.1 but I get the same warnings when I just try building the project normally for a "Generic iOS Device".

In the Xcode configuration, the "iOS Deployment Target" is iOS 8.1 and "Targeted Device Family" is "1,2".

Re: Xcode errors/warnings when building for iOS

Posted: Tue May 03, 2016 12:53 am
by theCodeCat
I did some further testing by generating a fresh Xcode project for "The Question" and attempting to build it for different simulators.
I got the PIE warning when building for:
iPad 2
iPad Retina
iPhone 4s
iPhone 5
iPhone 5s

Building for any of the other simulator targets did not generate the warning.

Re: Xcode errors/warnings when building for iOS

Posted: Tue May 03, 2016 7:12 pm
by PyTom
I will look into this when I get a chance.

Re: Xcode errors/warnings when building for iOS

Posted: Wed May 04, 2016 2:44 am
by theCodeCat
Thanks.

After some more tinkering I also noticed that whenever I run the game on a device, simulator or not, I get "Got dlopen error on Foundation" in the output log as the 2nd message.

This message seems to originate from the "pyobjus" library, specifically here: https://github.com/kivy/pyobjus/blob/ma ... _runtime.h

First few output messages are:

Code: Select all

running /Users/ianleslie/Library/Developer/CoreSimulator/Devices/25D1E474-93AA-4DA4-84FD-8E12D82F19CE/data/Containers/Bundle/Application/4BCB3CB0-1587-412B-88C9-888EABF64C53/MD.app/base/main.py
Got dlopen error on Foundation
2016-05-03 23:36:43.797 MD[61531:313507] Bootstrap to the start of init.init took 0.00s
2016-05-03 23:36:43.822 MD[61531:313507] iOS device idiom 0
2016-05-03 23:36:43.823 MD[61531:313507] Early init took 0.06s
in case that helps.

Re: Xcode errors/warnings when building for iOS

Posted: Wed May 04, 2016 10:03 am
by PyTom
IIRC, the dlopen thing is a harmless error.

Re: Xcode errors/warnings when building for iOS

Posted: Mon May 23, 2016 1:11 pm
by Arisae
  • rtl should be False. Open your options.rpy and check the config.rtl.
  • Check the libz.x(version number).dylib and libbz.x.dylib. If it is red(broken path), you should delete and add it manually.
  • Check the other build setting. e.g. Architectures and Valid Architectures, Enable bitcode, Generate Position-Dependent Executable, Mach-O Type.