-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM 11 rebase #5
Open
arunthomas
wants to merge
14
commits into
upstream-llvm11-snapshot
Choose a base branch
from
pr-lld-compiler-rt
base: upstream-llvm11-snapshot
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fa144fe
'upstreamable' (ie generic, non-ssith-specific) changes required to s…
sbrookes 3b15a1b
SSITH/HOPE (also called ISP) tagging support
sbrookes ef074a7
clean a mistake
sbrookes f92873b
Build stuff
amstrnad 6a07609
Add some dependencies
amstrnad a4db079
Reorder to avoid a bad dereference
amstrnad 4d8e9c6
Change to a misleadingly similar function
amstrnad a26b8c1
Revert "Change to a misleadingly similar function"
amstrnad 2bbe334
Flags was still a uint16 in a couple places
amstrnad 87614ce
Gitignore: Ignore build directories
Jesse-Millwood 5440716
SSITH: Fixed compiler errors
Jesse-Millwood 34aa20c
SSITH: Updated Makefile
Jesse-Millwood 6abcb7c
Support -fuse-ld=lld for riscv
e3f2df6
Use lld and compiler-rt
arunthomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.PHONY: all | ||
.PHONY: debug | ||
.PHONY: release | ||
.PHONY: install | ||
.PHONY: clean | ||
|
||
export ISP_PREFIX ?= $(HOME)/.local/isp/ | ||
|
||
ifeq "$(shell isp-support/check_ninja_version)" "System ninja is new enough" | ||
NINJA := ninja | ||
else | ||
NINJA := $(HOME)/.local/bin/ninja | ||
endif | ||
|
||
BUILD_TYPE ?= debug | ||
|
||
COMMON_CMAKE_FLAGS += -G "Ninja" | ||
COMMON_CMAKE_FLAGS += -DLLVM_ENABLE_PROJECTS="clang" | ||
COMMON_CMAKE_FLAGS += -DCMAKE_MAKE_PROGRAM=$(NINJA) | ||
COMMON_CMAKE_FLAGS += -DCMAKE_INSTALL_PREFIX=$(ISP_PREFIX) | ||
COMMON_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang | ||
COMMON_CMAKE_FLAGS += -DCMAKE_CXX_COMPILER=clang++ | ||
COMMON_CMAKE_FLAGS += -DLLVM_BINUTILS_INCDIR=/usr/include | ||
COMMON_CMAKE_FLAGS += -DBUILD_SHARED_LIBS=True | ||
COMMON_CMAKE_FLAGS += -DLLVM_OPTIMIZED_TABLEGEN=True | ||
COMMON_CMAKE_FLAGS += -DLLVM_BUILD_TESTS=True | ||
COMMON_CMAKE_FLAGS += -DDEFAULT_SYSROOT=$(ISP_PREFIX)/riscv64-unknown-elf | ||
COMMON_CMAKE_FLAGS += -DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-elf" | ||
COMMON_CMAKE_FLAGS += -DLLVM_TARGETS_TO_BUILD="RISCV" | ||
|
||
DEBUG_CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=Debug | ||
DEBUG_CMAKE_FLAGS += -DLLVM_ENABLE_ASSERTIONS=ON | ||
DEBUG_CMAKE_FLAGS += -DCMAKE_C_FLAGS=-fstandalone-debug | ||
DEBUG_CMAKE_FLAGS += -DCMAKE_CXX_FLAGS=-fstandalone-debug | ||
|
||
RELEASE_CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=Release | ||
|
||
debug-build/build.ninja: CMAKE_FLAGS := $(COMMON_CMAKE_FLAGS) $(DEBUG_CMAKE_FLAGS) | ||
|
||
release-build/build.ninja: CMAKE_FLAGS := $(COMMON_CMAKE_FLAGS) $(RELEASE_CMAKE_FLAGS) | ||
|
||
all: $(BUILD_TYPE) | ||
|
||
$(BUILD_TYPE): $(BUILD_TYPE)-build/build.ninja | ||
$(NINJA) -C $(BUILD_TYPE)-build | ||
|
||
$(BUILD_TYPE)-build/build.ninja: | ||
$(RM) -r $(BUILD_TYPE)-build | ||
mkdir -p $(BUILD_TYPE)-build | ||
cd $(BUILD_TYPE)-build; cmake $(CMAKE_FLAGS) ../llvm | ||
|
||
install: $(BUILD_TYPE)-install | ||
|
||
debug-install release-install: %-install: $* | ||
$(NINJA) -C $*-build install | ||
|
||
clean: | ||
$(RM) -r debug-build | ||
$(RM) -r release-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Best results obtained by using the gold linker. Your ld is likely a symlink, | ||
point it at ld.gold | ||
|
||
Be sure to clone recursively | ||
|
||
To build the llvm riscv cross compiler first make sure that you have a riscv | ||
toolchain installed. I worked with the instructions here for a clean riscv | ||
toolchain: | ||
|
||
https://github.com/lowRISC/riscv-llvm | ||
|
||
Then run the configure script. I *strongly* recommend you let it install the | ||
same version of cmake and ninja that I was using (the latest release as of May | ||
22, 2018). It will also ask you for the base path to the riscv toolchain. This | ||
will enable the cross compiler to actually work, and is where the cross compiler | ||
will get installed. | ||
|
||
./configure.sh | ||
|
||
After that, you can build either the debug or release version. I have been | ||
working with the debug version during development, and strongly recommend it. | ||
The release version is currently *untested* and *unsupported*. | ||
|
||
cd debug-build | ||
ninja | ||
ninja install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
version=`ninja --version`; | ||
check="1.8.2"; | ||
winner=`echo -e "${version}\n${check}" | sort -nr | head -1`; | ||
if [[ "${winner}" = "${version}" ]]; then | ||
echo "System ninja is new enough" | ||
exit 0 | ||
else | ||
echo "System ninja is too old" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
apt-get update | ||
|
||
apt-get install -y \ | ||
binutils-dev \ | ||
build-essential \ | ||
clang \ | ||
cmake \ | ||
unzip \ | ||
wget \ | ||
zlib1g-dev | ||
|
||
ninja_check() { | ||
md5sum --quiet -c <<< "540b5a37ac9d822b07179ec1771855ae $HOME/.local/bin/ninja" | ||
} | ||
|
||
if [ -f $HOME/.local/bin/ninja ]; then | ||
ninja_check | ||
else | ||
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip | ||
unzip -o ninja-linux.zip | ||
mkdir -p $HOME/.local/bin | ||
mv ninja $HOME/.local/bin | ||
rm ninja-linux.zip | ||
ninja_check | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
set(LLVM_TARGET_DEFINITIONS Attributes.td) | ||
tablegen(LLVM Attributes.inc -gen-attrs) | ||
add_public_tablegen_target(attributes_gen) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Squashed? |
||
|
||
set(LLVM_TARGET_DEFINITIONS Intrinsics.td) | ||
tablegen(LLVM IntrinsicImpl.inc -gen-intrinsic-impl) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these changes be squashed into a previous commit?