Skip to content

Preparing for the Monorepo Transition

Ray Chen edited this page Oct 11, 2019 · 1 revision

Introduction

The LLVM project is currently undergoing a major transition to GitHub. Part of this move is switching from submodules (LLVM, Clang, etc.) to a single upstream repository (monorepo). Further details and rationales are documented here: http://llvm.org/docs/Proposals/GitHubMove.html

The purpose of this wiki page is to help you prepare a checked-c-convert development environment using the monorepo scheme. Please note that these instructions are still in flux, as our upstream fork has not yet fully transitioned to the monorepo. When they do, this caveat will be removed.

For now, branches that use the monorepo scheme will be based off of https://github.com/plum-umd/checkedc-clang/tree/monorepo


Building the Monorepo

Here are instructions for cloning a fresh local repository for checked-c-convert tool development.

git clone https://github.com/plum-umd/checkedc-clang.git llvm
cd llvm
git checkout monorepo
mkdir ../obj-llvm
cd ../obj-llvm
cmake ../llvm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS=clang
make checked-c-convert

You should now have a working checked-c-convert binary in ./obj-llvm/bin

Notes for this setup:

  1. The CMake flags -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 reduce building unnecessary parts of the underlying compiler.
  2. To enable debugging symbols for checked-c-convert, add the following lines to llvm/clang/tools/checked-c-convert/CMakeLists.txt:
    SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -g -O0")
    SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -g -O0")
    

Current state of branches

Monorepo-based Branches

  • monorepo
  • WIP/ArrayBoundsHeuristics
  • dev-explicit-cast
  • dev-fixes-iterative-itype
  • dev-fixes-iterative-itype-array-inf
  • safe-blocks

Legacy Branches

  • master
  • dev
  • oldrepo/WIP/ArrayBoundsHeuristics
  • oldrepo/dev-explicit-cast
  • oldrepo/dev-fixes-iterative-itype
  • oldrepo/dev-fixes-iterative-itype-array-inf
  • oldrepo/safe-blocks