Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
1ebd92ce
Commit
1ebd92ce
authored
Feb 19, 2021
by
satmandu
Committed by
GitHub
Feb 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
llvm -> 11.1.0 Final (#5170)
parent
5e451f42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
50 deletions
+46
-50
packages/llvm.rb
packages/llvm.rb
+46
-50
No files found.
packages/llvm.rb
View file @
1ebd92ce
...
...
@@ -3,47 +3,41 @@ require 'package'
class
Llvm
<
Package
description
'The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. The optional packages clang, lld, lldb, polly, compiler-rt, libcxx, libcxxabi, and openmp are included.'
homepage
'http://llvm.org/'
@_ver
=
'11.1.0
-rc1
'
@_ver
=
'11.1.0'
version
@_ver
compatibility
'all'
source_url
"https://github.com/llvm/llvm-project/archive/llvmorg-
#{
@_ver
}
.tar.gz"
source_sha256
'
e610297041129a5c5b24355a988c99c7452ee7105ee2355334a8c521b988eb3c
'
source_sha256
'
53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79
'
binary_url
({
aarch64:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0-rc1
-chromeos-armv7l.tar.xz'
,
armv7l:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0-rc1
-chromeos-armv7l.tar.xz'
,
i686:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0-rc1
-chromeos-i686.tar.xz'
,
x86_64:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0-rc1-chromeos-x86_64.tar.xz'
,
binary_url
({
aarch64:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0
-chromeos-armv7l.tar.xz'
,
armv7l:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0
-chromeos-armv7l.tar.xz'
,
i686:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0
-chromeos-i686.tar.xz'
,
x86_64:
'https://dl.bintray.com/chromebrew/chromebrew/llvm-11.1.0-chromeos-x86_64.tar.xz'
})
binary_sha256
({
aarch64:
'5ecb72e60483b15c7588446a7ac424d64cdd3f21ca0fa5ffea4737a25dedca89
'
,
armv7l:
'5ecb72e60483b15c7588446a7ac424d64cdd3f21ca0fa5ffea4737a25dedca89
'
,
i686:
'5595ca097aa454bd54b8a336d467ee266f8afd4bd8100d1a3831e3face9b4f43
'
,
x86_64:
'031f6f3510ebbc5a1270fac07934d7efa9126c8e89f98695505b1376d6d233a5'
,
binary_sha256
({
aarch64:
'ba0520a8d5bfa90efb3eb13a530c8d4052f9e7572aa30dd42dfc624b88a0251e
'
,
armv7l:
'ba0520a8d5bfa90efb3eb13a530c8d4052f9e7572aa30dd42dfc624b88a0251e
'
,
i686:
'3a514f96c846d777c838fef6c585d2278abf2a586bfaeacfd3e2bccc9ffce838
'
,
x86_64:
'5b9e01c2411ea174293fc1d33b2dbf91f7001eb3cc3eda2e849b80f6f0dcb3c8'
})
# llvm_stage1 is compiled with gcc, without -flto
# Then in stage 2 (llvm.rb) everything is compiled with clang built in stage 1, with -flto=thin
# FYI LLVM 11.1.0 is a tiny rebuild of 11.0.1 fixing ABI compatibility with LLVM 10.0.0 & LLVM 12
depends_on
'ocaml'
=>
:build
depends_on
'libedit'
depends_on
'libtirpc'
depends_on
'swig'
depends_on
'pygments'
=>
:build
depends_on
'ccache'
=>
:build
depends_on
'llvm_stage1'
=>
:build
depends_on
'binutils'
=>
:build
# depends_on 'llvm_stage1' => :build # Not needed with a functional
# prior llvm 11 build.
case
ARCH
when
'aarch64'
,
'armv7l'
#LLVM_TARGETS_TO_BUILD = 'ARM;AArch64;AMDGPU'
LLVM_TARGETS_TO_BUILD
=
'all'
when
'aarch64'
,
'armv7l'
#
LLVM_TARGETS_TO_BUILD = 'ARM;AArch64;AMDGPU'
LLVM_TARGETS_TO_BUILD
=
'all'
.
freeze
@ARCH_C_FLAGS
=
"-fPIC -march=armv7-a -mfloat-abi=hard -ccc-gcc-name
#{
CREW_BUILD
}
"
@ARCH_CXX_FLAGS
=
"-fPIC -march=armv7-a -mfloat-abi=hard -ccc-gcc-name
#{
CREW_BUILD
}
"
@ARCH_LDFLAGS
=
''
@ARCH_LTO_LDFLAGS
=
"
#{
@ARCH_LDFLAGS
}
-flto=thin"
when
'i686'
LLVM_TARGETS_TO_BUILD
=
'X86'
LLVM_TARGETS_TO_BUILD
=
'X86'
.
freeze
# Because ld.lld: error: undefined symbol: __atomic_store
# Polly demands fPIC
@ARCH_C_FLAGS
=
'-latomic -fPIC'
...
...
@@ -51,30 +45,32 @@ class Llvm < Package
# Because getting this error:
# ld.lld: error: relocation R_386_PC32 cannot be used against symbol isl_map_fix_si; recompile with -fPIC
# So as per https://github.com/openssl/openssl/issues/11305#issuecomment-602003528
@ARCH_LDFLAGS
=
'-Wl,-znotext'
@ARCH_LDFLAGS
=
'-Wl,-znotext'
@ARCH_LTO_LDFLAGS
=
"
#{
@ARCH_LDFLAGS
}
-flto=thin"
when
'x86_64'
#LLVM_TARGETS_TO_BUILD = 'X86;AMDGPU'
LLVM_TARGETS_TO_BUILD
=
'all'
#
LLVM_TARGETS_TO_BUILD = 'X86;AMDGPU'
LLVM_TARGETS_TO_BUILD
=
'all'
.
freeze
@ARCH_C_FLAGS
=
'-fPIC'
@ARCH_CXX_FLAGS
=
'-fPIC'
@ARCH_LDFLAGS
=
''
@ARCH_LTO_LDFLAGS
=
"
#{
@ARCH_LDFLAGS
}
-flto=thin"
end
@ARCH_C_LTO_FLAGS
=
"
#{
@ARCH_C_FLAGS
}
-flto=thin -fuse-ld=lld"
@ARCH_CXX_LTO_FLAGS
=
"
#{
@ARCH_CXX_FLAGS
}
-flto=thin -fuse-ld=lld"
LLVM_PROJECTS_TO_BUILD
=
'clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld;polly;openmp'
LLVM_PROJECTS_TO_BUILD
=
'clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld;polly;openmp'
.
freeze
# Using Targets 'all' for non-i686 because otherwise mesa complains.
# This may be patched upstream as per
# https://reviews.llvm.org/rG1de56d6d13c083c996dfd44a32041dacae037d66
#LLVM_TARGETS_TO_BUILD = 'all'
#
LLVM_TARGETS_TO_BUILD = 'all'
def
self
.
patch
# This keeps system libraries from being linked in as dependencies on a build host image, such as in docker.
# Uncomment the rest of this section if you need to.
#system "sudo rm /lib#{CREW_LIB_SUFFIX}/libncurses.so.5 || true"
#system "sudo rm /usr/lib#{CREW_LIB_SUFFIX}/libform.so || true"
#system "sudo ln -s #{CREW_LIB_PREFIX}/libncurses.so.6 /lib#{CREW_LIB_SUFFIX}/libncurses.so.5 || true"
#system "sudo ln -s #{CREW_LIB_PREFIX}/libform.so /usr/lib#{CREW_LIB_SUFFIX}/libform.so || true"
#
system "sudo rm /lib#{CREW_LIB_SUFFIX}/libncurses.so.5 || true"
#
system "sudo rm /usr/lib#{CREW_LIB_SUFFIX}/libform.so || true"
#
system "sudo ln -s #{CREW_LIB_PREFIX}/libncurses.so.6 /lib#{CREW_LIB_SUFFIX}/libncurses.so.5 || true"
#
system "sudo ln -s #{CREW_LIB_PREFIX}/libform.so /usr/lib#{CREW_LIB_SUFFIX}/libform.so || true"
end
def
self
.
build
...
...
@@ -83,7 +79,7 @@ class Llvm < Package
puts
"Building LLVM Projects:
#{
LLVM_PROJECTS_TO_BUILD
}
"
.
lightgreen
############################################################
############################################################
puts
"Setting compile to use python3"
.
lightgreen
puts
'Setting compile to use python3'
.
lightgreen
############################################################
system
"grep -rl '#!.*python' | xargs sed -i '1s/python$/python3/'"
...
...
@@ -129,7 +125,7 @@ clang++ -fPIC -rtlib=compiler-rt -stdlib=libc++ -cxx-isystem \${cxx_sys} -I \${
-DLLVM_ENABLE_RTTI=ON \
-DCMAKE_C_FLAGS='
#{
@ARCH_C_LTO_FLAGS
}
' \
-DCMAKE_CXX_FLAGS='
#{
@ARCH_CXX_LTO_FLAGS
}
' \
-DCMAKE_EXE_LINKER_FLAGS='
#{
@ARCH_LDFLAGS
}
' \
-DCMAKE_EXE_LINKER_FLAGS='
#{
@ARCH_L
TO_L
DFLAGS
}
' \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DPYTHON_EXECUTABLE=$(which python3) \
-DLLVM_INSTALL_UTILS=ON \
...
...
@@ -152,20 +148,20 @@ clang++ -fPIC -rtlib=compiler-rt -stdlib=libc++ -cxx-isystem \${cxx_sys} -I \${
end
def
self
.
install
Dir
.
chdir
(
"builddir"
)
do
FileUtils
.
install
'clc'
,
"
#{
CREW_DEST_PREFIX
}
/bin/clc"
,
mode:
0755
FileUtils
.
install
'clc++'
,
"
#{
CREW_DEST_PREFIX
}
/bin/clc++"
,
mode:
0755
Dir
.
chdir
(
'builddir'
)
do
system
"DESTDIR=
#{
CREW_DEST_DIR
}
ninja install"
FileUtils
.
install
'clc'
,
"
#{
CREW_DEST_PREFIX
}
/bin/clc"
,
mode:
0
o755
FileUtils
.
install
'clc++'
,
"
#{
CREW_DEST_PREFIX
}
/bin/clc++"
,
mode:
0
o755
FileUtils
.
mkdir_p
"
#{
CREW_DEST_LIB_PREFIX
}
/bfd-plugins"
FileUtils
.
ln_s
"lib
#{
CREW_LIB_SUFFIX
}
/LLVMgold.so"
,
"
#{
CREW_DEST_LIB_PREFIX
}
/bfd-plugins/"
end
end
def
self
.
check
Dir
.
chdir
(
"builddir"
)
do
#system "ninja check-llvm || true"
#system "ninja check-clang || true"
#system "ninja check-lld || true"
Dir
.
chdir
(
'builddir'
)
do
#
system "ninja check-llvm || true"
#
system "ninja check-clang || true"
#
system "ninja check-lld || true"
end
end
...
...
@@ -173,10 +169,10 @@ clang++ -fPIC -rtlib=compiler-rt -stdlib=libc++ -cxx-isystem \${cxx_sys} -I \${
puts
puts
"To compile programs, use 'clang' or 'clang++'."
.
lightblue
puts
puts
"To avoid the repeated use of switch options,"
.
lightblue
puts
'To avoid the repeated use of switch options,'
.
lightblue
puts
"try the wrapper scripts 'clc' or 'clc++'."
.
lightblue
puts
puts
"For more information, see http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf"
.
lightblue
puts
'For more information, see http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf'
.
lightblue
puts
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment