Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ To build GNAT LLVM from sources, follow these steps:
the options that suit your needs. After installing/building, make sure the
LLVM bin directory containing `llvm-config` and `clang` is in your `PATH`.

Alternatively, you can invoke make with an environment variable named
`LLVM_CONFIG` pointing to your `llvm-config` binary, this way the LLVM you
intend to use does not need to be in your `PATH`.

make LLVM_CONFIG=/some/path/to/llvm-config

An alternative only suitable for core GNAT LLVM development on x86 native
configurations is to use the following command, assuming you have CMake
version >= 3.20 in your path:
Expand Down
13 changes: 4 additions & 9 deletions llvm-interface/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ ADAINCLUDE=lib/rts-llvm/adainclude
ADALIB=lib/rts-llvm/adalib

pwd:=$(shell pwd)

LLVM_BUILD_DIR=$(pwd)/../llvm/llvm-obj

ifneq ($(wildcard $(LLVM_BUILD_DIR)/bin/llvm-config),)
LLVM_CONFIG=$(LLVM_BUILD_DIR)/bin/llvm-config
LLVM_SRC=$(shell cd `$(LLVM_CONFIG) --includedir`/../..;pwd)
CLANG_CXXFLAGS=-I$(LLVM_BUILD_DIR)/tools/clang/include -I$(LLVM_SRC)/clang/include
ifeq ($(LLVM_CONFIG),)
LLVM_CONFIG:=llvm-config
else
LLVM_CONFIG=llvm-config
CLANG_CXXFLAGS=
LLVM_CONFIG:=$(LLVM_CONFIG)
endif
CLANG_CXXFLAGS=-I$(shell `$(LLVM_CONFIG) --includedir`)/clang

LDFLAGS=$(shell $(LLVM_CONFIG) --libs all --ldflags --system-libs)
CXXFLAGS=
Expand Down
4 changes: 2 additions & 2 deletions llvm-interface/check_for_LLVM_aliasing_bug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ declare i32 @report__ident_int(i32)
!24 = !{!10, !13, i64 4, i64 4}

EOF
opt -O2 obj/c43204h.ll -o obj/c43204h_o.bc
llvm-dis obj/c43204h_o.bc
$("$LLVM_CONFIG" --bindir)/opt -O2 obj/c43204h.ll -o obj/c43204h_o.bc
$("$LLVM_CONFIG" --bindir)/llvm-dis obj/c43204h_o.bc
if [ "`wc -l obj/c43204h_o.ll | awk '{print $1}'` " -gt "40" ]; then
BUG=False
echo "OK: using LLVM without the aliasing bug"
Expand Down