Current build instructions for iOS
Steve Hannah
steve at weblite.ca
Tue May 22 18:58:37 UTC 2018
I'm just back around to this now. I tried building with 8.3.3 and am
getting the same fatal error
Creating support/interim-jmods/java.logging.jmod
Creating support/interim-jmods/java.base.jmod
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x000000010d4bee77, pid=16692, tid=8195
#
# JRE version: OpenJDK Runtime Environment (9.0) (build
9-internal+0-adhoc.shannah.mobile-jdk9)
# Java VM: OpenJDK 64-Bit Server VM
(9-internal+0-adhoc.shannah.mobile-jdk9, mixed mode, tiered, compressed
oops, serial gc, bsd-amd64)
# Problematic frame:
# V [libjvm.dylib+0x4bee77]
#
# No core dump will be written. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
This is the build script I'm using (Note: This says 8.2, because that's
the last one I tried, but 8.3.3 gives the same result). I've also tried
jdk8 for the JAVA_HOME and JDK_DIR with the same results.
# !/bin/bash
#
# Customize the following paths to match your setup
#
export
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
export CUPS_DIR=/usr/include/cups
export FREETYPE_DIR=$HOME/tmp/zero/freetype-2.6.2/build_iphoneos-x86_64
export JDK_DIR=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
export DEVELOPER_DIR=/Applications/Xcode8.2.app/Contents/Developer
#
cd mobile-jdk9
bash configure \
--enable-option-checking=fatal \
--build=x86_64-apple-darwin \
--host=x86_64-macos-ios \
--target=x86_64-macos-ios \
--disable-warnings-as-errors \
--enable-headless-only \
--with-boot-jdk=$JDK_DIR \
--with-jdk-variant=normal \
--with-jvm-variants=minimal1 \
--enable-static-build=yes \
--with-extra-cflags="-arch x86_64 -Wno-implicit-function-declaration
-Wno-unused-parameter -miphoneos-version-min=8.0.0" \
--with-extra-cxxflags="-arch x86_64 -Wno-implicit-function-declaration
-Wno-unused-parameter -miphoneos-version-min=8.0.0" \
--with-extra-ldflags="-arch x86_64 -miphoneos-version-min=8.0.0
-L$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
-L$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system"
\
--with-cups-include=$CUPS_DIR \
--with-sys-root=$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
\
--with-tools-dir=$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/../../usr/bin
\
--with-build-sysroot=$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
\
--with-debug-level=release \
--disable-precompiled-headers \
--with-freetype-lib=$FREETYPE_DIR/lib \
--with-freetype-include=$FREETYPE_DIR/include/freetype2
cd build/ios-x86_64-normal-minimal1-release
make clean images
One thing I'm not sure about: For my CUPS_DIR, I'm just using
/usr/include/cups (from OS X). Is this alright, or should I be
downloading the cups sources separately and building them?
Best regards
Steve
On Mon, May 14, 2018 at 2:15 PM, gary.adams at oracle.com <
gary.adams at oracle.com> wrote:
> I saw this error with Xcode 9.3.1, but not with 8.3.3.
>
> Best way to debug this type of error is to run with a debugger
> using a slowdebug build with full symbols.
>
>
> On 5/14/18 4:11 PM, Steve Hannah wrote:
>
> Thanks. I'll look into that.
>
> FWIW, I found that one of my problems was that I didn't have Apple's
> legacy Java 6 installed on my system - which appears to be required for the
> frameworks it contains - e.g. JavaNativeFoundation.
>
> After I solved that, I was able to get much further - but am now halted on
> this error:
>
> /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/jdk/bin/jmod -J-XX:+UseSerialGC
> -J-Xms32M -J-Xmx512M -J-XX:TieredStopAtLevel=1 create \
>
> --module-version 9-internal \
>
> --target-platform 'ios-amd64' \
>
> --module-path /Users/shannah/tmp/zero/
> mobile-jdk9/build/ios-x86_64-normal-minimal1-release/support/interim-jmods
> \
>
> --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}'
> \
>
> --libs /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/support/modules_libs/java.base --cmds
> /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/support/modules_cmds/java.base --config
> /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/support/modules_conf/java.base
> --class-path /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/jdk/modules/java.base --header-files
> /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/support/modules_include/java.base
> --legal-notices "/Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/buildjdk/support/modules_legal/java.base:/Users/
> shannah/tmp/zero/mobile-jdk9/jdk/src/java.base/share/legal"
> /Users/shannah/tmp/zero/mobile-jdk9/build/ios-x86_64-
> normal-minimal1-release/support/interim-jmods/temp/java.base.jmod
>
> #
>
> # A fatal error has been detected by the Java Runtime Environment:
>
> #
>
> # SIGILL (0x4) at pc=0x00000001050bee77, pid=39058, tid=7171
>
> #
>
> # JRE version: OpenJDK Runtime Environment (9.0) (build
> 9-internal+0-adhoc.shannah.mobile-jdk9)
>
> # Java VM: OpenJDK 64-Bit Server VM (9-internal+0-adhoc.shannah.mobile-jdk9,
> mixed mode, tiered, compressed oops, serial gc, bsd-amd64)
>
> # Problematic frame:
>
> # V [libjvm.dylib+0x4bee77] PerfDataManager::destroy()+0xb7
>
> #
>
> # No core dump will be written. Core dumps have been disabled. To enable
> core dumping, try "ulimit -c unlimited" before starting Java again
>
> #
>
> # An error report file with more information is saved as:
>
> # /Users/shannah/tmp/zero/mobile-jdk9/make/hs_err_pid39058.log
>
> #
>
> # If you would like to submit a bug report, please visit:
>
> # http://bugreport.java.com/bugreport/crash.jsp
>
> #
>
>
> [error occurred during error reporting (), id 0x4]
>
>
> On Mon, May 14, 2018 at 12:47 PM, gary.adams at oracle.com <
> gary.adams at oracle.com> wrote:
>
>> Many of the compilation problems are already fixed in the jdk/jdk repos
>> for the newer toolchain. That might be an easier fix than trial and
>> error.
>>
>>
>> On 5/14/18 3:17 PM, Steve Hannah wrote:
>>
>> Thanks Gary. That seems to have gotten me past that error. Now facing
>> what look to be more tractable errors. Missing headers, syntax errors
>> etc... I'm going to try commenting things out until it compiles now.
>>
>> Best regards
>>
>> Steve
>>
>> On Mon, May 14, 2018 at 10:57 AM, <gary.adams at oracle.com> wrote:
>>
>>> The problem in my local build was the generated buildjdk-spec.gmk file.
>>>
>>> It contained settings for the iPhoneSimulator sysroot, but should have
>>> been
>>> configured for MacOSX SDK.
>>>
>>> Adding this to my configure command line arguments corrected the problem
>>> using an Xcode 8.3.3 DEVELOPER_DIR.
>>>
>>> --with-build-sysroot=$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
>>>
>>>
>>>
>>>
>>> On 5/14/18 8:09 AM, Steve Hannah wrote:
>>>
>>> Johan, I'm also building with Xcode 9.3 (OS X 10.13.4), and I'm hitting
>>> these errors. Any chance you can share your configure command, and any
>>> other logs that might allow me to do a comparison of my environment to
>>> yours so that I can see where I'm going wrong?
>>>
>>> Best regards
>>>
>>> Steve
>>>
>>> On Sat, May 12, 2018 at 5:43 AM, Johan Vos <johan.vos at gluonhq.com>
>>> wrote:
>>>
>>>> The version we are talking about here is in mobile/jdk9 and that is
>>>> the "final" version for the 9 tree.
>>>> I'm still configuring and building it with Xcode 9.3 and that works
>>>> fine.
>>>>
>>>> I made some minor local modifications but those shouldn't matter.
>>>>
>>>> - Johan
>>>>
>>>> On Sat, May 12, 2018 at 1:32 AM David Holmes <david.holmes at oracle.com>
>>>> wrote:
>>>>
>>>>> On 12/05/2018 5:12 AM, Gary Adams wrote:
>>>>> > I just tried a local build and I'm seeing the same error you are.
>>>>> > See
>>>>> > build/ios-x86-64-mormal-minimal1-release/make-support/failur
>>>>> e-logs/buildjdk_hotspot_variant-server_tools_adlc_objs_BUILD_ADLC_link.{cmdline,log}
>>>>>
>>>>> >
>>>>> >
>>>>> > The basic configuration in
>>>>> > common/autoconf/flags.m4
>>>>> >
>>>>> > includes the adding of Frameworks to SYSROOT_LDFLAGS
>>>>> > and the handling of EXTRA_LDFLAGS.
>>>>> >
>>>>> > I need to track down the BUILD_ADLC instructions to find out why
>>>>> > the extra flags were not used. I'll take a look next week.
>>>>>
>>>>> adlc is little stand-alone C program, not part of the VM or JDK, so it
>>>>> doesn't generally need all the flags that hotspot/jdk compilations
>>>>> need.
>>>>> But for cross-compilation we would still need to use the EXTRA_*
>>>>> variables.
>>>>>
>>>>> I'm not sure what version of the repos this is discussing but there
>>>>> was
>>>>> a lot of flag cleanup in the JDK 11 build fairly recently.
>>>>>
>>>>> David
>>>>>
>>>>> > I'm targetting MacOSX 10.13.4 Xcode 9.3.1 iOS 11.2 SDK.
>>>>> >
>>>>> > ...
>>>>> >
>>>>> > On 5/11/18, 2:52 PM, Steve Hannah wrote:
>>>>> >>
>>>>> >> On Fri, May 11, 2018 at 11:19 AM, Gary Adams <gary.adams at oracle.com
>>>>> >> <mailto:gary.adams at oracle.com>> wrote:
>>>>> >>
>>>>> >> Looking at the link line which complains about mixing iOS and
>>>>> >> MacOSX SDKs,
>>>>> >> I do not see the expected extra ld flags. e.g.
>>>>> >> "-miphoneos-version-min=8.0.0 -arch x86_64 ..."
>>>>> >> Can you verify the configure step set the proper flags in *.gmk?
>>>>> >> e.g. EXTRA_
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> That's an interesting observation. When I grep for EXTRA_ in the
>>>>> >> .gmk files, it looks like they're there.
>>>>> >>
>>>>> >> ios-x86_64-normal-minimal1-release shannah$ grep EXTRA_ *.gmk
>>>>> >>
>>>>> >> buildjdk-spec.gmk:# Some users still set EXTRA_*FLAGS on the make
>>>>> >> command line. Must
>>>>> >>
>>>>> >> buildjdk-spec.gmk:override EXTRA_CFLAGS :=
>>>>> >>
>>>>> >> buildjdk-spec.gmk:override EXTRA_CXXFLAGS :=
>>>>> >>
>>>>> >> buildjdk-spec.gmk:override EXTRA_LDFLAGS :=
>>>>> >>
>>>>> >> spec.gmk:EXTRA_CFLAGS = -arch x86_64
>>>>> >> -Wno-implicit-function-declaration -Wno-unused-parameter
>>>>> >> -miphoneos-version-min=7.0
>>>>> >>
>>>>> >> spec.gmk:EXTRA_CXXFLAGS = -arch x86_64
>>>>> >> -Wno-implicit-function-declaration -Wno-unused-parameter
>>>>> >> -miphoneos-version-min=7.0
>>>>> >>
>>>>> >> spec.gmk:EXTRA_LDFLAGS = -arch x86_64 -miphoneos-version-min=7.0
>>>>> >> -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhon
>>>>> eSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
>>>>> >> -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhon
>>>>> eSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system
>>>>> >> -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhon
>>>>> eSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system
>>>>> >>
>>>>> >>
>>>>> >> spec.gmk:TAR_CREATE_EXTRA_PARAM:=
>>>>> >>
>>>>> >>
>>>>> >> And on other instances of bin/c++ in the build log, it does include
>>>>> >> them. Just not on the one the fails (and possibly others).
>>>>> >>
>>>>> >> However, now that I look at this, I see that they are not present
>>>>> in
>>>>> >> the buildjdk-spec.gmk. Only in the spec.gmk. Is that relevant?
>>>>> >>
>>>>> >> Here is a gist with the spec.gmk and buildjdk-spec.gmk in case
>>>>> >> something catches anyone's eye there.
>>>>> >> https://gist.github.com/shannah/aac10407178dee96ce5e6a4138d56d7a
>>>>> >>
>>>>> >>
>>>>> >> I was surprised you were targetting iOS 7.0 as a minimal
>>>>> platform.
>>>>> >> e.g. -miphoneos-version-min=7.0
>>>>> >>
>>>>> >>
>>>>> >> I had tried with -miphoneos-version-min=8.0.0 (as the instructions
>>>>> in
>>>>> >> the wiki had it), but was getting the same problem. This was an
>>>>> >> attempt to mix things up a bit.
>>>>> >>
>>>>> >>
>>>>> >> If you are having shell quoting issues, it helps to use single
>>>>> quotes
>>>>> >> when providing the with-extra flags. You just have to expand the
>>>>> >> "$XCODE ..." variable manually.
>>>>> >>
>>>>> >>
>>>>> >> Thanks for the tip. I don't think I'm having quoting issues, but
>>>>> I'll
>>>>> >> give that a try.
>>>>> >>
>>>>> >>
>>>>> >> Best regards
>>>>> >>
>>>>> >> Steve
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> On 5/11/18, 1:37 PM, Steve Hannah wrote:
>>>>> >>> Well, it seems that the build problems are unrelated to Xcode
>>>>> >>> version. I get the same thing with Xcode 7.1, 7.3, and 9.3.
>>>>>
>>>>> >>> They all fail with some error related to
>>>>> >>>
>>>>> >>> ld: building for OSX, but linking against dylib built for
>>>>> iOS
>>>>> >>>
>>>>> >>> The build log and configure command and output are in this gist
>>>>> >>> https://gist.github.com/shannah/03ca438b97c55dfc1c942112af43
>>>>> c5b6
>>>>> >>> <https://gist.github.com/shannah/03ca438b97c55dfc1c942112af4
>>>>> 3c5b6>
>>>>> >>>
>>>>> >>> I've tried following where Google and Stackoverflow lead on
>>>>> these
>>>>> >>> errors, but have exhausted all of my current leads.
>>>>> >>>
>>>>> >>> If anything about these logs jump out to anyone, please share.
>>>>> >>>
>>>>> >>> Best regards
>>>>> >>>
>>>>> >>> Steve
>>>>> >>>
>>>>> >>> On Thu, May 10, 2018 at 12:56 PM, Steve Hannah <
>>>>> steve at weblite.ca
>>>>> >>> <mailto:steve at weblite.ca>> wrote:
>>>>> >>>
>>>>> >>> Thanks for the tips.
>>>>> >>>
>>>>> >>> I'm using the configure listed on the instructions
>>>>> >>> (http://openjdk.java.net/projects/mobile/ios.html
>>>>> >>> <http://openjdk.java.net/projects/mobile/ios.html>)
>>>>> >>>
>>>>> >>> cd mobile-dev
>>>>> >>> bash configure \
>>>>> >>> --enable-option-checking=fatal \
>>>>> >>> --build=x86_64-apple-darwin \
>>>>> >>> --host=x86_64-macos-ios \
>>>>> >>> --target=x86_64-macos-ios \
>>>>> >>> --disable-warnings-as-errors \
>>>>> >>> --enable-headless-only \
>>>>> >>> --with-boot-jdk=$JDK_DIR \
>>>>> >>> --with-jdk-variant=normal \
>>>>> >>> --with-jvm-variants=minimal1 \
>>>>> >>> --enable-static-build=yes \
>>>>> >>> --with-extra-cflags="-arch x86_64
>>>>> >>> -Wno-implicit-function-declaration -Wno-unused-parameter
>>>>> >>> -miphoneos-version-min=8.0.0" \
>>>>> >>> --with-extra-cxxflags="-arch x86_64
>>>>> >>> -Wno-implicit-function-declaration -Wno-unused-parameter
>>>>> >>> -miphoneos-version-min=8.0.0" \
>>>>> >>> --with-extra-ldflags="-arch x86_64
>>>>> >>> -miphoneos-version-min=8.0.0
>>>>> >>> -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhon
>>>>> eSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
>>>>> >>> -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhon
>>>>> eSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system"
>>>>>
>>>>> >>> \
>>>>> >>> --with-cups-include=$CUPS_DIR \
>>>>> >>>
>>>>> >>> --with-sys-root=/Applications/Xcode.app/Contents/Developer/P
>>>>> latforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
>>>>> >>> \
>>>>> >>>
>>>>> >>> --with-tools-dir=/Applications/Xcode.app/Contents/Developer/
>>>>> Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/../../usr/bin
>>>>>
>>>>> >>> \
>>>>> >>> --with-debug-level=release \
>>>>> >>> --disable-precompiled-headers \
>>>>> >>> --with-freetype-lib=$FREETYPE_DIR/lib \
>>>>> >>> --with-freetype-include=$FREETYPE_DIR/include/freetype2
>>>>> >>>
>>>>> >>>
>>>>> >>> For iOS builds, I'd recommend first making sure you can
>>>>> >>> build for macosx with your installed toolchain,
>>>>> >>> and then try the iOS specific builds.
>>>>> >>>
>>>>> >>>
>>>>> >>> Thanks, I'll try that.
>>>>> >>>
>>>>> >>>
>>>>> >>> For the linking error, are you using more than one
>>>>> >>> installed version of Xcode.
>>>>> >>> e.g. "xcode-select -p" or DEVELOPER_DIR
>>>>> >>>
>>>>> >>>
>>>>> >>> I'm pretty sure I'm using just one at a time. I'm using
>>>>> >>> xcode-select to specify which Xcode to use, and I'm using
>>>>> the
>>>>> >>> corresponding Xcode in the configure statement.
>>>>> >>>
>>>>> >>>
>>>>> >>> I usually would do a "LOG=debug" build to see the full
>>>>> >>> command passed to the linker,
>>>>> >>> but you have enough in the errors you already have.
>>>>> >>>
>>>>> >>> clang: warning: using sysroot for 'iPhoneSimulator' but
>>>>> >>> targeting 'MacOSX' [-Wincompatible-sysroot]
>>>>> >>>
>>>>> >>>
>>>>> >>> Every object file and executable is built for a
>>>>> specific
>>>>> >>> SDK.
>>>>> >>> The warning says the flags do not match the toolchain
>>>>> >>> installed.
>>>>> >>>
>>>>> >>> ld: warning: directory not found for option
>>>>> >>>
>>>>> >>> '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPho
>>>>> neSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Syst
>>>>> em/Library/Frameworks/JavaVM.framework/Frameworks'
>>>>> >>>
>>>>> >>>
>>>>> >>> ld: building for OSX, but linking against dylib built
>>>>> for
>>>>> >>> iOS
>>>>> >>>
>>>>> >>> (/Applications/Xcode.app/Contents/Developer/Platforms/iPhone
>>>>> Simulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++.tbd).
>>>>>
>>>>> >>>
>>>>> >>> file
>>>>> >>>
>>>>> >>> '/Applications/Xcode.app/Contents/Developer/Platforms/iPhone
>>>>> Simulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++.tbd'
>>>>>
>>>>> >>>
>>>>> >>> for architecture x86_64
>>>>> >>>
>>>>> >>>
>>>>> >>> This would be a good time to compare the directory
>>>>> >>> structure of the iPhoneSimulator
>>>>> >>> SDK in Xcode 7.1 and 9.3. It may have changed.
>>>>> >>>
>>>>> >>>
>>>>> >>> Thanks. I'll do that. My attempt with 7.3 had similar
>>>>> >>> results - only I had to patch some code that required
>>>>> >>> CoreServices, which apparently isn't available in 7.3. I'm
>>>>> >>> going to download 7.1 and see if that gets me through to
>>>>> the
>>>>> >>> end.
>>>>> >>>
>>>>> >>> Best regards
>>>>> >>>
>>>>> >>> Steve
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >
>>>>>
>>>>
>>>
>>>
>>> --
>>> Steve Hannah
>>> Web Lite Solutions Corp.
>>>
>>>
>>>
>>
>>
>> --
>> Steve Hannah
>> Web Lite Solutions Corp.
>>
>>
>>
>
>
> --
> Steve Hannah
> Web Lite Solutions Corp.
>
>
>
--
Steve Hannah
Web Lite Solutions Corp.
More information about the mobile-dev
mailing list