| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 1 | llvm-efi |
| 2 | ======== |
| 3 | |
| Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame] | 4 | llvm-efi is a Bazel cc toolchain that uses the sandbox sysroot LLVM/clang with flags targeting freestanding EFI. |
| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 5 | EFI headers are not shipped as part of the toolchain, but are available as a cc_library from `@gnuefi//:gnuefi`. |
| 6 | |
| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 7 | Usage |
| 8 | ----- |
| 9 | |
| Leopold Schabel | 0ea448a | 2022-03-16 13:49:32 +0100 | [diff] [blame] | 10 | To use this toolchain explicitly while building a `cc_binary`, do: |
| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 11 | |
| Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame] | 12 | bazel build --platforms=//build/platforms:efi_amd64 //foo/bar |
| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 13 | |
| Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame] | 14 | During an actual build however, the right toolchain should be selected using transitions |
| 15 | or other configuration mechanisms. |
| Lorenz Brun | 605efbe | 2021-09-28 14:01:01 +0200 | [diff] [blame] | 16 | |
| 17 | fltused |
| 18 | ------- |
| 19 | |
| 20 | This is a special symbol emitted by MSVC-compatible compilers. In an EFI environment it can be ignored, but it needs to |
| 21 | be defined. See fltused.c for more information on the symbol. Since we cannot build an object file with Bazel and |
| 22 | building things for toolchains isn't a thing anyways, this file is prebuilt. If this ever needs to be rebuilt (which |
| 23 | will probably never happen since there is only one static symbol in there) this can be done with the following clang |
| 24 | invocation: |
| 25 | |
| 26 | clang -target x86_64-unknown-windows -fno-ms-compatibility -fno-ms-extensions -ffreestanding -o fltused.o .o -c fltused.c |
| 27 | |