Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ae0cf7fd
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae0cf7fd
编写于
9月 17, 2017
作者:
P
Petr Hosek
提交者:
James Tucker
9月 24, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Fuchsia toolchain build
compiler-rt is now being built as part of the toolchain itself.
上级
20265ef3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
103 deletion
+28
-103
src/ci/docker/dist-fuchsia/Dockerfile
src/ci/docker/dist-fuchsia/Dockerfile
+2
-2
src/ci/docker/dist-fuchsia/build-toolchain.sh
src/ci/docker/dist-fuchsia/build-toolchain.sh
+26
-60
src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch
src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch
+0
-41
未找到文件。
src/ci/docker/dist-fuchsia/Dockerfile
浏览文件 @
ae0cf7fd
...
...
@@ -17,11 +17,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libncurses5-dev
\
patch
RUN
curl
-L
https://cmake.org/files/v3.
8/cmake-3.8.0-rc1
-Linux-x86_64.tar.gz |
\
RUN
curl
-L
https://cmake.org/files/v3.
9/cmake-3.9.2
-Linux-x86_64.tar.gz |
\
tar
xzf -
-C
/usr/local
--strip-components
=
1
WORKDIR
/tmp
COPY
dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh
dist-fuchsia/compiler-rt-dso-handle.patch
/tmp/
COPY
dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh /tmp/
RUN
/tmp/build-toolchain.sh
COPY
scripts/sccache.sh /scripts/
...
...
src/ci/docker/dist-fuchsia/build-toolchain.sh
浏览文件 @
ae0cf7fd
...
...
@@ -17,14 +17,14 @@ source shared.sh
# Download sources
SRCS
=(
"https://fuchsia.googlesource.com/zircon zircon e9a26dbc70d631029f8ee9763103910b7e3a2fe1"
"https://llvm.googlesource.com/llvm llvm
3f58a16d8eec385e2b3ebdfbb84ff9d3bf27e025
"
"https://llvm.googlesource.com/clang llvm/tools/clang
727ea63e6e82677f6e10e05e08bc7d6bdbae3111
"
"https://llvm.googlesource.com/lld llvm/tools/lld
a31286c1366e5e89b8872803fded13805a1a084b
"
"https://llvm.googlesource.com/lldb llvm/tools/lldb
0b2384abec4cb99ad66687712e07dee4dd9d187e
"
"https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt
9093a35c599fe41278606a20b51095ea8bd5a081
"
"https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx
607e0c71ec4f7fd377ad3f6c47b08dbe89f66eaa
"
"https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi
0a3a1a8a5ca5ef69e0f6b7d5b9d13e63e6fd2c19
"
"https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind
e128003563d99d9ee62247c4cee40f07d21c03e3
"
"https://llvm.googlesource.com/llvm llvm
65bdf0ae4a87e6992c24f06e2612909952468710
"
"https://llvm.googlesource.com/clang llvm/tools/clang
914987de45cf83636537909ce09156aa7a37d6ec
"
"https://llvm.googlesource.com/lld llvm/tools/lld
f8ed4483c589b390daafac92e28f4680ad052643
"
"https://llvm.googlesource.com/lldb llvm/tools/lldb
55cf8753321782668cb7e2d879457ee1ad57a2b9
"
"https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt
a8682fdf74d3cb93769b7394f2cdffc5cefb8bd8
"
"https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx
5f919fe349450b3da0e29611ae37f6a940179290
"
"https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi
caa78daf9285dada17e3e6b8aebcf7d128427f83
"
"https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind
469bacd2ea64679c15bb4d86adf000f2f2c27328
"
)
fetch
()
{
...
...
@@ -41,27 +41,7 @@ for i in "${SRCS[@]}"; do
fetch
$i
done
# Remove this once https://reviews.llvm.org/D28791 is resolved
cd
llvm/runtimes/compiler-rt
patch
-Np1
< /tmp/compiler-rt-dso-handle.patch
cd
../../..
# Build toolchain
cd
llvm
mkdir
build
cd
build
hide_output cmake
-GNinja
\
-DFUCHSIA_SYSROOT
=
${
PWD
}
/../../zircon/third_party/ulib/musl
\
-DLLVM_ENABLE_LTO
=
OFF
\
-DCLANG_BOOTSTRAP_PASSTHROUGH
=
LLVM_ENABLE_LTO
\
-C
../tools/clang/cmake/caches/Fuchsia.cmake
\
..
hide_output ninja stage2-distribution
hide_output ninja stage2-install-distribution
cd
../..
# Build sysroot
rm
-rf
llvm/runtimes/compiler-rt
./zircon/scripts/download-toolchain
build_sysroot
()
{
...
...
@@ -77,40 +57,26 @@ build_sysroot() {
mkdir
-p
$dst
cp
-r
zircon/build-
${
tgt
}
/sysroot/include
$dst
/
cp
-r
zircon/build-
${
tgt
}
/sysroot/lib
$dst
/
cd
llvm
mkdir
build-runtimes-
${
arch
}
cd
build-runtimes-
${
arch
}
hide_output cmake
-GNinja
\
-DCMAKE_C_COMPILER
=
clang
\
-DCMAKE_CXX_COMPILER
=
clang++
\
-DCMAKE_AR
=
/usr/local/bin/llvm-ar
\
-DCMAKE_RANLIB
=
/usr/local/bin/llvm-ranlib
\
-DCMAKE_INSTALL_PREFIX
=
\
-DLLVM_MAIN_SRC_DIR
=
${
PWD
}
/..
\
-DLLVM_BINARY_DIR
=
${
PWD
}
/../build
\
-DLLVM_ENABLE_WERROR
=
OFF
\
-DCMAKE_BUILD_TYPE
=
Release
\
-DLLVM_INCLUDE_TESTS
=
ON
\
-DCMAKE_SYSTEM_NAME
=
Fuchsia
\
-DCMAKE_C_COMPILER_TARGET
=
${
arch
}
-fuchsia
\
-DCMAKE_CXX_COMPILER_TARGET
=
${
arch
}
-fuchsia
\
-DUNIX
=
1
\
-DLIBCXX_HAS_MUSL_LIBC
=
ON
\
-DLIBCXXABI_USE_LLVM_UNWINDER
=
ON
\
-DCMAKE_SYSROOT
=
${
dst
}
\
-DCMAKE_C_COMPILER_FORCED
=
TRUE
\
-DCMAKE_CXX_COMPILER_FORCED
=
TRUE
\
-DLLVM_ENABLE_LIBCXX
=
ON
\
-DCMAKE_EXE_LINKER_FLAGS
=
"-nodefaultlibs -lc"
\
-DCMAKE_SHARED_LINKER_FLAGS
=
"
$(
clang
--target
=
${
arch
}
-fuchsia
-print-libgcc-file-name
)
"
\
../runtimes
hide_output
env
DESTDIR
=
"
${
dst
}
"
ninja
install
cd
../..
}
build_sysroot
"x86_64"
build_sysroot
"aarch64"
for
arch
in
x86_64 aarch64
;
do
build_sysroot
${
arch
}
done
# Build toolchain
cd
llvm
mkdir
build
cd
build
hide_output cmake
-GNinja
\
-DFUCHSIA_x86_64_SYSROOT
=
/usr/local/x86_64-unknown-fuchsia
\
-DFUCHSIA_aarch64_SYSROOT
=
/usr/local/aarch64-unknown-fuchsia
\
-DLLVM_ENABLE_LTO
=
OFF
\
-DCLANG_BOOTSTRAP_PASSTHROUGH
=
LLVM_ENABLE_LTO
\
-C
../tools/clang/cmake/caches/Fuchsia.cmake
\
..
hide_output ninja stage2-distribution
hide_output ninja stage2-install-distribution
cd
../..
rm
-rf
zircon llvm
...
...
src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch
已删除
100644 → 0
浏览文件 @
20265ef3
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
index fc4384af2..b442264c0 100644
--- a/lib/builtins/CMakeLists.txt
+++ b/lib/builtins/CMakeLists.txt
@@ -194,6 +194,12 @@
if(APPLE)
atomic_thread_fence.c)
endif()
+if(FUCHSIA)
+ set(GENERIC_SOURCES
+ ${GENERIC_SOURCES}
+ dso_handle.c)
+endif()
+
if(NOT WIN32 OR MINGW)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
diff --git a/lib/builtins/dso_handle.c b/lib/builtins/dso_handle.c
new file mode 100644
index 000000000..7766cd0aa
--- /dev/null
+++ b/lib/builtins/dso_handle.c
@@ -0,0 +1,18 @@
+/* ===-- dso_handle.c - Provide __dso_handle -------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+/* __dso_handle symbol is mandated by C++ ABI with a value which is an address
+ * in one of the object's segments, and as such this symbol has to be included
+ * statically and cannot be a part of a shared library. Traditionally, it has
+ * been defined in crtbegin.o but there's no principled reason for it to be
+ * there. We defined this symbol in the builtin library which is built as a
+ * static library and always included in the final link.
+ */
+__attribute__((visibility("hidden"))) void *const __dso_handle;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录