Skip to content

Commit

Permalink
feat: add linux aarch64 llvm target (#988)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy authored Jan 15, 2024
1 parent 5fa77a8 commit a9e991a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kclvm/compiler/src/codegen/llvm/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ pub fn emit_code(
) -> Result<(), Box<dyn error::Error>> {
// Init LLVM targets
LLVM_INIT.get_or_init(|| {
// TODO: linux arm and WASM target.
// TODO: WASM target.
#[cfg(target_os = "linux")]
inkwell::targets::Target::initialize_x86(&Default::default());
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
inkwell::targets::Target::initialize_aarch64(&Default::default());
#[cfg(not(target_os = "linux"))]
inkwell::targets::Target::initialize_all(&Default::default());
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/kcl-builder-arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM arm64v8/ubuntu:20.04

RUN apt-get update

RUN apt-get install -y curl make gcc git zlib-dev zlib1g-dev
RUN apt-get install -y curl make gcc git zlib1g-dev

# rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/kcl-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN apt-get install -y clang-12 lld-12
RUN ln -sf /usr/bin/clang-12 /usr/bin/clang
RUN ln -sf /usr/bin/wasm-ld-12 /usr/bin/wasm-ld

# golang 1.19+
# golang 1.20+
RUN mkdir -p /root/download && cd /root/download \
&& wget https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz \
&& tar -zxvf go1.20.5.linux-amd64.tar.gz \
Expand Down

0 comments on commit a9e991a

Please sign in to comment.