All Projects → abyss7 → dist-clang

abyss7 / dist-clang

Licence: GPL-3.0 license
Distributed [cross-]compilation for Clang

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
assembly
5116 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
Pawn
127 projects

Projects that are alternatives of or similar to dist-clang

c-compiler-security
Security-related flags and options for C compilers
Stars: ✭ 125 (+303.23%)
Mutual labels:  clang
rebuild
Zero-dependency, reproducible build environments
Stars: ✭ 48 (+54.84%)
Mutual labels:  clang
opencilk-project
Monorepo for the OpenCilk compiler, forked from llvm/llvm-project. See the OpenCilk/infrastructure repository for build and installation instructions.
Stars: ✭ 42 (+35.48%)
Mutual labels:  clang
open-ops
Open Optimizing Parallelizing System
Stars: ✭ 21 (-32.26%)
Mutual labels:  clang
cpu-scheduling-simulator
⚙️Operating System CPU Scheduling Simulator😄
Stars: ✭ 20 (-35.48%)
Mutual labels:  clang
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+3.23%)
Mutual labels:  clang
systemc-compiler
This tool translates synthesizable SystemC code to synthesizable SystemVerilog.
Stars: ✭ 128 (+312.9%)
Mutual labels:  clang
stack-guard
A toy implementation of 'Stack Guard' on top of the LLVM compiler toolchain
Stars: ✭ 21 (-32.26%)
Mutual labels:  clang
CFI-LB
Adaptive Callsite-sensitive Control Flow Integrity - EuroS&P'19
Stars: ✭ 13 (-58.06%)
Mutual labels:  clang
cdetect
🔬 Detect which compiler and compiler version a Linux executable (in the ELF format) was compiled with
Stars: ✭ 23 (-25.81%)
Mutual labels:  clang
ccrawl
clang-based search engine for C/C++ data structures, classes, prototypes & macros
Stars: ✭ 82 (+164.52%)
Mutual labels:  clang
bootstrap
Bootstrap Go bindings for Clang's C API
Stars: ✭ 18 (-41.94%)
Mutual labels:  clang
proton-clang-build
A set of scripts to build optimized LLVM and binutils toolchains. See https://github.com/kdrag0n/proton-clang for prebuilts.
Stars: ✭ 30 (-3.23%)
Mutual labels:  clang
pranaOS
A unix operating system written from scratch in c that gives support for arm, x86
Stars: ✭ 138 (+345.16%)
Mutual labels:  clang
core-review
Scripts, tools & info for doing Bitcoin Core development and code review
Stars: ✭ 78 (+151.61%)
Mutual labels:  clang
SynapseOS
SynapseOS - модульная операционная система на языке C.
Stars: ✭ 93 (+200%)
Mutual labels:  clang
vscode-clang-complete
Visual Studio Code C/C++ completion using Clang
Stars: ✭ 15 (-51.61%)
Mutual labels:  clang
lsif-clang
Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
Stars: ✭ 28 (-9.68%)
Mutual labels:  clang
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+167.74%)
Mutual labels:  clang
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-25.81%)
Mutual labels:  clang

Build Status

DistClang is the Clang compiler extension with a client-server infrastructure. It features the distributed cross-platform compilation and the intermediate result caching.

The project consists of 2 executables and a couple of configuration files.

clang is a client part and should reside on the machine where the compilation is invoked. It should replace the invocation of the original compiler.

clangd is a server that has 2 different roles: emitter and absorber.

How to build

First of all do clone with an argument --recurse-submodules and then configure the project:

./build/configure

To build You have to use a recent Clang compiler with C++14 support.

For debugging and local usage

ninja -C out/Debug.gn All
cd out/Debug.gn
ln -s clang clang++

The resulting files clang, clang++ and clangd are located in the out/Debug.gn folder.

Linux DEB and RPM packages

ninja -C out/Release.gn rpm_package deb_package

The resulting packages are:

out/Release.gn/dist-clang_<version>_amd64.deb
out/Release.gn/rpmbuild/RPMS/x86_64/dist-clang-<version>-1.x86_64.rpm

Don't use locally the clang and clangd from the out/Release.gn folder since they are hardcoded to use libraries from /usr/lib/dist-clang folder.

Mac OS X package

ninja -C out/Release.gn pkg_package

The resulting package is out/Release.gn/dist-clang-<version>.pkg

How to configure the emitter

TODO!

How to configure the absorber

TODO!

How to run local compilation

The basics is to make use of dist-clang's clang and clang++ as the compilers. Doing

export CC=/usr/bin/dist-clang/clang CXX=/usr/bin/dist-clang/clang++

possibly should work almost always.

To work properly the dist-clang should know about the real compiler's path and compiler's version.

Use local config file

One way to provide information about a real compiler is to put config file somewhere on the path to the folder where the build is performed. File must be named .distclang and should contain something like this:

path: "third_party/llvm-build/Release+Asserts/bin/clang"
version: "clang version 3.7.0 (trunk 231690)"

Use environment variables

Another way - is to set some env. vars:

export DC_CLANG_PATH="/usr/bin/clang"
export DC_CLANG_VERSION="clang version 3.7.0 (trunk 231690)"

Rely on auto-detect

The last resort is to use dist-clang's auto-detect feature: it tries to find the next clang in the path, that differs from the current binary, i.e. /usr/bin/dist-clang/clang. It's a not recommended and error-prone way, since internally paths are compared as a raw strings - without link resolution, etc.

In any way, if the clang path is provided without version, then the version is carved out of the real clang's output.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].