aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2015-04-21 15:31:30 -0600
committerRob Savoye <rob.savoye@linaro.org>2015-04-21 15:31:30 -0600
commite146ff5b94b345fe2f92d9e696b146a4d0d5b51c (patch)
tree3a8ec0de08cb86641912e405f64ceb51273718e4
parent92ec1ba1414cc3452433a1773c279e4ef85d7889 (diff)
parenta2540189a04d3463de296a431cd9f03b0f620d66 (diff)
Merge branch 'master' of ssh://git.linaro.org/toolchain/abe
Merge upstream patches from gerrit.
-rw-r--r--README18
-rwxr-xr-xabe.sh91
-rw-r--r--config/gcc.conf2
-rw-r--r--lib/checkout.sh19
-rwxr-xr-xtest.sh52
-rwxr-xr-xtestsuite/test.sh64
6 files changed, 158 insertions, 88 deletions
diff --git a/README b/README
index c070c373..90b6a457 100644
--- a/README
+++ b/README
@@ -104,32 +104,32 @@ string. To build a specific component, use the --build option to
abe. the --target option is also used for cross builds. For
example:
-"abe.sh --target arm-none-linux-gnueabihf gcc-linaro-4.8.2013.07-1"
+"abe.sh --target arm-linux-gnueabihf gcc-linaro-4.8.2013.07-1"
This would fetch the source tarball for this release, build anything
it needs to compile, the binutils for example, and then build these
sources. You can also specify a URL to a source repository
instead. For example:
-"abe.sh --target arm-none-linux-gnueabihf git://git.linaro.org/toolchain/eglibc.git"
+"abe.sh --target arm-linux-gnueabihf git://git.linaro.org/toolchain/eglibc.git"
To build an entire cross toolchain, the simplest way is to let
abe control all the steps. Although it is also possible to do each
step separately. To build the full toolchain, do this:
-"abe.sh --target arm-none-linux-gnueabihf --build all"
+"abe.sh --target arm-linux-gnueabihf --build all"
---------------------------------------------------------------------
Older NOTES
-x86_64-none-linux-gnu
-arm-none-linux-gnueabi
-arm-none-linux-gnueabihf
-armeb-none-linux-gnueabihf
-aarch64-none-linux-gnu
+x86_64-linux-gnu
+arm-linux-gnueabi
+arm-linux-gnueabihf
+armeb-linux-gnueabihf
+aarch64-linux-gnu
aarch64-none-elf
aarch64_be-none-elf
-aarch64_be-none-linux-gnu
+aarch64_be-linux-gnu
Toolchain Components
* gcc (gcc, g++, objc, fortran)
diff --git a/abe.sh b/abe.sh
index 1518a007..3a74abef 100755
--- a/abe.sh
+++ b/abe.sh
@@ -20,25 +20,26 @@ usage()
{
# Format this section with 75 columns.
cat << EOF
- ${abe} [''| [--timeout <value>]
- [[--build [<package> --stage {1|2}]|all]
- |[--checkout <package>|all]]
- [--check [{all|glibc|gcc|gdb|binutils}]]
- [--ccache] [--enable {bootstrap|gerrit}]
- [--disable {install|update|make_docs|building}] [--dryrun] [--dump]
+ ${abe} [''| [--build {<package> [--stage {1|2}]|all}]
+ [--ccache] [--check [{all|glibc|gcc|gdb|binutils}]]
+ [--checkout {<package>[~branch][@revision]|all}]
+ [--disable {install|update|make_docs|building}] [--dryrun]
+ [--dump] [--enable {bootstrap|gerrit}]
[--excludecheck {all|glibc|gcc|gdb|binutils}]
- [--fetch <url>] [--force] [--host <host_triple>] [--help]
+ [--fetch <url>] [--force] [--help] [--host <host_triple>]
+ [--infrastructure] [--interactive]
[--list] [--manifest <manifest_file>]
- [--parallel] [--release <release_version_string>]
+ [--parallel] [--prefix] [--release <release_version_string>]
[--set {arch|cpu|tune}=XXX]
+ [--set {cflags|ldflags|runtestflags|makeflags}=XXX]
+ [--set {languages}={c|c++|fortran|go|lto|objc|java|ada}]
[--set {libc}={glibc|eglibc|newlib}]
[--set {linker}={ld|gold}]
- [--set {languages}={c|c++|fortran|go|lto|objc|java|ada}]
- [--set {cflags|ldflags|runtestflgs|makeflags}=XXX]
[--set {package}={toolchain|gdb|sysroot}]
- [--snapshots <url>] [--target <target_triple>] [--usage]
- [--interactive]
- [{binutils|gcc|gmp|mpft|mpc|eglibc|glibc|newlib}
+ [--snapshots <path>] [--tarball] [--tarbin] [--tarsrc]
+ [--target {<target_triple>|''}] [--timeout <timeout_value>]
+ [--usage]
+ [{binutils|gcc|gmp|mpfr|mpc|eglibc|glibc|newlib}
=<id|snapshot|url>]]
EOF
@@ -118,7 +119,7 @@ OPTIONS
If there is no directive it's the same as 'all' and
make check will be run on all supported packages.
- --checkout <package>[~branch][@revision]|all
+ --checkout {<package>[~branch][@revision]|all}
<package>[~branch][@revision]
This will checkout the package designated by the
@@ -130,7 +131,7 @@ OPTIONS
complete build as specified by the config/ .conf
files.
- --disable {install}
+ --disable {install|update|make_docs|building}
install
Disable the make install stage of packages, which
@@ -144,7 +145,7 @@ OPTIONS
building
Don't build anything. This is only useful when
- using --tarbin, --tarsrc, --tarballs.
+ using --tarbin, --tarsrc, or --tarball.
This is a debugging aid for developers, as it
assumes everything built correctly...
@@ -153,7 +154,7 @@ OPTIONS
--dump Dump configuration file information for this build.
- --enable {bootstrap}
+ --enable {bootstrap|gerrit}
bootstrap
Enable gcc bootstrapping, which is disabled by
@@ -245,34 +246,34 @@ OPTIONS
--target value is compatible with the passed arch, cpu, or
tune value.
- --set {linker}={ld|gold}
+ --set {cflags|ldflags|runtestflags|makeflags}=XXX
+ This overrides the default values used for CFLAGS,
+ LDFLAGS, RUNTESTFLAGS, and MAKEFLAGS.
+
+ --set {languages}={c|c++|fortran|go|lto|objc|java|ada}
+ This changes the default set of GCC front ends that get built.
+ The default set for most platforms is c, c++, go, fortran,
+ and lto.
- The default is to build the older GNU linker. This option
- changes the linker to Gold, which is required for some C++
- projects, including Andriod and Chromium.
-
--set {libc}={glibc|eglibc|newlib}
The default value is stored in lib/global.sh. This
setting overrides the default. Specifying a libc
other than newlib on baremetal targets is an error.
- --set {cflags|ldflags|runtestflags|makeflags}=XXX
- This overrides the default values used for CFLAGS,
- LDFLAGS, RUNTESTFLAGS, and MAKEFLAGS.
+ --set {linker}={ld|gold}
+ The default is to build the older GNU linker. This option
+ changes the linker to Gold, which is required for some C++
+ projects, including Andriod and Chromium.
+
--set {package}={toolchain|gdb|sysroot}
This limits the default set of packages to the specified set.
This only applies to the --tarbin, --tarsrc, and --tarballs
command lines options, and are primarily to be only used by
developers.
- --set {languages}={c|c++|fortran|go|lto|objc|java|ada}
- This changes the default set of GCC front ends that get built.
- The default set for most platforms is c, c++, go, fortran,
- and lto.
-
- --snapshots /path/to/alternative/local_snapshots/directory
+ --snapshots <path>
Use an alternative path to a local snapshots directory.
--stage {1|2}
@@ -283,13 +284,13 @@ OPTIONS
--tarball
Build source and binary tarballs after a successful build.
- --tarsrc
- Build source tarballs after a successful build.
-
--tarbin
Build binary tarballs after a successful build.
- --target [<target_triple>|'']
+ --tarsrc
+ Build source tarballs after a successful build.
+
+ --target {<target_triple>|''}
This sets the target triple. The GNU target triple
represents where the binaries built by the toolchain will
@@ -301,14 +302,16 @@ OPTIONS
<target_triple>
- x86_64-none-linux-gnu
- arm-none-linux-gnueabi
- arm-none-linux-gnueabihf
- armeb-none-linux-gnueabihf
- aarch64-none-linux-gnu
+ x86_64-linux-gnu
+ arm-linux-gnueabi
+ arm-linux-gnueabihf
+ arm-none-eabi
+ armeb-none-eabi
+ armeb-linux-gnueabihf
+ aarch64-linux-gnu
aarch64-none-elf
aarch64_be-none-elf
- aarch64_be-none-linux-gnu
+ aarch64_be-linux-gnu
If <target_triple> is not the same as the hardware
that ${abe} is running on then build the
@@ -321,7 +324,7 @@ OPTIONS
--usage Display synopsis information.
- [{binutils|gcc|gmp|mpft|mpc|eglibc|glibc|newlib}=<id|snapshot|url>]
+ [{binutils|gcc|gmp|mpfr|mpc|eglibc|glibc|newlib}=<id|snapshot|url>]
This option specifies a particular version of a package
that might differ from the default version in the
@@ -346,11 +349,11 @@ EXAMPLES
Build a Linux cross toolchain:
- ${abe} --target arm-none-linux-gnueabihf --build all
+ ${abe} --target arm-linux-gnueabihf --build all
Build a Linux cross toolchain with glibc as the clibrary:
- ${abe} --target arm-none-linux-gnueabihf --set libc=glibc --build all
+ ${abe} --target arm-linux-gnueabihf --set libc=glibc --build all
Build a bare metal toolchain:
diff --git a/config/gcc.conf b/config/gcc.conf
index 2874c537..7bf36a88 100644
--- a/config/gcc.conf
+++ b/config/gcc.conf
@@ -208,7 +208,7 @@ else
default_configure_flags="${default_configure_flags} --disable-bootstrap"
fi
case ${target} in
- arm*-none-linux-gnueabi)
+ arm*-linux-gnueabi)
if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
fi
diff --git a/lib/checkout.sh b/lib/checkout.sh
index 091264b0..cde40d4b 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -196,23 +196,26 @@ checkout()
local service=
service="`get_git_service $1`"
if test x"${service}" = x ; then
- error "A proper url is required. Call get_URL first."
+ error "Unable to parse service from '$1'. You have either a bad URL, or an identifier that should be passed to get_URL."
return 1
fi
local repo=
- repo="`get_git_repo $1`"
+ repo="`get_git_repo $1`" || return 1
+ #None of the following should be able to fail with the code as it is
+ #written today (and failures are therefore untestable) but propagate
+ #errors anyway, in case that situation changes.
local tool=
- tool="`get_toolname $1`"
+ tool="`get_toolname $1`" || return 1
local url=
- url="`get_git_url $1`"
+ url="`get_git_url $1`" || return 1
local branch=
- branch="`get_git_branch $1`"
+ branch="`get_git_branch $1`" || return 1
local revision=
- revision="`get_git_revision $1`"
+ revision="`get_git_revision $1`" || return 1
local srcdir=
- srcdir="`get_srcdir $1`"
+ srcdir="`get_srcdir $1`" || return 1
case $1 in
svn*)
@@ -283,7 +286,7 @@ checkout()
# it doesn't exist already.
dryrun "(cd ${srcdir} && git checkout -B local_${revision})"
else
- notice "Checking out ${branch:+branch ${branch}}${branch-master branch} for ${tool} in ${srcdir}"
+ notice "Checking out branch ${branch} for ${tool} in ${srcdir}"
local cmd="${NEWWORKDIR} ${local_snapshots}/${repo} ${srcdir} ${branch}"
flock ${local_builds}/git$$.lock --command "${cmd}"
if test $? -gt 0; then
diff --git a/test.sh b/test.sh
index 242a859d..694270aa 100755
--- a/test.sh
+++ b/test.sh
@@ -224,13 +224,13 @@ test_config_default()
# Let's make sure the stage is actually skipped.
# --force makes sure we run through to the stage even
# if the builddir builds stamps are new.
- cb_commands="--dryrun --force --target arm-none-linux-gnueabihf --disable ${feature} --build all"
+ cb_commands="--dryrun --force --target arm-linux-gnueabihf --disable ${feature} --build all"
test_pass "${cb_commands}" "${skip_match}"
# Let's make sure the stage is actually NOT skipped.
# --force makes sure we run through to the stage even
# if the builddir builds stamps are new.
- cb_commands="--dryrun --force --target arm-none-linux-gnueabihf --enable ${feature} --build all"
+ cb_commands="--dryrun --force --target arm-linux-gnueabihf --enable ${feature} --build all"
test_pass "${cb_commands}" "${perform_match}"
}
@@ -351,15 +351,15 @@ cb_commands="--dryrun --checkout gcc.git"
match=''
test_pass "${cb_commands}" "${match}"
-cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout glibc.git"
+cb_commands="--dryrun --target arm-linux-gnueabihf --checkout glibc.git"
match=''
test_pass "${cb_commands}" "${match}"
-cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout=glibc.git"
+cb_commands="--dryrun --target arm-linux-gnueabihf --checkout=glibc.git"
match="A space is expected"
test_failure "${cb_commands}" "${match}"
-cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout all"
+cb_commands="--dryrun --target arm-linux-gnueabihf --checkout all"
match=''
test_pass "${cb_commands}" "${match}"
@@ -409,7 +409,7 @@ cb_commands="--target ${target} --dump"
match='newlib'
test_pass "${cb_commands}" "${match}"
-target="armeb-none-linux-gnueabihf"
+target="armeb-linux-gnueabihf"
# A baremetal target should pick the right clibrary (newlib)
cb_commands="--target ${target} --dump"
match='eglibc'
@@ -421,7 +421,7 @@ cb_commands="--target ${target} --dump"
match='eglibc'
test_pass "${cb_commands}" "${match}"
-target="armeb-none-linux-gnueabi"
+target="armeb-linux-gnueabi"
cb_commands="--target ${target} --dump"
match='eglibc'
test_pass "${cb_commands}" "${match}"
@@ -431,7 +431,7 @@ cb_commands="--target ${target} --dump"
match='eglibc'
test_pass "${cb_commands}" "${match}"
-target="armeb-none-linux-gnueabi"
+target="armeb-linux-gnueabi"
# A baremetal target should pick the right clibrary (newlib)
cb_commands="--target ${target} --dump"
match='eglibc'
@@ -508,13 +508,13 @@ match="Couldn't find the source for"
test_failure "${cb_commands}" "${match}"
# This tests that --build can go before --target and --target is still processed correctly.
-cb_commands="--dryrun --build all --target arm-none-linux-gnueabihf --dump"
-match='arm-none-linux-gnueabihf'
+cb_commands="--dryrun --build all --target arm-linux-gnueabihf --dump"
+match='arm-linux-gnueabihf'
test_pass "${cb_commands}" "${match}"
# This tests that --checkout can go before --target and --target is still processed correctly.
-cb_commands="--dryrun --checkout all --target arm-none-linux-gnueabihf --dump"
-match='arm-none-linux-gnueabihf'
+cb_commands="--dryrun --checkout all --target arm-linux-gnueabihf --dump"
+match='arm-linux-gnueabihf'
test_pass "${cb_commands}" "${match}"
test_config_default make_docs 'Make Documentation' 'Skipping make docs' 'Making docs in'
@@ -556,7 +556,7 @@ match='Target is\: arm-linux-gnueabihf'
test_pass "${cb_commands}" "${match}"
# This tests that --checkout and --build can be run together.
-cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout all --build all"
+cb_commands="--dryrun --target arm-linux-gnueabihf --checkout all --build all"
match=''
test_pass "${cb_commands}" "${match}"
@@ -626,7 +626,7 @@ match="crosscheck_clibrary_target"
test_failure "${cb_commands}" "${match}"
# The same as previous but with other commands mixed in.
-target="arm-none-linux-gnueabihf"
+target="arm-linux-gnueabihf"
cb_commands="--set libc=glibc --dry-run --build all --target ${target}"
match=''
test_pass "${cb_commands}" "${match}"
@@ -643,50 +643,50 @@ else
fi
cb_commands="--dry-run --target arm-linux-gnueabihf --set arch=armv8-a"
-march='Overriding default --with-arch to armv8-a'
+match='Overriding default --with-arch to armv8-a'
test_pass "${cb_commands}" "${match}"
cb_commands="--dry-run --target arm-linux-gnueabihf --set cpu=cortex-a57"
-march='Overriding default --with-cpu to cortex-a57'
+match='Overriding default --with-cpu to cortex-a57'
test_pass "${cb_commands}" "${match}"
cb_commands="--dry-run --target arm-linux-gnueabihf --set tune=cortex-a53"
-march='Overriding default --with-cpu to cortex-a53'
+match='Overriding default --with-tune to cortex-a53'
test_pass "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --check=foo"
+cb_commands="--dry-run --target arm-linux-gnueabihf --check=foo"
match='is invalid after'
test_failure "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --dump --check"
+cb_commands="--dry-run --target arm-linux-gnueabihf --dump --check"
match='check all'
test_pass "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --dump --check --dump"
+cb_commands="--dry-run --target arm-linux-gnueabihf --dump --check --dump"
match='check all'
test_pass "${cb_commands}" "${match}"
# Yes this won't work because we match on 'exact' package name only.
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --dump --check gdb--dump"
+cb_commands="--dry-run --target arm-linux-gnueabihf --dump --check gdb--dump"
match='dump is an invalid package'
test_failure "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --check --dump"
+cb_commands="--dry-run --target arm-linux-gnueabihf --check --dump"
match='check all'
test_pass "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --check gdb --dump"
+cb_commands="--dry-run --target arm-linux-gnueabihf --check gdb --dump"
match='check gdb'
test_pass "${cb_commands}" "${match}"
-cb_commands="--dry-run --target arm-none-linux-gnueabihf --check all --dump"
+cb_commands="--dry-run --target arm-linux-gnueabihf --check all --dump"
match='check all'
test_pass "${cb_commands}" "${match}"
# Verify that --check without a directive doesn't strip the next switch from
# the command line.
-cb_commands="--dry-run --check --target arm-none-linux-gnueabihf --dump"
-match=' arm-none-linux-gnueabihf'
+cb_commands="--dry-run --check --target arm-linux-gnueabihf --dump"
+match=' arm-linux-gnueabihf'
test_pass "${cb_commands}" "${match}"
# test various combinations of --check and --excludecheck
diff --git a/testsuite/test.sh b/testsuite/test.sh
index a0621778..5d6d2d33 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -1352,6 +1352,58 @@ echo "================================================"
# These can be painfully slow so test small repos.
+#confirm that checkout works with raw URLs
+testing="http://abe.git@staging.git.linaro.org/git/toolchain/abe.git"
+in="${testing}"
+if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${testing}`"
+else
+ out="`cd ${local_snapshots} && checkout ${testing} 2>/dev/null`"
+fi
+if test $? -eq 0; then
+ pass "${testing}"
+else
+ fail "${testing}"
+fi
+
+#confirm that checkout fails approriately with a range of bad services in raw URLs
+for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do
+ in="${service}abe.git@staging.git.linaro.org/git/toolchain/abe.git"
+ testing="checkout: ${in} should fail with 'proper URL required' message."
+ if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`"
+ else
+ out="`cd ${local_snapshots} && checkout ${in} 2>&1`"
+ fi
+ if test $? -eq 0; then
+ fail "${testing}"
+ else
+ if echo "${out}" | tail -n1 | grep -q "^ERROR.*: checkout (Unable to parse service from '${in}'\\. You have either a bad URL, or an identifier that should be passed to get_URL\\.)$"; then
+ pass "${testing}"
+ else
+ fail "${testing}"
+ fi
+ fi
+done
+
+#confirm that checkout fails with bad repo - abe is so forgiving that I can only find one suitable input
+in="http://"
+testing="checkout: ${in} should fail with 'cannot parse repo' message."
+if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`"
+else
+ out="`cd ${local_snapshots} && checkout ${in} 2>&1`"
+fi
+if test $? -eq 0; then
+ fail "${testing}"
+else
+ if echo "${out}" | tail -n1 | grep -q "^ERROR.*: git_parser (Malformed input\\. No repo found\\.)$"; then
+ pass "${testing}"
+ else
+ fail "${testing}"
+ fi
+fi
+
test_checkout ()
{
local should="$1"
@@ -1531,6 +1583,18 @@ else
untested "${testing}"
fi
+testing="checkout: http://git@<url>/<repo>.git~<branch> should pass with appropriate notice"
+if test ! -e "${PWD}/host.conf"; then
+ package="abe.git"
+ branch='staging'
+ revision=""
+ should="pass"
+ expected="^NOTE: Checking out branch staging for abe in .\\+~staging$"
+ test_checkout "${should}" "${testing}" "${package}" "${branch}" "${revision}" "${expected}"
+else
+ untested "${testing}"
+fi
+
echo "============= misc tests ================"
testing="pipefail"
out="`false | tee /dev/null`"