Giter Club home page Giter Club logo

Comments (6)

nathanchance avatar nathanchance commented on June 30, 2024

clang is multi-targeted by default unlike GCC, so it builds code for both the host and cross architectures through the --target flag.

from tc-build.

wctrl avatar wctrl commented on June 30, 2024

Yes, but Linux cross-compile cmdline looks like make -j8 O=out ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- CC=clang READELF=llvm-readelf OBJCOPY=llvm-objcopy AS=llvm-as LD=ld.lld NM=llvm-nm OBJDUMP=llvm-objdump STRIP=llvm-strip CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 without CROSS_COMPILE it won't build vDSO. Is aarch64-linux-gnu-* thing called binutils?

from tc-build.

nathanchance avatar nathanchance commented on June 30, 2024

Is aarch64-linux-gnu-* thing called binutils?

Yes.

CROSS_COMPILE has two meanings depending on the age of the kernel tree. It is used to prefix as, gcc, ld, etc but it is also used as the value for --target prior to commit ddc72c9659b5 ("kbuild: clang: do not use CROSS_COMPILE for target triple") (same with CROSS_COMPILE_ARM32 but for the 32-bit vDSO). Since you have specified all the make variables that would have been prefixed with CROSS_COMPILE, you would think that you could drop it, but it is still being used for --target. You don't need the aarch64-linux-gnu- tools as a result.

Two additional comments about your build command:

  1. LLVM=1 is the same thing as AR=llvm-ar CC=clang LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf STRIP=llvm-strip, you don't need to specify both.
  2. AS=llvm-as is incorrect, as $(AS) does not exist after commit aa824e0c962b ("kbuild: remove AS variable") and even if it did, llvm-as is the LLVM IR to bitcode assembler. You are looking for LLVM_IAS=1 if you want to use the integrated assembler.

from tc-build.

wctrl avatar wctrl commented on June 30, 2024

I see, should I use build-binutils.py for that? Or there's another way for binutils?

CROSS_COMPILE has two meanings depending on the age of the kernel tree.

Kernel is really old (4.14), due vendor issues it won't be bumped to at least 4.19

You don't need the aarch64-linux-gnu- tools as a result.

Without that it probably uses x86 clang (message about broken assembly or smth)

Two additional comments about your build command

Thanks!

from tc-build.

nathanchance avatar nathanchance commented on June 30, 2024

Yes, that is why build-binutils.py exists, you can get the aarch64-linux-gnu tools via build-binutils.py -t aarch64 (see -h for more options if you need them).

from tc-build.

wctrl avatar wctrl commented on June 30, 2024

Thanks! For someone who will find that: I prefixed them with ./build-binutils.py -i target_dir -t aarch64 and binutils will be in target_dir/bin/

from tc-build.

Related Issues (20)

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.