OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
(google.com) Derek Schuff
2012/04/12 16:46:39
The build.sh changes appear to be partly focused o
petarj
2012/04/12 17:38:17
Changes that enable building binutils for MIPS sho
(google.com) Derek Schuff
2012/04/12 17:54:22
true, but I don't see any validator tests in this
| |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 #@ Untrusted Toolchain Manager | 6 #@ Untrusted Toolchain Manager |
7 #@------------------------------------------------------------------- | 7 #@------------------------------------------------------------------- |
8 #@ This script builds the ARM and PNaCl untrusted toolchains. | 8 #@ This script builds the ARM and PNaCl untrusted toolchains. |
9 #@ It MUST be run from the native_client/ directory. | 9 #@ It MUST be run from the native_client/ directory. |
10 ###################################################################### | 10 ###################################################################### |
11 # Directory Layout Description | 11 # Directory Layout Description |
(...skipping 27 matching lines...) Expand all Loading... | |
39 SetScriptPath "${PNACL_ROOT}/build.sh" | 39 SetScriptPath "${PNACL_ROOT}/build.sh" |
40 SetLogDirectory "${PNACL_ROOT}/build/log" | 40 SetLogDirectory "${PNACL_ROOT}/build/log" |
41 | 41 |
42 # For different levels of make parallelism change this in your env | 42 # For different levels of make parallelism change this in your env |
43 readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8} | 43 readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8} |
44 # If true, we are in the middle of a merge. Do not update the llvm branch | 44 # If true, we are in the middle of a merge. Do not update the llvm branch |
45 # (except for clang, which has no local mods). | 45 # (except for clang, which has no local mods). |
46 readonly PNACL_MERGE_TESTING=${PNACL_MERGE_TESTING:-false} | 46 readonly PNACL_MERGE_TESTING=${PNACL_MERGE_TESTING:-false} |
47 PNACL_PRUNE=${PNACL_PRUNE:-false} | 47 PNACL_PRUNE=${PNACL_PRUNE:-false} |
48 PNACL_BUILD_ARM=true | 48 PNACL_BUILD_ARM=true |
49 # PNACL_BUILD_MIPS=true | |
49 | 50 |
50 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then | 51 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then |
51 # We don't yet support building ARM tools for mac or windows. | 52 # 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.
| |
52 PNACL_BUILD_ARM=false | 53 PNACL_BUILD_ARM=false |
54 PNACL_BUILD_MIPS=false | |
53 fi | 55 fi |
54 | 56 |
55 readonly SB_JIT=${SB_JIT:-false} | 57 readonly SB_JIT=${SB_JIT:-false} |
56 | 58 |
57 # TODO(pdox): Decide what the target should really permanently be | 59 # TODO(pdox): Decide what the target should really permanently be |
58 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi | 60 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi |
59 readonly BINUTILS_TARGET=arm-pc-nacl | 61 readonly BINUTILS_TARGET=pc-nacl |
60 readonly REAL_CROSS_TARGET=pnacl | 62 readonly REAL_CROSS_TARGET=pnacl |
61 readonly NACL64_TARGET=x86_64-nacl | 63 readonly NACL64_TARGET=x86_64-nacl |
62 | 64 |
63 readonly DRIVER_DIR="${PNACL_ROOT}/driver" | 65 readonly DRIVER_DIR="${PNACL_ROOT}/driver" |
64 readonly ARM_ARCH=armv7-a | 66 readonly ARM_ARCH=armv7-a |
65 readonly ARM_FPU=vfp | 67 readonly ARM_FPU=vfp |
66 | 68 |
67 readonly TOOLCHAIN_ROOT="${NACL_ROOT}/toolchain" | 69 readonly TOOLCHAIN_ROOT="${NACL_ROOT}/toolchain" |
68 | 70 |
69 readonly NNACL_BASE="${TOOLCHAIN_ROOT}/${SCONS_BUILD_PLATFORM}_x86" | 71 readonly NNACL_BASE="${TOOLCHAIN_ROOT}/${SCONS_BUILD_PLATFORM}_x86" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 # separately, one for each architecture, so that each translator | 239 # separately, one for each architecture, so that each translator |
238 # can only target its own architecture. | 240 # can only target its own architecture. |
239 # | 241 # |
240 # If SBTC_PRODUCTION is false, then we instead use PNaCl to | 242 # If SBTC_PRODUCTION is false, then we instead use PNaCl to |
241 # build a `fat` translator which can target all supported | 243 # build a `fat` translator which can target all supported |
242 # architectures. This translator is built as a .pexe | 244 # architectures. This translator is built as a .pexe |
243 # which can then be translated to each individual architecture. | 245 # which can then be translated to each individual architecture. |
244 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} | 246 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} |
245 | 247 |
246 # Which toolchain to use for each arch. | 248 # Which toolchain to use for each arch. |
247 SBTC_BUILD_WITH_PNACL="armv7 i686 x86_64" | 249 SBTC_BUILD_WITH_PNACL="armv7 mips32 i686 x86_64" |
248 if ${PNACL_IN_CROS_CHROOT}; then | 250 if ${PNACL_IN_CROS_CHROOT}; then |
249 SBTC_BUILD_WITH_PNACL="armv7" | 251 SBTC_BUILD_WITH_PNACL="armv7 mips32" |
250 fi | 252 fi |
251 | 253 |
252 # Current milestones in each repo | 254 # Current milestones in each repo |
253 readonly UPSTREAM_REV=${UPSTREAM_REV:-4dd3419f60be} | 255 readonly UPSTREAM_REV=${UPSTREAM_REV:-4dd3419f60be} |
254 | 256 |
255 readonly NEWLIB_REV=346ea38d142f | 257 readonly NEWLIB_REV=346ea38d142f |
256 readonly BINUTILS_REV=f44074cff866 | 258 readonly BINUTILS_REV=f44074cff866 |
257 readonly GOLD_REV=906eebd9b894 | 259 readonly GOLD_REV=906eebd9b894 |
258 readonly COMPILER_RT_REV=1a3a6ffb31ea | 260 readonly COMPILER_RT_REV=1a3a6ffb31ea |
259 | 261 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
802 # This is needed to build misc-tools and run ARM tests. | 804 # This is needed to build misc-tools and run ARM tests. |
803 # We check this early so that there are no surprises later, and we can | 805 # We check this early so that there are no surprises later, and we can |
804 # handle all user interaction early. | 806 # handle all user interaction early. |
805 check-for-trusted | 807 check-for-trusted |
806 | 808 |
807 clean-install | 809 clean-install |
808 | 810 |
809 clean-logs | 811 clean-logs |
810 | 812 |
811 llvm | 813 llvm |
812 binutils | 814 binutils arm |
815 binutils mipsel | |
813 binutils-gold | 816 binutils-gold |
814 | 817 |
815 driver | 818 driver |
816 | 819 |
817 libs | 820 libs |
818 | 821 |
819 # NOTE: we delay the tool building till after the sdk is essentially | 822 # NOTE: we delay the tool building till after the sdk is essentially |
820 # complete, so that sdk sanity checks don't fail | 823 # complete, so that sdk sanity checks don't fail |
821 misc-tools | 824 misc-tools |
822 verify | 825 verify |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1822 sysinfo=0 \ | 1825 sysinfo=0 \ |
1823 arm-ncval-core | 1826 arm-ncval-core |
1824 rm -rf "${INSTALL_ROOT}/tools-x86" | 1827 rm -rf "${INSTALL_ROOT}/tools-x86" |
1825 mkdir "${INSTALL_ROOT}/tools-x86" | 1828 mkdir "${INSTALL_ROOT}/tools-x86" |
1826 cp ${SCONS_OUT}/opt-linux-x86-32-to-arm/obj/src/trusted/validator_arm/\ | 1829 cp ${SCONS_OUT}/opt-linux-x86-32-to-arm/obj/src/trusted/validator_arm/\ |
1827 arm-ncval-core ${INSTALL_ROOT}/tools-x86 | 1830 arm-ncval-core ${INSTALL_ROOT}/tools-x86 |
1828 spopd | 1831 spopd |
1829 else | 1832 else |
1830 StepBanner "MISC-ARM" "Skipping ARM validator (Not yet supported on Mac)" | 1833 StepBanner "MISC-ARM" "Skipping ARM validator (Not yet supported on Mac)" |
1831 fi | 1834 fi |
1835 | |
1836 if ${BUILD_PLATFORM_LINUX} ; then | |
1837 StepBanner "MISC-MIPS" "Building validator (MIPS32)" | |
1838 spushd "${NACL_ROOT}" | |
1839 RunWithLog mips_ncval_core \ | |
1840 ./scons MODE=opt-host \ | |
1841 targetplatform=mips32 \ | |
1842 sysinfo=0 \ | |
1843 mips-ncval-core | |
1844 cp scons-out/opt-linux-x86-32-to-mips32/obj/src/trusted/validator_mips/\ | |
1845 mips-ncval-core ${INSTALL_ROOT}/tools-x86/mips-ncval-core | |
1846 spopd | |
1847 else | |
1848 StepBanner "MISC-MIPS" "Skipping MIPS validator (Not yet supported on Mac)" | |
1849 fi | |
1832 } | 1850 } |
1833 | 1851 |
1834 ######################################################################### | 1852 ######################################################################### |
1835 # < LIBELF > | 1853 # < LIBELF > |
1836 ######################################################################### | 1854 ######################################################################### |
1837 #+ libelf-host - Build and install libelf (using the host CC) | 1855 #+ libelf-host - Build and install libelf (using the host CC) |
1838 libelf-host() { | 1856 libelf-host() { |
1839 StepBanner "LIBELF-HOST" "Building and installing libelf" | 1857 StepBanner "LIBELF-HOST" "Building and installing libelf" |
1840 | 1858 |
1841 local extra_headers=false | 1859 local extra_headers=false |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1879 "${PNACL_ROOT}"/libelf/build-libelf.sh | 1897 "${PNACL_ROOT}"/libelf/build-libelf.sh |
1880 } | 1898 } |
1881 | 1899 |
1882 ######################################################################### | 1900 ######################################################################### |
1883 # < BINUTILS > | 1901 # < BINUTILS > |
1884 ######################################################################### | 1902 ######################################################################### |
1885 | 1903 |
1886 #+------------------------------------------------------------------------- | 1904 #+------------------------------------------------------------------------- |
1887 #+ binutils - Build and install binutils (cross-tools) | 1905 #+ binutils - Build and install binutils (cross-tools) |
1888 binutils() { | 1906 binutils() { |
1889 StepBanner "BINUTILS (HOST)" | 1907 local arch=$1 |
1908 StepBanner "BINUTILS (HOST) for ${arch}" | |
1890 | 1909 |
1891 local srcdir="${TC_SRC_BINUTILS}" | 1910 local srcdir="${TC_SRC_BINUTILS}" |
1892 | 1911 |
1893 assert-dir "${srcdir}" "You need to checkout binutils." | 1912 assert-dir "${srcdir}" "You need to checkout binutils." |
1894 | 1913 |
1895 if binutils-needs-configure; then | 1914 if binutils-needs-configure ${arch}; then |
1896 binutils-clean | 1915 binutils-clean ${arch} |
1897 binutils-configure | 1916 binutils-configure ${arch} |
1898 else | 1917 else |
1899 SkipBanner "BINUTILS" "configure" | 1918 SkipBanner "BINUTILS" "configure" |
1900 fi | 1919 fi |
1901 | 1920 |
1902 binutils-dlwrap | 1921 binutils-dlwrap ${arch} |
1903 binutils-make | 1922 binutils-make ${arch} |
1904 binutils-install | 1923 binutils-install ${arch} |
1905 } | 1924 } |
1906 | 1925 |
1907 #+ binutils-clean - Clean binutils | 1926 #+ binutils-clean - Clean binutils |
1908 binutils-clean() { | 1927 binutils-clean() { |
1928 local arch=$1 | |
1909 StepBanner "BINUTILS" "Clean" | 1929 StepBanner "BINUTILS" "Clean" |
1910 local objdir="${TC_BUILD_BINUTILS}" | 1930 local objdir="${TC_BUILD_BINUTILS}-${arch}" |
1911 rm -rf ${objdir} | 1931 rm -rf ${objdir} |
1912 } | 1932 } |
1913 | 1933 |
1914 binutils-dlwrap() { | 1934 binutils-dlwrap() { |
1935 local arch=$1 | |
1915 local srcdir="${TC_SRC_BINUTILS}" | 1936 local srcdir="${TC_SRC_BINUTILS}" |
1916 local objdir="${TC_BUILD_BINUTILS}" | 1937 local objdir="${TC_BUILD_BINUTILS}-${arch}" |
1917 | 1938 |
1918 if ! [ -f "${LLVM_GOLD_PLUGIN}" ]; then | 1939 if ! [ -f "${LLVM_GOLD_PLUGIN}" ]; then |
1919 Fatal "LLVM must be installed before building binutils." | 1940 Fatal "LLVM must be installed before building binutils." |
1920 fi | 1941 fi |
1921 | 1942 |
1922 # Build libdlwrap.a | 1943 # Build libdlwrap.a |
1923 mkdir -p "${objdir}/dlwrap" | 1944 mkdir -p "${objdir}/dlwrap" |
1924 spushd "${objdir}/dlwrap" | 1945 spushd "${objdir}/dlwrap" |
1925 ${CC} -c "${srcdir}"/dlwrap/dlwrap.c -o dlwrap.o | 1946 ${CC} -c "${srcdir}"/dlwrap/dlwrap.c -o dlwrap.o |
1926 cp "${LLVM_GOLD_PLUGIN}" gold_plugin_static.o | 1947 cp "${LLVM_GOLD_PLUGIN}" gold_plugin_static.o |
1927 ${AR} crs libdlwrap.a dlwrap.o gold_plugin_static.o | 1948 ${AR} crs libdlwrap.a dlwrap.o gold_plugin_static.o |
1928 spopd | 1949 spopd |
1929 } | 1950 } |
1930 | 1951 |
1931 #+ binutils-configure- Configure binutils for ARM | 1952 #+ binutils-configure- Configure binutils for ARM or MIPS |
1932 binutils-configure() { | 1953 binutils-configure() { |
1954 local arch=$1 | |
1955 local enable_gold='yes' | |
1956 if [ ${arch} == 'mips' ]; then | |
1957 enable_gold='no' | |
1958 fi | |
1933 StepBanner "BINUTILS" "Configure" | 1959 StepBanner "BINUTILS" "Configure" |
1934 | 1960 |
1935 local srcdir="${TC_SRC_BINUTILS}" | 1961 local srcdir="${TC_SRC_BINUTILS}" |
1936 local objdir="${TC_BUILD_BINUTILS}" | 1962 local objdir="${TC_BUILD_BINUTILS}-${arch}" |
1937 | 1963 |
1938 # enable multiple targets so that we can use the same ar with all .o files | 1964 # enable multiple targets so that we can use the same ar with all .o files |
1939 local targ="arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl" | 1965 local targ="arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl" |
1940 mkdir -p "${objdir}" | 1966 mkdir -p "${objdir}" |
1941 spushd "${objdir}" | 1967 spushd "${objdir}" |
1942 | 1968 |
1943 # The --enable-gold and --enable-plugins options are on so that we | 1969 # The --enable-gold and --enable-plugins options are on so that we |
1944 # can use gold's support for plugin to link PNaCl modules. | 1970 # can use gold's support for plugin to link PNaCl modules. |
1945 | 1971 |
1946 # TODO(pdox): Building binutils for nacl/nacl64 target currently requires | 1972 # TODO(pdox): Building binutils for nacl/nacl64 target currently requires |
1947 # providing NACL_ALIGN_* defines. This should really be defined inside | 1973 # providing NACL_ALIGN_* defines. This should really be defined inside |
1948 # binutils instead. | 1974 # binutils instead. |
1949 local flags="-DNACL_ALIGN_BYTES=32 -DNACL_ALIGN_POW2=5 \ | 1975 local flags="-DNACL_ALIGN_BYTES=32 -DNACL_ALIGN_POW2=5 \ |
1950 -I${TC_SRC_BINUTILS}/dlwrap -DENABLE_DLWRAP" | 1976 -I${TC_SRC_BINUTILS}/dlwrap -DENABLE_DLWRAP" |
1951 RunWithLog binutils.configure \ | 1977 RunWithLog binutils-${arch}.configure \ |
1952 env -i \ | 1978 env -i \ |
1953 PATH="/usr/bin:/bin" \ | 1979 PATH="/usr/bin:/bin" \ |
1954 CC="${CC}" \ | 1980 CC="${CC}" \ |
1955 CXX="${CXX}" \ | 1981 CXX="${CXX}" \ |
1956 LDFLAGS="-L${objdir}/dlwrap" \ | 1982 LDFLAGS="-L${objdir}/dlwrap" \ |
1957 CFLAGS="${flags}" \ | 1983 CFLAGS="${flags}" \ |
1958 CXXFLAGS="${flags}" \ | 1984 CXXFLAGS="${flags}" \ |
1959 ${srcdir}/binutils-2.20/configure --prefix="${BINUTILS_INSTALL_DIR}" \ | 1985 ${srcdir}/binutils-2.20/configure --prefix="${BINUTILS_INSTALL_DIR}" \ |
1960 --target=${BINUTILS_TARGET} \ | 1986 --target=${arch}-${BINUTILS_TARGET} \ |
1961 --enable-targets=${targ} \ | 1987 --enable-targets=${targ} \ |
1962 --enable-gold=yes \ | 1988 --enable-gold=${enable_gold} \ |
1963 --enable-ld=yes \ | 1989 --enable-ld=yes \ |
1964 --enable-plugins \ | 1990 --enable-plugins \ |
1965 --disable-werror \ | 1991 --disable-werror \ |
1966 --with-sysroot="${NONEXISTENT_PATH}" | 1992 --with-sysroot="${NONEXISTENT_PATH}" |
1967 # There's no point in setting the correct path as sysroot, because we | 1993 # There's no point in setting the correct path as sysroot, because we |
1968 # want the toolchain to be relocatable. The driver will use ld command-line | 1994 # want the toolchain to be relocatable. The driver will use ld command-line |
1969 # option --sysroot= to override this value and set it to the correct path. | 1995 # option --sysroot= to override this value and set it to the correct path. |
1970 # However, we need to include --with-sysroot during configure to get this | 1996 # However, we need to include --with-sysroot during configure to get this |
1971 # option. So fill in a non-sense, non-existent path. | 1997 # option. So fill in a non-sense, non-existent path. |
1972 | 1998 |
1973 spopd | 1999 spopd |
1974 } | 2000 } |
1975 | 2001 |
1976 binutils-needs-configure() { | 2002 binutils-needs-configure() { |
1977 [ ! -f "${TC_BUILD_BINUTILS}/config.status" ] | 2003 local arch=$1 |
2004 [ ! -f "${TC_BUILD_BINUTILS}-${arch}/config.status" ] | |
1978 return $? | 2005 return $? |
1979 } | 2006 } |
1980 | 2007 |
1981 #+ binutils-make - Make binutils for ARM | 2008 #+ binutils-make - Make binutils for ARM or MIPS |
1982 binutils-make() { | 2009 binutils-make() { |
2010 local arch=$1 | |
1983 StepBanner "BINUTILS" "Make" | 2011 StepBanner "BINUTILS" "Make" |
1984 local srcdir="${TC_SRC_BINUTILS}" | 2012 local srcdir="${TC_SRC_BINUTILS}" |
1985 local objdir="${TC_BUILD_BINUTILS}" | 2013 local objdir="${TC_BUILD_BINUTILS}-${arch}" |
1986 spushd "${objdir}" | 2014 spushd "${objdir}" |
1987 | 2015 |
1988 ts-touch-open "${objdir}" | 2016 ts-touch-open "${objdir}" |
1989 | 2017 |
1990 RunWithLog binutils.make \ | 2018 RunWithLog binutils-${arch}.make \ |
1991 env -i PATH="/usr/bin:/bin" \ | 2019 env -i PATH="/usr/bin:/bin" \ |
1992 make ${MAKE_OPTS} | 2020 make ${MAKE_OPTS} |
1993 | 2021 |
1994 ts-touch-commit "${objdir}" | 2022 ts-touch-commit "${objdir}" |
1995 | 2023 |
1996 spopd | 2024 spopd |
1997 } | 2025 } |
1998 | 2026 |
1999 #+ binutils-install - Install binutils for ARM | 2027 #+ binutils-install - Install binutils for ARM or MIPS |
2000 binutils-install() { | 2028 binutils-install() { |
2029 local arch=$1 | |
2001 StepBanner "BINUTILS" "Install" | 2030 StepBanner "BINUTILS" "Install" |
2002 local objdir="${TC_BUILD_BINUTILS}" | 2031 local objdir="${TC_BUILD_BINUTILS}-${arch}" |
2003 spushd "${objdir}" | 2032 spushd "${objdir}" |
2004 | 2033 |
2005 RunWithLog binutils.install \ | 2034 RunWithLog binutils-${arch}.install \ |
2006 env -i PATH="/usr/bin:/bin" \ | 2035 env -i PATH="/usr/bin:/bin" \ |
2007 make \ | 2036 make \ |
2008 install ${MAKE_OPTS} | 2037 install ${MAKE_OPTS} |
2009 | 2038 |
2010 spopd | 2039 spopd |
2011 } | 2040 } |
2012 | 2041 |
2013 #+------------------------------------------------------------------------- | 2042 #+------------------------------------------------------------------------- |
2014 #+ binutils-liberty - Build native binutils libiberty | 2043 #+ binutils-liberty - Build native binutils libiberty |
2015 binutils-liberty() { | 2044 binutils-liberty() { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2259 | 2288 |
2260 StepBanner "LLVM-SB" "Configure ${SB_ARCH} ${SB_SRPCMODE}" | 2289 StepBanner "LLVM-SB" "Configure ${SB_ARCH} ${SB_SRPCMODE}" |
2261 local srcdir="${TC_SRC_LLVM}" | 2290 local srcdir="${TC_SRC_LLVM}" |
2262 local objdir="${LLVM_SB_OBJDIR}" | 2291 local objdir="${LLVM_SB_OBJDIR}" |
2263 local installdir="${SB_INSTALL_DIR}" | 2292 local installdir="${SB_INSTALL_DIR}" |
2264 local targets="" | 2293 local targets="" |
2265 case ${SB_ARCH} in | 2294 case ${SB_ARCH} in |
2266 i686) targets=x86 ;; | 2295 i686) targets=x86 ;; |
2267 x86_64) targets=x86_64 ;; | 2296 x86_64) targets=x86_64 ;; |
2268 armv7) targets=arm ;; | 2297 armv7) targets=arm ;; |
2269 universal) targets=x86,x86_64,arm ;; | 2298 mips32) targets=mips ;; |
2299 universal) targets=x86,x86_64,arm,mips ;; | |
2270 esac | 2300 esac |
2271 | 2301 |
2272 spushd "${objdir}" | 2302 spushd "${objdir}" |
2273 RunWithLog \ | 2303 RunWithLog \ |
2274 ${LLVM_SB_LOG_PREFIX}.configure \ | 2304 ${LLVM_SB_LOG_PREFIX}.configure \ |
2275 env -i \ | 2305 env -i \ |
2276 PATH="/usr/bin:/bin" \ | 2306 PATH="/usr/bin:/bin" \ |
2277 ${srcdir}/configure \ | 2307 ${srcdir}/configure \ |
2278 "${LLVM_SB_CONFIGURE_ENV[@]}" \ | 2308 "${LLVM_SB_CONFIGURE_ENV[@]}" \ |
2279 --prefix=${installdir} \ | 2309 --prefix=${installdir} \ |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2448 RANLIB="${PNACL_RANLIB}" \ | 2478 RANLIB="${PNACL_RANLIB}" \ |
2449 LDFLAGS_FOR_BUILD="-L${TC_BUILD_BINUTILS_LIBERTY}/libiberty/" \ | 2479 LDFLAGS_FOR_BUILD="-L${TC_BUILD_BINUTILS_LIBERTY}/libiberty/" \ |
2450 LDFLAGS="") | 2480 LDFLAGS="") |
2451 | 2481 |
2452 | 2482 |
2453 case ${SB_ARCH} in | 2483 case ${SB_ARCH} in |
2454 i686) BINUTILS_SB_ELF_TARGETS=i686-pc-nacl ;; | 2484 i686) BINUTILS_SB_ELF_TARGETS=i686-pc-nacl ;; |
2455 x86_64) BINUTILS_SB_ELF_TARGETS=x86_64-pc-nacl ;; | 2485 x86_64) BINUTILS_SB_ELF_TARGETS=x86_64-pc-nacl ;; |
2456 armv7) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl ;; | 2486 armv7) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl ;; |
2457 universal) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl ; ; | 2487 universal) BINUTILS_SB_ELF_TARGETS=arm-pc-nacl,i686-pc-nacl,x86_64-pc-nacl ; ; |
2488 mips32) BINUTILS_SB_ELF_TARGETS=mipsel-pc-nacl ;; | |
2458 esac | 2489 esac |
2459 } | 2490 } |
2460 | 2491 |
2461 #+------------------------------------------------------------------------- | 2492 #+------------------------------------------------------------------------- |
2462 #+ binutils-sb <arch> <mode> - Build and install binutils (sandboxed) | 2493 #+ binutils-sb <arch> <mode> - Build and install binutils (sandboxed) |
2463 binutils-sb() { | 2494 binutils-sb() { |
2464 binutils-sb-setup "$@" | 2495 binutils-sb-setup "$@" |
2465 StepBanner "BINUTILS-SB" "Sandboxed ld [${SB_LABEL}]" | 2496 StepBanner "BINUTILS-SB" "Sandboxed ld [${SB_LABEL}]" |
2466 | 2497 |
2467 local srcdir="${TC_SRC_BINUTILS}" | 2498 local srcdir="${TC_SRC_BINUTILS}" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2510 | 2541 |
2511 spushd "${objdir}" | 2542 spushd "${objdir}" |
2512 RunWithLog \ | 2543 RunWithLog \ |
2513 ${BINUTILS_SB_LOG_PREFIX}.configure \ | 2544 ${BINUTILS_SB_LOG_PREFIX}.configure \ |
2514 env -i \ | 2545 env -i \ |
2515 PATH="/usr/bin:/bin" \ | 2546 PATH="/usr/bin:/bin" \ |
2516 ${srcdir}/binutils-2.20/configure \ | 2547 ${srcdir}/binutils-2.20/configure \ |
2517 "${BINUTILS_SB_CONFIGURE_ENV[@]}" \ | 2548 "${BINUTILS_SB_CONFIGURE_ENV[@]}" \ |
2518 --prefix=${installdir} \ | 2549 --prefix=${installdir} \ |
2519 --host=nacl \ | 2550 --host=nacl \ |
2520 --target=${BINUTILS_TARGET} \ | 2551 --target=${BINUTILS_SB_ARCH}-${BINUTILS_TARGET} \ |
2521 --enable-targets=${BINUTILS_SB_ELF_TARGETS} \ | 2552 --enable-targets=${BINUTILS_SB_ELF_TARGETS} \ |
2522 --disable-nls \ | 2553 --disable-nls \ |
2523 --disable-werror \ | 2554 --disable-werror \ |
2524 --disable-plugins \ | 2555 --disable-plugins \ |
2525 --enable-static \ | 2556 --enable-static \ |
2526 --enable-shared=no | 2557 --enable-shared=no |
2527 spopd | 2558 spopd |
2528 } | 2559 } |
2529 | 2560 |
2530 binutils-sb-needs-make() { | 2561 binutils-sb-needs-make() { |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3226 local libmode=$1 | 3257 local libmode=$1 |
3227 check-libmode ${libmode} | 3258 check-libmode ${libmode} |
3228 local destdir="${INSTALL_ROOT}/${libmode}/bin" | 3259 local destdir="${INSTALL_ROOT}/${libmode}/bin" |
3229 | 3260 |
3230 driver-install-python "${destdir}" "pnacl-*.py" | 3261 driver-install-python "${destdir}" "pnacl-*.py" |
3231 | 3262 |
3232 # Tell the driver the library mode | 3263 # Tell the driver the library mode |
3233 echo "LIBMODE=${libmode}" > "${destdir}"/driver.conf | 3264 echo "LIBMODE=${libmode}" > "${destdir}"/driver.conf |
3234 | 3265 |
3235 # Install readelf and size | 3266 # Install readelf and size |
3236 cp -a "${BINUTILS_INSTALL_DIR}/bin/${BINUTILS_TARGET}-readelf" \ | 3267 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
| |
3237 "${destdir}/readelf" | 3268 "${destdir}/readelf" |
3238 cp -a "${BINUTILS_INSTALL_DIR}/bin/${BINUTILS_TARGET}-size" \ | 3269 cp -a "${BINUTILS_INSTALL_DIR}/bin/arm-${BINUTILS_TARGET}-size" \ |
3239 "${destdir}/size" | 3270 "${destdir}/size" |
3240 | 3271 |
3241 # On windows, copy the cygwin DLLs needed by the driver tools | 3272 # On windows, copy the cygwin DLLs needed by the driver tools |
3242 if ${BUILD_PLATFORM_WIN}; then | 3273 if ${BUILD_PLATFORM_WIN}; then |
3243 StepBanner "DRIVER" "Copying cygwin libraries" | 3274 StepBanner "DRIVER" "Copying cygwin libraries" |
3244 local deps="gcc_s-1 iconv-2 win1 intl-8 stdc++-6 z" | 3275 local deps="gcc_s-1 iconv-2 win1 intl-8 stdc++-6 z" |
3245 for name in ${deps}; do | 3276 for name in ${deps}; do |
3246 cp "/bin/cyg${name}.dll" "${destdir}" | 3277 cp "/bin/cyg${name}.dll" "${destdir}" |
3247 done | 3278 done |
3248 fi | 3279 fi |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3839 #Usage | 3870 #Usage |
3840 echo "ERROR: unknown function '$1'." >&2 | 3871 echo "ERROR: unknown function '$1'." >&2 |
3841 echo "For help, try:" | 3872 echo "For help, try:" |
3842 echo " $0 help" | 3873 echo " $0 help" |
3843 exit 1 | 3874 exit 1 |
3844 fi | 3875 fi |
3845 | 3876 |
3846 hg-migrate | 3877 hg-migrate |
3847 | 3878 |
3848 "$@" | 3879 "$@" |
OLD | NEW |