-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build universal libs and add iOS Sim support
Build universal libs by default now for armv7, armv7s, and i386. Sample Xcode projects now allow you to run either on a device or to run in the iOS simulator. Also, a coordinated update of iphoneos-apple-support and druntime to avoid dlyd private API calls.
- Loading branch information
Showing
8 changed files
with
108 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule iphoneos-apple-support
updated
2 files
+3 −1 | Makefile | |
+38 −45 | threadLocalVariables.c |
Submodule ldc
updated
2 files
+1 −1 | runtime/CMakeLists.txt | |
+1 −1 | runtime/druntime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
#!/bin/bash | ||
# Little frontend until ldc2 is updated with proper defaults for | ||
# iPhoneOS. Really all this is doing is defaulting -mtriple | ||
# to values in tools/flag. | ||
# Redirect to ldc2 in build/ldc/bin. Tries with and without iphoneos- | ||
# prefix. | ||
|
||
tooldir=`dirname $BASH_SOURCE[0]` | ||
topdir=`cd $tooldir/..; pwd` | ||
|
||
source $tooldir/flags # default dflags | ||
|
||
case $0 in | ||
*-ldc2) prog=ldc2;; | ||
*-ldmd2) prog=ldmd2;; | ||
esac | ||
|
||
[ "$DEBUGGING_SYMBOLS" = YES ] && args="-g" | ||
|
||
for arg in "$@"; do | ||
case $arg in | ||
*-mtriple*) triple=;; | ||
-v|-vv) verbose=1;; | ||
esac | ||
done | ||
|
||
progpath="$topdir/build/ldc/bin/$prog" | ||
|
||
if [ ! -x "$progpath" ]; then | ||
echo >&2 "$progpath does not seem to be built yet" | ||
path="$topdir/build/ldc/bin" | ||
if [ -x "$path/$prog" ]; then | ||
progpath="$path/$prog" | ||
elif [ -x "$path/iphoneos-$prog" ]; then | ||
progpath="$path/iphoneos-$prog" | ||
else | ||
echo >&2 "$prog or iphoneos-$prog do not seem to be built yet" | ||
exit 1 | ||
fi | ||
|
||
cmd="$progpath $triple" | ||
[ "$verbose" ] && echo $cmd $args "$@" | ||
$cmd $args "$@" | ||
exec $progpath "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
#!/bin/bash | ||
# configure to build LDC for iPhoneOS armv7 (iPhone 4 and later 32-bit stuff) | ||
# assumes LLVM is already built | ||
# Configure to build LDC with universal libs (druntime/phobos) for | ||
# iPhoneOS 32-bit archtectures. Assumes LLVM is already built | ||
|
||
# top dir is one up from this script's dir | ||
topdir=`dirname $BASH_SOURCE[0]`/.. | ||
|
||
# LLVM_ROOT_DIR must be an absolute path for some reason | ||
absolute=`cd $topdir; pwd` | ||
llvmdir="$absolute/build/llvm/Release/" | ||
installdir="$absolute/build/install" | ||
|
||
if [ ! -d "$llvmdir" ]; then | ||
echo "Missing $llvmdir" | ||
echo 'LLVM does not seem to be built yet' | ||
exit 1 | ||
fi | ||
|
||
# Need Xcode with the iPhoneOS SDK | ||
iphonesdk=`xcrun --sdk iphoneos --show-sdk-path` | ||
|
||
if [ -z "$iphonesdk" ]; then | ||
echo "Missing iPhoneOS SDK, can't build C code in druntime/phobos" | ||
exit 1 | ||
fi | ||
|
||
# get cflags, dflags. | ||
# cmake needs dflags to be separated by ';' instead of spaces, so xlate | ||
source $topdir/tools/flags | ||
dflags_cmake=`echo $dflags|tr -s ' ' ';'` | ||
|
||
# What's with all these flags? | ||
# -DUSE_OSX_TARGET_REAL compiles in code to use target's native real type | ||
# | ||
# The D versions are to support troubleshooting issues detected by unittest. | ||
# | ||
# WIP_FloatPrecIssue - work in progress for some floating point | ||
# precision problems | ||
|
||
cd $topdir/build/ldc && cmake \ | ||
-DLLVM_ROOT_DIR=$llvmdir \ | ||
-DCMAKE_CXX_FLAGS='-DUSE_OSX_TARGET_REAL' \ | ||
-DD_FLAGS="-w;-d;$dflags_cmake;-d-version=WIP_FloatPrecIssue" \ | ||
-DTARGET_C_FLAGS="$cflags -isysroot $iphonesdk" \ | ||
../../ldc | ||
cd $topdir/build/ldc && | ||
cmake -DLLVM_ROOT_DIR=$llvmdir \ | ||
-DIPHONEOS_ARCHS='all' \ | ||
-DPROGRAM_PREFIX=iphoneos- \ | ||
-DCMAKE_INSTALL_PREFIX=$installdir \ | ||
-DINCLUDE_INSTALL_DIR=$installdir/import ../../ldc | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
# Wrapper for iphoneos-ldc2 that converts Xcode Custom Build Rule | ||
# script environment into command line switches. | ||
# | ||
# Output Files should be: | ||
# ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.o | ||
|
||
# this script is expected to be alongside iphoneos-ldc2 | ||
dir=`dirname $BASH_SOURCE[0]` | ||
bindir=`cd $dir; pwd` | ||
ldc=iphoneos-ldc2 | ||
|
||
# Find the compiler, hopefully right next door | ||
if [ ! -x "$bindir/$ldc" ]; then | ||
echo >&2 "can't find $ldc in $bindir" | ||
exit 1 | ||
fi | ||
|
||
for arg in "$@"; do | ||
case $arg in | ||
-arch) have_arch=1;; | ||
-c) have_c=1;; | ||
-O*) have_O=1;; | ||
-g*) have_g=1;; | ||
-od*) have_od=1;; | ||
-of*) have_of=1;; | ||
-v|-vv) verbose=1;; | ||
*.d) have_dsrc=1;; | ||
esac | ||
done | ||
|
||
args="$bindir/$ldc" | ||
[ -z "$have_arch" -a "$arch" ] && | ||
args="$args -arch $arch" | ||
[ -z "$have_c" ] && | ||
args="$args -c" | ||
[ -z "$have_O" -a "$OPTIMIZATION_LEVEL" ] && | ||
args="$args -O$OPTIMIZATION_LEVEL" | ||
[ -z "$have_g" -a "$DEBUGGING_SYMBOLS" = YES ] && | ||
args="$args -g" | ||
[ -z "$have_od" -a -d "$DERIVED_FILES_DIR" ] && | ||
args="$args -od='$DERIVED_FILES_DIR'" | ||
[ -z "$have_dsrc" -a -f "$INPUT_FILE_PATH" ] && | ||
args="$args '$INPUT_FILE_PATH'" | ||
|
||
eval set $args "$@" | ||
[ "$verbose" ] && echo "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters