Skip to content

Commit

Permalink
llvm 18.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Aug 23, 2024
1 parent 3fbef59 commit 5746d13
Show file tree
Hide file tree
Showing 13 changed files with 455 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Updating nph version should be accompanied with running the new
# version
run: |
VERSION="v0.5.1"
VERSION="v0.6.0"
ARCHIVE="nph-linux_x64.tar.gz"
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
tar -xzf ${ARCHIVE}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ifdef STATIC_LLVM
LLVM_DEP=ext/$(LLVM_DIR)/sta/bin/llvm-config
export PATH := $(PWD)/ext/$(LLVM_DIR)/sta/bin:$(PATH)
else
LLVM_DEP=ext/$(LLVM_DIR)/sha/lib/libLLVM-$(LLVM_MAJ).so
LLVM_DEP=ext/$(LLVM_DIR)/sha/lib/libLLVM.so.$(LLVM_MAJ).$(LLVM_MIN)
NLVMCFLAGS?=
endif

Expand Down Expand Up @@ -101,7 +101,7 @@ self: nlvm/nlvm.self
clean:
rm -rf $(NLVMC) $(NLVMR) nlvm/nlvm.ll nlvm/nlvm.self.ll nlvm/nlvm.self Nim/testresults/

ext/$(LLVM_DIR)/sha/lib/libLLVM-$(LLVM_MAJ).so:
ext/$(LLVM_DIR)/sha/lib/libLLVM.so.$(LLVM_MAJ).$(LLVM_MIN):
sh ./make-llvm.sh $(LLVM_MAJ) $(LLVM_MIN) $(LLVM_PAT) sha \
-DLLVM_BUILD_LLVM_DYLIB=1 \
-DLLVM_LINK_LLVM_DYLIB=1 \
Expand Down
2 changes: 1 addition & 1 deletion dl-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd ext
VER="$1.$2"
VER2="$VER.$3"
TGT="$4"
SUFFIX="x86_64-linux-gnu-ubuntu-22.04"
SUFFIX="x86_64-linux-gnu-ubuntu-18.04"
SUFFIX2=""

LLVM_ROOT=llvm-$VER2.src
Expand Down
17 changes: 10 additions & 7 deletions llvm/llvm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import std/[os, strformat, strutils]

const
LLVMVersion* = staticRead(currentSourcePath.parentDir & "/llvm.version")
LLVMMaj = parseInt(LLVMVersion.split('.')[0])
LLVMMin = parseInt(LLVMVersion.split('.')[1])
LLVMPat = parseInt(LLVMVersion.split('.')[2])
LLVMLib = fmt"libLLVM-{LLVMMaj}.so"
LLVMMaj* = parseInt(LLVMVersion.split('.')[0])
LLVMMin* = parseInt(LLVMVersion.split('.')[1])
LLVMPat* = parseInt(LLVMVersion.split('.')[2])
LLVMLib = "" #fmt"libLLVM-{LLVMMaj}.so"
LLVMRoot = fmt"../ext/llvm-{LLVMVersion}.src/"
LLDRoot = fmt"../ext/lld-{LLVMVersion}.src/"

Expand All @@ -27,11 +27,11 @@ when defined(staticLLVM):
else:
const LLVMOut = LLVMRoot & "sha/"

{.passL: fmt"-lLLVM-{LLVMMaj}".}
{.passL: fmt"-lLLVM.so".}
{.passL: "-Wl,'-rpath=$ORIGIN/" & LLVMOut & "lib/'".}

{.passC: "-I" & LLVMRoot & "include".}
{.passC: "-I" & LLVMOut & "include".}
{.passC: "-I" & LLVMRoot & "include".}

{.passC: "-I" & LLDRoot & "include".}

Expand All @@ -40,7 +40,7 @@ else:
{.passL: gorge(LLVMOut & "bin/llvm-config --ldflags").}
{.passL: gorge(LLVMOut & "bin/llvm-config --system-libs").}

{.compile("wrapper.cc", "-std=gnu++17").}
{.compile("wrapper.cc", gorge(LLVMOut & "bin/llvm-config --cxxflags")).}

# Includes and helpers for generated code
type OpaqueMemoryBuffer = object
Expand Down Expand Up @@ -104,6 +104,9 @@ type
OpaqueTargetData {.pure, final.} = object
OpaqueTargetLibraryInfotData {.pure, final.} = object

OpaqueOperandBundle {.pure, final.} = object
OpaqueTargetMachineOptions {.pure, final.} = object

Opcode* {.size: sizeof(cint).} = enum
Ret = 1
Br = 2
Expand Down
2 changes: 1 addition & 1 deletion llvm/llvm.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.0.6
18.1.8
Loading

0 comments on commit 5746d13

Please sign in to comment.