GithubHelp home page GithubHelp logo

vijaymalav564 / vortex-clang Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 3.5 GB

// clone this repo with --depth=1 to save disk size // toolchain compatible with Ubuntu 20.04+ //

Home Page: https://github.com/vijaymalav564/vortex-clang

Python 0.62% C++ 2.61% C 90.24% CMake 3.53% Shell 0.02% AppleScript 0.01% Emacs Lisp 0.10% CSS 0.05% XC 1.42% XS 1.40%
android linux clang llvm lto lld linux-kernel aarch64-linux-gnu arm-li arm-linux-gnueabi

vortex-clang's Introduction

Vortex Clang

Host compatibility

This toolchain is built on Ubuntu 21.10 , which uses glibc 2.34. Compatibility with older distributions cannot be guaranteed. Other libc implementations (such as musl) are not supported.

Building Linux

Make sure you have this toolchain in your PATH:

export PATH="$HOME/toolchains/vortex-clang/bin:$PATH"

For an AArch64 cross-compilation setup, you must set the following variables. Some of them can be environment variables, but some must be passed directly to make as a command-line argument. It is recommended to pass all of them as make arguments to avoid confusing errors:

  • CC=clang (must be passed directly to make)
  • CROSS_COMPILE=aarch64-linux-gnu-
  • If your kernel has a 32-bit vDSO: CROSS_COMPILE_ARM32=arm-linux-gnueabi-

Optionally, you can also choose to use as many LLVM tools as possible to reduce reliance on binutils. All of these must be passed directly to make:

  • AR=llvm-ar
  • NM=llvm-nm
  • OBJCOPY=llvm-objcopy
  • OBJDUMP=llvm-objdump
  • STRIP=llvm-strip

Note, however, that additional kernel patches may be required for these LLVM tools to work. It is also possible to replace the binutils linkers (lf.bfd and ld.gold) with lld and use Clang's integrated assembler for inline assembly in C code, but that will require many more kernel patches and it is currently impossible to use the integrated assembler for all assembly code in the kernel.

Android kernels older than 4.14 will require patches for compiling with any Clang toolchain to work; those patches are out of the scope of this project. See android-kernel-clang for more information.

Android kernels 4.19 and newer use the upstream variable CROSS_COMPILE_COMPAT. When building these kernels, replace CROSS_COMPILE_ARM32 in your commands and scripts with CROSS_COMPILE_COMPAT.

Differences from other toolchains

Vortex Clang has been designed to be easy-to-use compared to other toolchains, such as AOSP Clang. The differences are as follows:

  • CLANG_TRIPLE does not need to be set because we don't use AOSP binutils
  • LD_LIBRARY_PATH does not need to be set because we set library load paths in the toolchain
  • No separate GCC/binutils toolchains are necessary; all tools are bundled

Important Note

for using Full Clang LTO with this toolchain u need to cherry-pick this commit otherwise your kernel won't boot

vortex-clang's People

Contributors

kdrag0n avatar vijaymalav564 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shas45558

vortex-clang's Issues

Compile with clang-14 error

My clang-13 (proton kdrag0n compile fine)

   $
    root@LeCmnGend:~/test/gg# ~/tc/proton/clang-13/bin/clang --version
    Proton clang version 13.0.0 (https://github.com/llvm/llvm-project b4fd512c36ca344a3ff69350219e8b0a67e9472a)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /root/tc/proton/clang-13/bin

While my clang-14 show :

    $ error: unable to create target: 'No available targets are compatible with triple "x86_64-unknown-linux-gnu"'
    
    $
    root@LeCmnGend:~/test/gg# clang --version
    Vortex clang version 14.0.0 (https://github.com/llvm/llvm-project e581841e8cf46109acea92e1acb661c404fa62b9)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin

i think the link to **installedDir ** of my 14 not updated as the folder i place it, so it cause error,
hope you help me
my kernel: (i run b14.sh)

  $ https://github.com/LeCmnGend/kernel_xiaomi_ginkgo/tree/clang-14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.