Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: pnacl/build.sh

Issue 9979025: [MIPS] Adding validator for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Update per initial code review. Nexes removed. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pnacl/build.sh
diff --git a/pnacl/build.sh b/pnacl/build.sh
index 46791781957cb5e1cd95deb6ef9082596148db87..b5ead8f21e057a7ddb52ea010f4da7e7310aa3e7 100755
--- a/pnacl/build.sh
+++ b/pnacl/build.sh
@@ -46,17 +46,19 @@ readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8}
readonly PNACL_MERGE_TESTING=${PNACL_MERGE_TESTING:-false}
PNACL_PRUNE=${PNACL_PRUNE:-false}
PNACL_BUILD_ARM=true
+# PNACL_BUILD_MIPS=true
if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then
# We don't yet support building ARM tools for mac or windows.
Brad Chen 2012/04/12 00:51:34 Please update this comment.
petarj 2012/04/12 13:21:01 Ok.
PNACL_BUILD_ARM=false
+ PNACL_BUILD_MIPS=false
fi
readonly SB_JIT=${SB_JIT:-false}
# TODO(pdox): Decide what the target should really permanently be
readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi
-readonly BINUTILS_TARGET=arm-pc-nacl
+readonly BINUTILS_TARGET=pc-nacl
readonly REAL_CROSS_TARGET=pnacl
readonly NACL64_TARGET=x86_64-nacl
@@ -244,9 +246,9 @@ GetInstallDir() {
SBTC_PRODUCTION=${SBTC_PRODUCTION:-false}
# Which toolchain to use for each arch.
-SBTC_BUILD_WITH_PNACL="armv7 i686 x86_64"
+SBTC_BUILD_WITH_PNACL="armv7 mips32 i686 x86_64"
if ${PNACL_IN_CROS_CHROOT}; then
- SBTC_BUILD_WITH_PNACL="armv7"
+ SBTC_BUILD_WITH_PNACL="armv7 mips32"
fi
# Current milestones in each repo
@@ -809,7 +811,8 @@ everything-post-hg() {
clean-logs
llvm
- binutils
+ binutils arm
+ binutils mipsel
binutils-gold
driver
@@ -1829,6 +1832,21 @@ arm-ncval-core ${INSTALL_ROOT}/tools-x86
else
StepBanner "MISC-ARM" "Skipping ARM validator (Not yet supported on Mac)"
fi
+
+ if ${BUILD_PLATFORM_LINUX} ; then
+ StepBanner "MISC-MIPS" "Building validator (MIPS32)"
+ spushd "${NACL_ROOT}"
+ RunWithLog mips_ncval_core \
+ ./scons MODE=opt-host \
+ targetplatform=mips32 \
+ sysinfo=0 \
+ mips-ncval-core
+ cp scons-out/opt-linux-x86-32-to-mips32/obj/src/trusted/validator_mips/\
+mips-ncval-core ${INSTALL_ROOT}/tools-x86/mips-ncval-core
+ spopd
+ else
+ StepBanner "MISC-MIPS" "Skipping MIPS validator (Not yet supported on Mac)"
+ fi
}
#########################################################################
@@ -1886,34 +1904,37 @@ libelf-sb() {
#+-------------------------------------------------------------------------
#+ binutils - Build and install binutils (cross-tools)
binutils() {
- StepBanner "BINUTILS (HOST)"
+ local arch=$1
+ StepBanner "BINUTILS (HOST) for ${arch}"
local srcdir="${TC_SRC_BINUTILS}"
assert-dir "${srcdir}" "You need to checkout binutils."
- if binutils-needs-configure; then
- binutils-clean
- binutils-configure
+ if binutils-needs-configure ${arch}; then
+ binutils-clean ${arch}
+ binutils-configure ${arch}
else
SkipBanner "BINUTILS" "configure"
fi
- binutils-dlwrap
- binutils-make
- binutils-install
+ binutils-dlwrap ${arch}
+ binutils-make ${arch}
+ binutils-install ${arch}
}
#+ binutils-clean - Clean binutils
binutils-clean() {
+ local arch=$1
StepBanner "BINUTILS" "Clean"
- local objdir="${TC_BUILD_BINUTILS}"
+ local objdir="${TC_BUILD_BINUTILS}-${arch}"
rm -rf ${objdir}
}
binutils-dlwrap() {
+ local arch=$1
local srcdir="${TC_SRC_BINUTILS}"
- local objdir="${TC_BUILD_BINUTILS}"
+ local objdir="${TC_BUILD_BINUTILS}-${arch}"
if ! [ -f "${LLVM_GOLD_PLUGIN}" ]; then
Fatal "LLVM must be installed before building binutils."
@@ -1928,12 +1949,17 @@ binutils-dlwrap() {
spopd
}
-#+ binutils-configure- Configure binutils for ARM
+#+ binutils-configure- Configure binutils for ARM or MIPS
binutils-configure() {
+ local arch=$1
+ local enable_gold='yes'
+ if [ ${arch} == 'mips' ]; then
+ enable_gold='no'
+ fi
StepBanner "BINUTILS" "Configure"
local srcdir="${TC_SRC_BINUTILS}"
- local objdir="${TC_BUILD_BINUTILS}"
+ local objdir="${TC_BUILD_BINUTILS}-${arch}"
# enable multiple targets so that we can use the same ar with all .o files
local targ="arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl"
@@ -1948,7 +1974,7 @@ binutils-configure() {
# binutils instead.
local flags="-DNACL_ALIGN_BYTES=32 -DNACL_ALIGN_POW2=5 \
-I${TC_SRC_BINUTILS}/dlwrap -DENABLE_DLWRAP"
- RunWithLog binutils.configure \
+ RunWithLog binutils-${arch}.configure \
env -i \
PATH="/usr/bin:/bin" \
CC="${CC}" \
@@ -1957,9 +1983,9 @@ binutils-configure() {
CFLAGS="${flags}" \
CXXFLAGS="${flags}" \
${srcdir}/binutils-2.20/configure --prefix="${BINUTILS_INSTALL_DIR}" \
- --target=${BINUTILS_TARGET} \
+ --target=${arch}-${BINUTILS_TARGET} \
--enable-targets=${targ} \
- --enable-gold=yes \
+ --enable-gold=${enable_gold} \
--enable-ld=yes \
--enable-plugins \
--disable-werror \
@@ -1974,20 +2000,22 @@ binutils-configure() {
}
binutils-needs-configure() {
- [ ! -f "${TC_BUILD_BINUTILS}/config.status" ]
+ local arch=$1
+ [ ! -f "${TC_BUILD_BINUTILS}-${arch}/config.status" ]
return $?
}
-#+ binutils-make - Make binutils for ARM
+#+ binutils-make - Make binutils for ARM or MIPS
binutils-make() {
+ local arch=$1
StepBanner "BINUTILS" "Make"
local srcdir="${TC_SRC_BINUTILS}"
- local objdir="${TC_BUILD_BINUTILS}"
+ local objdir="${TC_BUILD_BINUTILS}-${arch}"
spushd "${objdir}"
ts-touch-open "${objdir}"
- RunWithLog binutils.make \
+ RunWithLog binutils-${arch}.make \
env -i PATH="/usr/bin:/bin" \
make ${MAKE_OPTS}
@@ -1996,13 +2024,14 @@ binutils-make() {
spopd
}
-#+ binutils-install - Install binutils for ARM
+#+ binutils-install - Install binutils for ARM or MIPS
binutils-install() {
+ local arch=$1
StepBanner "BINUTILS" "Install"
- local objdir="${TC_BUILD_BINUTILS}"
+ local objdir="${TC_BUILD_BINUTILS}-${arch}"
spushd "${objdir}"
- RunWithLog binutils.install \
+ RunWithLog binutils-${arch}.install \
env -i PATH="/usr/bin:/bin" \
make \
install ${MAKE_OPTS}
@@ -2266,7 +2295,8 @@ llvm-sb-configure() {
i686) targets=x86 ;;
x86_64) targets=x86_64 ;;
armv7) targets=arm ;;
- universal) targets=x86,x86_64,arm ;;
+ mips32) targets=mips ;;
+ universal) targets=x86,x86_64,arm,mips ;;
esac
spushd "${objdir}"
@@ -2455,6 +2485,7 @@ binutils-sb-setup() {
x86_64) BINUTILS_SB_ELF_TARGETS=x86_64-pc-nacl ;;
armv7) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl ;;
universal) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl ;;
+ mips32) BINUTILS_SB_ELF_TARGETS=mipsel-pc-nacl ;;
esac
}
@@ -2517,7 +2548,7 @@ binutils-sb-configure() {
"${BINUTILS_SB_CONFIGURE_ENV[@]}" \
--prefix=${installdir} \
--host=nacl \
- --target=${BINUTILS_TARGET} \
+ --target=${BINUTILS_SB_ARCH}-${BINUTILS_TARGET} \
--enable-targets=${BINUTILS_SB_ELF_TARGETS} \
--disable-nls \
--disable-werror \
@@ -3233,9 +3264,9 @@ driver-install() {
echo "LIBMODE=${libmode}" > "${destdir}"/driver.conf
# Install readelf and size
- cp -a "${BINUTILS_INSTALL_DIR}/bin/${BINUTILS_TARGET}-readelf" \
+ cp -a "${BINUTILS_INSTALL_DIR}/bin/arm-${BINUTILS_TARGET}-readelf" \
Brad Chen 2012/04/12 00:51:34 Why do these names need to be changed? Where are t
petarj 2012/04/12 13:21:01 This patch tends to contain minimal (yet self-suff
"${destdir}/readelf"
- cp -a "${BINUTILS_INSTALL_DIR}/bin/${BINUTILS_TARGET}-size" \
+ cp -a "${BINUTILS_INSTALL_DIR}/bin/arm-${BINUTILS_TARGET}-size" \
"${destdir}/size"
# On windows, copy the cygwin DLLs needed by the driver tools

Powered by Google App Engine
This is Rietveld 408576698