2019-03-09 12:57:44 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This shell script strips out the -landroid that is passed by default by rustc to
|
|
|
|
# the linker on aarch64-linux-android, and adds some entries to the ld search path.
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
TARGET=${TARGET:-"aarch64-linux-android"}
|
2019-04-15 13:56:17 -04:00
|
|
|
LD=${LD:-"${MAGICLEAP_SDK}/tools/toolchains/bin/${TARGET}-ld"}
|
|
|
|
LDFLAGS=${LDFLAGS:-"--sysroot=${MAGICLEAP_SDK}/lumin -L${MAGICLEAP_SDK}/lumin/usr/lib -L${MAGICLEAP_SDK}/tools/toolchains/lib/gcc/${TARGET}/4.9.x ${MAGICLEAP_SDK}/lumin/usr/lib/crtbegin_so.o"}
|
2019-03-09 12:57:44 -05:00
|
|
|
|
|
|
|
# Remove the -landroid flag, grr
|
|
|
|
ARGS=("$@")
|
|
|
|
ARGS=${ARGS[@]/-landroid}
|
|
|
|
|
|
|
|
${LD} ${LDFLAGS} ${ARGS}
|