"compiler-rt" runtime libraries

The compiler-rt project consists of:

  • builtins - a simple library that provides an implementation of the low-level target-specific hooks required by code generation and other runtime components. For example, when compiling for a 32-bit target, converting a double to a 64-bit unsigned integer is compiling into a runtime call to the "__fixunsdfdi" function. The builtins library provides optimized implementations of this and other low-level routines, either in target-independent C form, or as a heavily-optimized assembly.

    builtins provides full support for the libgcc interfaces on supported targets and high performance hand tuned implementations of commonly used functions like __floatundidf in assembly that are dramatically faster than the libgcc implementations. It should be very easy to bring builtins to support a new target by adding the new routines needed by that target.

  • sanitizer runtimes - runtime libraries that are required to run the code with sanitizer instrumentation. This includes runtimes for:
  • profile - library which is used to collect coverage information.
  • BlocksRuntime - a target-independent implementation of Apple "Blocks" runtime interfaces.

 

All of the code in the compiler-rt project is dual licensed under the MIT license and the UIUC License (a BSD-like license).

Clients

Currently compiler-rt is primarily used by the Clang and LLVM projects as the implementation for the runtime compiler support libraries. For more information on using compiler-rt with Clang, please see the Clang Getting Started page.

Platform Support

builtins is known to work on the following platforms:

  • Machine Architectures: i386, X86-64, SPARC64, ARM, PowerPC, PowerPC 64.
  • OS: AuroraUX, DragonFlyBSD, FreeBSD, NetBSD, Linux, Darwin.

Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific pages in Clang docs for more details.

Source Structure

A short explanation of the directory structure of compiler-rt:

For testing it is possible to build a generic library and an optimized library. The optimized library is formed by overlaying the optimized versions onto the generic library. Of course, some architectures have additional functions, so the optimized library may have functions not found in the generic version.

  • include/ contains headers that can be included in user programs (for example, users may directly call certain function from sanitizer runtimes).
  • lib/ contains libraries implementations. 
  • lib/builtins is a generic portable implementation of builtins routines.
  • lib/builtins/(arch) has optimized versions of some routines for the supported architectures.
  • test/ contains test suites for compiler-rt runtimes.

Get it and get involved!

Generally, you need to build LLVM/Clang in order to build compiler-rt. You can either follow the Clang's Getting Started page, or build LLVM separately to get llvm-config binary, and then run:

  • svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
  • mkdir build
  • cd build
  • cmake ../compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config
  • make

Tests for sanitizer runtimes are ported to llvm-lit and are run by make check-all command in LLVM/Clang/compiler-rt build tree.

compiler-rt libraries are installed to the system with make install command in either LLVM/Clang/compiler-rt or standalone compiler-rt build tree.

compiler-rt doesn't have its own mailing list, if you have questions please email the llvm-dev mailing list. Commits to the compiler-rt SVN module are automatically sent to the llvm-commitsmailing list.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值