|Age||Commit message (Collapse)||Author|
The new Python version dropped support for tools-extra but if you
want to use the old scripts (because of conflicts with Python
imports), the extra repo gets in the way.
Not urgent, but worth a change.
This will save space on the main repository, where no one really needs
the files checked out anyway.
gcc driver choices"
This reverts commit 0360ac24913f7654623d3a0b441f625afdbbd9f7.
We're using Clang 3.8.0 on our test boards, and that version still
didn't have "armv7e". "It worked on my machine" and it took me half a
year to reaslise it didn't on the machines. Sigh.
This is kind of a no-brainer and we should've done it long ago. Release builds
are reasonably clean with clang.
To investigate buildbot failures we rely on the ARM boards we have in the rack.
But those boards take ~1h to build LLVM+Clang which does limit a lot on how
fast we can test and act. To make that task easier, we decided to have a nightly
build on the boards, for ARM and Thumb in debug mode, so we can start from a
built tree, or at least a partially built tree if we need a more recent ToT.
This script was made to work around crontab deficiencies and has been tested on
my chromebook at home. It also makes sure it doesn't build if the script is
already running or if the machine is busy or recuperating from a long build, as
this may mean there's a bisection going on.
The stress, helper and bisect build scripts needed the LLVM_LINK_JOBS option
to make sure it doesn't run out of memory while linking, especially in SoCs
that have a lot more cores than RAM (ex. HiKey).
This patch calculates the jobs by seeing how much RAM the target has and adding
+1, as link jobs rarely take more than 1GB, but the final ones do use several
hundred. Also making sure we don't exceed the number of cores.
A few other small changes:
* Replace "else if" by "elif"
* Build only minimal targets on ARM (even o full build)
* Fixed a -j$PARALLEL bug introduced by a prvious commit
* Converted a few backticks into $()
This is achieved by setting the CMake option LLVM_LIT_ARGS. If we don't do this,
lit may decide that it only needs to run on one core.
While we're at it, also update the run.sh that we use for bisects to force ninja
to use the right number of cores while building.
In addition to debug builds, this teaches llvm-env to create self-hosted
bots that will use the "build" directory of the branch to compile a self-hosted
version of the toolchain. It'll use clang and also lld, if available.
* Check for clang, not just build dir
* Use -x instead of -f
* Always export LLVM_SELFHOST
* Quote strings for good measure
* Using LLVM_CMAKE_FLAGS
Allow the user to override the number of CPUs used for building LLVM. The
default remains unchanged, so if you're not going to use the -j flag it won't
The install directory will be <Worktree>/install, right next to the build and
source dirs, and it will be exported in LLVM_INSTALL.
Note that this won't affect existing worktree directories, you should either
nuke the build directories or manually update CMakeCache.txt for them.
Forgot to add a patch set before merging (I don't know how I didn't notice
Errata for Change-Id: I787594ce1ecea0de68ceb0e518194b783da408b3
When running llvm-env without any arguments, it now dumps the current worktrees,
as well as the branch that is currently checked out in them (only for llvm, to
make it easy to spot places where this is different from the environment name).
This is a very hacky implementation, because newer versions of git will come
with git worktree list, which does exactly what we want. We can nuke this when
we're all ready to move to newer gits.
This is necessary in order to allow people outside TCWG to use our scripts
This should allow us to run make/ninja on a given target, e.g.
`llvm-build llc` will build only the llc target
`llvm-build check-llvm-codegen-aarch64` will only run a subset of the tests
This also adds a -h option.
This commit adds a new script, llvm-env, which sets up the environment for
working with LLVM. It looks for an environment variable LLVM_ROOT and tries to
create the following hierarchy:
| `- llvm
| `- clang
| `- compiler-rt
| `- llvm
| `- build
| `- debug
| `- llvm
| `- build
| `- debug
The $LLVM_ROOT/repos directory contains all the repositories, as checked out by
llvm-prepare, and will always track master. For other branches,
llvm-env <branch_name> will create a new directory, $LLVM_ROOT/<branch_name>,
and will add an llvm worktree directory there. If -d is passed, it will also
create a debug directory there, otherwise it will create a build directory.
Notice that these 2 can live in parallel, and we can switch between them at any
time by invoking llvm-env. It will set LLVM_SRC and LLVM_BLD accordingly, and
also modify the path to point to the binaries in LLVM_BLD.
The other scripts will now work with the LLVM_SRC and LLVM_BLD set by llvm-env
in the current shell. Because llvm-env controls whether or not we're doing a
debug build, llvm-build will no longer take a -d flag (it will instead look
after a LLVM_DEBUG environment variable, also set by llvm-env). There are
changes in llvm-projs, too, because now it no longer creates links - instead it
creates worktree directories in the corresponding $LLVM_ROOT/<branch>/llvm.
Other scripts have also been updated accordingly.
To make things easier, here are some of the changes that I had to make that are
not particularly important for the review (pretty mechanical stuff):
* Moved function has() from llvm-branch to llvm-common, so I could reuse it
* Because of this, I had to rename the has() function in llvm-projs to
has_link(), which is actually a better name for it anyway
* Disable the checks for LLVM_SRC and LLVM_BLD in llvm-common
YouCompleteMe helper, updates the YCM config file once YCM-Generator
creates one for you. The steps are:
* Install YCM / Generator
* Inside Vim, on $LLVM_SRC, run :YcmGenerateConfig
* Outside vim, with llvm-env on the same workdir run: llvm-ycm
* Re-start vim, all is good
Why is this needed?
1. YCM relies on .ycm_extra_conf.py to be precise and correct
2. LLVM includes headers and libraries from both source and build dirs
3. YCM-Generator has no idea about the build dir, so it uses /tmp
* You will need to do this for each workdir, as the path has to be absolute
* Don't use CMake's compilation_database.json, or header files won't work
llvm-projs and llvm-sync used to have very inconsistent interfaces. This commit
updates the interfaces so that llvm-sync only synchronizes the repos that are
linked into the tree by llvm-projs (this makes it consistent with llvm-branch
and other scripts) and also revamps the interface provided by llvm-projs to
allow some long options for projects that are frequently used together as well
as short options for fine tuning whether or not to link each project.
Due to a typo, llvm-build would fail to create the build directory if it didn't
exist (and subsequently failed to cd to it and started building in the wrong
place). This fixes the typo, and also runs the mkdir with safe_run, so we can
bail out if something goes wrong.
Fix some typos in the READMEs.
Nit #1: Use full path when cloning repo
If we use the basename, we're forced to run the script from the directory where
we want the whole thing to live. By using the full path, we can run the script
Nit #2: Use more general name for variable (generator vs ninja)
Nit #3 (noticed by Renato): Set generator explicitly in llvm-build
When ninja is not found, we use make for the build. However, we don't tell
cmake about it and instead let it choose its own default generator. This commit
explicitly sets the cmake generator to "Unix Makefiles", in case cmake's default
generator for the current platform is not make.
In order to get this to work, it was necessary to make some changes to the
safe_run helper function, so we wouldn't lose the quotes around "Unix
It's a good idea to keep the knowledge about links in as few places as possible,
and we already have a script that deals with links in particular: llvm-projs.
With this change, building llvm after running llvm-prepare will by default build
only llvm (without clang, compiler-rt etc). In order to build other projects as
well, it will be necessary to run llvm-projs with the corresponding args.
This commit also contains a nit: extracting the repo paths into variables
(gitroot and svnroot).
Report an error if trying to sync a repo that does not exist
The scripts aren't very consistent about which repos they handle (e.g.
clang-tools-extra was handled in llvm-prepare, but not in the other scripts).
This commit tries to improve on that by:
* adding support for clang-tools-extra in llvm-projs, llvm-sync and llvm-branch
* adding support for lld and lldb to llvm-branch.