|
1 | | -# Overview of llvm-obfuscator-arm |
| 1 | +# Overview of Swift Toolchains |
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/swift-nav/llvm-obfuscator-arm) |
4 | 4 |
|
5 | | -Obfuscating compiler for ARM using https://github.com/obfuscator-llvm/obfuscator. |
| 5 | +This collection of toolchains includes several things: |
6 | 6 |
|
7 | | -This is designed to be integrated with buildroot in order to provide an |
8 | | -obfuscating compiler for components that need it. |
| 7 | +- A build of LLVM 6 for ARM and x64 for use within Buildroot to run clang-tidy (and friends) |
| 8 | +- An abfuscating compiler for ARM using https://github.com/obfuscator-llvm/obfuscator |
| 9 | +- GCC arm-eabi-none toolchains for "bare metal" builds |
9 | 10 |
|
10 | | -# Example usage |
| 11 | +# Example usage of LLVM packages in Buildroot |
11 | 12 |
|
12 | | -To integrate with with buildroot, a package.mk will look like this (the `*_SOURCE` |
13 | | -var below is important, you'll need to interact with the GitHub API to find it |
14 | | -when upgrading to a new release): |
15 | | - |
16 | | -```make |
17 | | -HOST_LLVM_OBFUSCATOR_VERSION = v7 |
18 | | -HOST_LLVM_OBFUSCATOR_SOURCE = $(HOST_LLVM_OBFUSCATOR_VERSION)/llvm-obfuscator-arm-x86.txz |
19 | | -HOST_LLVM_OBFUSCATOR_SITE = https://github.com/swift-nav/llvm-obfuscator-arm/releases/download/ |
20 | | -HOST_LLVM_OBFUSCATOR_ACTUAL_SOURCE_TARBALL = llvm-obfuscator-$(HOST_LLVM_OBFUSCATOR_VERSION).tar.xz |
21 | | - |
22 | | -HOST_LLVM_OBFUSCATOR_DEPENDENCIES = host-xz |
23 | | - |
24 | | -define HOST_LLVM_OBFUSCATOR_PRE_EXTRACT_FIXUP |
25 | | - if ! [ -e $(DL_DIR)/$(HOST_LLVM_OBFUSCATOR_ACTUAL_SOURCE_TARBALL) ]; then \ |
26 | | - mv -v $(DL_DIR)/$(shell basename $(HOST_LLVM_OBFUSCATOR_SOURCE)) $(DL_DIR)/$(HOST_LLVM_OBFUSCATOR_ACTUAL_SOURCE_TARBALL); fi |
27 | | - $(eval HOST_LLVM_OBFUSCATOR_SOURCE=$(HOST_LLVM_OBFUSCATOR_ACTUAL_SOURCE_TARBALL)) |
28 | | -endef |
29 | | - |
30 | | -HOST_LLVM_OBFUSCATOR_PRE_EXTRACT_HOOKS += HOST_LLVM_OBFUSCATOR_PRE_EXTRACT_FIXUP |
31 | | - |
32 | | -define HOST_LLVM_OBFUSCATOR_INSTALL_CMDS |
33 | | - mkdir -p $(HOST_DIR)/opt/llvm-obfuscator |
34 | | - rsync -az $(@D)/opt/llvm-obfuscator/ $(HOST_DIR)/opt/llvm-obfuscator/ |
35 | | -endef |
36 | | - |
37 | | -LLVM_OBF_CC = $(HOST_DIR)/opt/llvm-obfuscator/wrappers/bin/arm-linux-gnueabihf-clang |
38 | | -LLVM_OBF_CXX = $(HOST_DIR)/opt/llvm-obfuscator/wrappers/bin/arm-linux-gnueabihf-clang++ |
39 | | - |
40 | | -$(eval $(host-generic-package)) |
41 | | -``` |
42 | | - |
43 | | -To upgrade to a new release of the compiler, use the GitHub API to find the |
44 | | -new artifact ID (uses [jq](https://stedolan.github.io/jq/)): |
45 | | - |
46 | | -```bash |
47 | | -> export GITHUB_TOKEN=... # your GitHub auth token |
48 | | -> curl -sSL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw" https://api.github.com/repos/swift-nav/llvm-obfuscator-arm/releases/latest | jq '.assets[0].id,.assets[0].name,.tag_name' |
49 | | - |
50 | | -5086675 |
51 | | -"llvm-obfuscator-arm.txz" |
52 | | -"v4" |
53 | | -``` |
| 13 | +To integrate with with Buildroot, see the examples in [piksi_buildroot](https://github.com/swift-nav/piksi_buildroot): |
| 14 | +- [llvm_obfuscator.mk](https://github.com/swift-nav/piksi_buildroot/blob/v2.2.0-release/package/llvm_obfuscator/llvm_obfuscator.mk) |
| 15 | +- [llvm_vanilla.mk](https://github.com/swift-nav/piksi_buildroot/blob/v2.2.0-release/package/llvm_vanilla/llvm_vanilla.mk) |
54 | 16 |
|
55 | 17 | # Copyright |
56 | 18 |
|
|
0 commit comments