Skip to content

Commit

Permalink
almost linking
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm authored and Alan Jeffrey committed Jul 13, 2018
1 parent 32731db commit 3f10c87
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ports/servo/fake-ld-armv7.sh
Expand Up @@ -12,4 +12,4 @@ source ./ports/servo/fake-ld.sh

export _GCC_PARAMS="${@}"
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi-v7a" \
"arm-linux-androideabi"
"armv7-linux-androideabi"
11 changes: 6 additions & 5 deletions ports/servo/fake-ld.sh
Expand Up @@ -15,11 +15,12 @@ call_gcc()
export _ANDROID_ARCH=$1
export _ANDROID_EABI=$2
export _ANDROID_PLATFORM=$3
export _ANDROID_TARGET=$5
export ANDROID_SYSROOT="${ANDROID_NDK}/platforms/${_ANDROID_PLATFORM}/${_ANDROID_ARCH}"
ANDROID_TOOLCHAIN=""
for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86"; do
if [[ -d "${ANDROID_NDK}/toolchains/${_ANDROID_EABI}-4.9/prebuilt/${host}/bin" ]]; then
ANDROID_TOOLCHAIN="${ANDROID_NDK}/toolchains/${_ANDROID_EABI}-4.9/prebuilt/${host}/bin"
if [[ -d "${ANDROID_NDK}/toolchains/llvm/prebuilt/${host}/bin" ]]; then
ANDROID_TOOLCHAIN="${ANDROID_NDK}/toolchains/llvm/prebuilt/${host}/bin"
break
fi
done
Expand All @@ -32,7 +33,7 @@ call_gcc()
echo "sysroot: ${ANDROID_SYSROOT}"
echo "targetdir: ${ANDROID_CXX_LIBS}"

"${ANDROID_TOOLCHAIN}/$5-gcc" \
--sysroot="${ANDROID_SYSROOT}" -L "${ANDROID_CXX_LIBS}" ${_GCC_PARAMS} -lc++ \
-o "${TARGET_DIR}/libservo.so" -shared && touch "${TARGET_DIR}/servo"
"${ANDROID_TOOLCHAIN}/clang" \
--sysroot="${ANDROID_SYSROOT}" --gcc-toolchain="${GCC_TOOLCHAIN}" -L "${ANDROID_CXX_LIBS}" ${_GCC_PARAMS} -lc++ \
-v -o "${TARGET_DIR}/libservo.so" --target="${_ANDROID_TARGET}" -shared && touch "${TARGET_DIR}/servo"
}
1 change: 1 addition & 0 deletions python/servo/build_commands.py
Expand Up @@ -348,6 +348,7 @@ def build(self, target=None, release=False, dev=False, jobs=None,
"prebuilt", host
)
env['ANDROID_TOOLCHAIN'] = gcc_toolchain
env['GCC_TOOLCHAIN'] = gcc_toolchain
gcc_toolchain_bin = path.join(gcc_toolchain, self.config["android"]["toolchain_prefix"], "bin")
env['AR'] = path.join(gcc_toolchain_bin, "ar")
env['RANLIB'] = path.join(gcc_toolchain_bin, "ranlib")
Expand Down

0 comments on commit 3f10c87

Please sign in to comment.