Building compiler-rt using build_compiler_rt.sh fails in 564e2b9aa8e7a40da663d890c0e853a1259ff8b1.
I follow these steps in order:
Build clang
Build osxcross
Build compiler-rt
The problem manifests itself as follows:
Building clang extracts a tarball of sources via bsdtar into the build directory. This includes a directory called compiler-rt, which contains the compiler-rt source code.
When building compiler-rt via build_compiler_rt.sh, the build scripts try to create a build tree for compiler-rt in the build directory and clone the sources. Since the compiler-rt directory already exists, the build scripts fail when trying to perform git operations on the directory, which is not an actual git repository (git clean fails).
A solution is have build_compiler_rt.sh check if the build/compiler-rt directory is a build project, for example contains the build/compiler-rt/compiler-rt directory. The tarball just extracts compiler-rt source into build/compiler-rt, which is not a build project per the scripts. If build/compiler-rt is not a build project, we delete the directory and have the build scripts recreate the build project.
Building
compiler-rt
usingbuild_compiler_rt.sh
fails in564e2b9aa8e7a40da663d890c0e853a1259ff8b1
.I follow these steps in order:
The problem manifests itself as follows: Building clang extracts a tarball of sources via
bsdtar
into thebuild
directory. This includes a directory calledcompiler-rt
, which contains the compiler-rt source code.When building compiler-rt via
build_compiler_rt.sh
, the build scripts try to create a build tree for compiler-rt in thebuild
directory and clone the sources. Since the compiler-rt directory already exists, the build scripts fail when trying to perform git operations on the directory, which is not an actual git repository (git clean fails).A solution is have
build_compiler_rt.sh
check if thebuild/compiler-rt
directory is a build project, for example contains thebuild/compiler-rt/compiler-rt
directory. The tarball just extracts compiler-rt source intobuild/compiler-rt
, which is not a build project per the scripts. Ifbuild/compiler-rt
is not a build project, we delete the directory and have the build scripts recreate the build project.