diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2017-09-29 15:54:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 15:54:48 -0700 |
commit | 32c46737c396afa05ab748fbcc243de7512c11ec (patch) | |
tree | ea713daf70154ccd08c57f6eec74278cb7aaf7f5 /Documentation | |
parent | 1ed2739e1a9c6f621f800ba0ffd3a28797149a1b (diff) | |
download | coreclr-32c46737c396afa05ab748fbcc243de7512c11ec.tar.gz coreclr-32c46737c396afa05ab748fbcc243de7512c11ec.tar.bz2 coreclr-32c46737c396afa05ab748fbcc243de7512c11ec.zip |
Update build clang/llvm/lldb 3.9 (#14096)
Update build scripts, docs and build pipeline docker images to clang/llvm/lldb 3.9
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/building/buildinglldb.md | 8 | ||||
-rw-r--r-- | Documentation/building/linux-instructions.md | 88 |
2 files changed, 20 insertions, 76 deletions
diff --git a/Documentation/building/buildinglldb.md b/Documentation/building/buildinglldb.md index 053c64f924..5c4b775c17 100644 --- a/Documentation/building/buildinglldb.md +++ b/Documentation/building/buildinglldb.md @@ -19,15 +19,15 @@ Building LLDB git clone http://llvm.org/git/lldb.git ``` -2. Checkout the "release_38" branches in llvm/clang/lldb: +2. Checkout the "release_39" branches in llvm/clang/lldb: ``` cd $HOME/llvm - git checkout release_38 + git checkout release_39 cd $HOME/llvm/tools/clang - git checkout release_38 + git checkout release_39 cd $HOME/llvm/tools/lldb - git checkout release_38 + git checkout release_39 ``` 3. Install the prerequisites: diff --git a/Documentation/building/linux-instructions.md b/Documentation/building/linux-instructions.md index 71ca8797e3..be70efbcf1 100644 --- a/Documentation/building/linux-instructions.md +++ b/Documentation/building/linux-instructions.md @@ -18,10 +18,10 @@ Toolchain Setup Install the following packages for the toolchain: - cmake -- llvm-3.5 (llvm-3.9 for ARM cross build) -- clang-3.5 (clang-3.9 for ARM cross build) -- lldb-3.6 -- lldb-3.6-dev +- llvm-3.9 +- clang-3.9 +- lldb-3.9 +- liblldb-3.9-dev - libunwind8 - libunwind8-dev - gettext @@ -33,33 +33,28 @@ Install the following packages for the toolchain: - libkrb5-dev - libnuma-dev (optional, enables numa support) -In order to get lldb-3.6 on Ubuntu 14.04, we need to add an additional package source: +In order to get clang-3.9, llvm-3.9 and lldb-3.9 on Ubuntu 14.04, we need to add an additional package source: -``` -ellismg@linux:~$ echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | sudo tee /etc/apt/sources.list.d/llvm.list -ellismg@linux:~$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - -ellismg@linux:~$ sudo apt-get update -``` - -If you are going to cross build for ARM, you need llvm-3.9 and clang-3.9 and please add below package source instead for Ubuntu 14.04. -``` -hqueue@linux:~$ echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee /etc/apt/sources.list.d/llvm.list -hqueue@linux:~$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - -hqueue@linux:~$ sudo apt-get update -``` + ~$ echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee /etc/apt/sources.list.d/llvm.list + ~$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - + ~$ sudo apt-get update + For other version of Debian/Ubuntu, please visit http://apt.llvm.org/. Then install the packages you need: -``` -ellismg@linux:~$ sudo apt-get install cmake llvm-3.5 clang-3.5 lldb-3.6 lldb-3.6-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev libnuma-dev libkrb5-dev -``` + ~$ sudo apt-get install cmake llvm-3.9 clang-3.9 lldb-3.9 liblldb-3.9-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev libnuma-dev libkrb5-dev + +The lldb 3.9 package needs a lib file symbolic link fixed: + + cd /usr/lib/llvm-3.9/lib + sudo ln -s ../../x86_64-linux-gnu/liblldb-3.9.so.1 liblldb-3.9.so.1 You now have all the required components. If you are using Fedora, then you will need to install the following packages: -`$ sudo dnf install llvm cmake clang lldb-devel libunwind-devel lttng-ust-devel libuuid-devel libicu-devel numactl-devel` + ~$ sudo dnf install llvm cmake clang lldb-devel libunwind-devel lttng-ust-devel libuuid-devel libicu-devel numactl-devel Git Setup --------- @@ -127,57 +122,6 @@ index 1ed3dbf..c643032 100644 } ``` -How to enable -O3 optimization level for ARM/Linux -================================================== - -If you are using clang-3.9, -O3 optimization is enabled as default and you can skip this section. -If you are using older version of clang, please follow instructions in this section to enable -O3 optimization. -Currently, we can build coreclr with -O1 flag of clang in release build mode for Linux/ARM without any bugfix of llvm-3.6. This instruction is to enable -O3 optimization level of clang on Linux/ARM by fixing the bug of llvm. - -First, download latest version from the clang-3.6/llvm-3.6 upstream: -``` -lgs@ubuntu cd /work/dotnet/ -lgs@ubuntu wget http://llvm.org/releases/3.6.2/llvm-3.6.2.src.tar.xz -lgs@ubuntu tar xJf llvm-3.6.2.src.tar.xz -lgs@ubuntu cd ./llvm-3.6.2.src/tools/ -lgs@ubuntu wget http://llvm.org/releases/3.6.2/cfe-3.6.2.src.tar.xz -lgs@ubuntu tar xJf cfe-3.6.2.src.tar.xz -lgs@ubuntu mv cfe-3.6.2.src clang -``` - -Second, expand the coverage of the upstream patch by: -https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1584089 - -Third, build clang-3.6/llvm-3.6 source as following: -``` -lgs@ubuntu cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="all" -DCMAKE_INSTALL_PREFIX=~/llvm-3.6.2 \ --DLLVM_BUILD_LLVM_DYLIB=1 -DLLDB_DISABLE_LIBEDIT=1 -DLLDB_DISABLE_CURSES=1 -DLLDB_DISABLE_PYTHON=1 \ --DLLVM_ENABLE_DOXYGEN=0 -DLLVM_ENABLE_TERMINFO=0 -DLLVM_INCLUDE_EXAMPLES=0 -DLLVM_BUILD_RUNTIME=0 \ --DLLVM_INCLUDE_TESTS=0 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 /work/dotnet/llvm-3.6.2.src -lgs@ubuntu -lgs@ubuntu sudo ln -sf /usr/bin/ld /usr/bin/ld.gold -lgs@ubuntu time make -j8 -lgs@ubuntu time make -j8 install -lgs@ubuntu -lgs@ubuntu sudo apt-get remove clang-3.6 llvm-3.6 -lgs@ubuntu vi ~/.bashrc (or /etc/profile) -# Setting new clang/llvm version -export PATH=$HOME/llvm-3.6.2/bin/:$PATH -export LD_LIBRARY_PATH=$HOME/llvm-3.6.2/lib:$LD_LIBRARY_PATH -``` - -For Ubuntu 14.04 X64 users, they can easily install the fixed clang/llvm3.6 package with "apt-get" command from the "ppa:leemgs/dotnet" Ubuntu repository, without the need to execute the above 1st, 2nd, and 3rd step. -``` -lgs@ubuntu sudo add-apt-repository ppa:leemgs/dotnet -lgs@ubuntu sudo apt-get update -lgs@ubuntu sudo apt-get install clang-3.6 llvm-3.6 lldb-3.6 -``` - -Finally, let's build coreclr with updated clang/llvm. If you meet a lldb related error message at build-time, try to build coreclr with "skipgenerateversion" option. -``` -lgs@ubuntu time ROOTFS_DIR=/work/dotnet/rootfs-coreclr/arm ./build.sh arm release clean cross -``` - Additional optimization levels for ARM/Linux: -Oz and -Ofast ============================================================ |