Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
bd8d105e
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bd8d105e
编写于
4月 16, 2020
作者:
T
Tautvydas Žilys
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support cross compiling to ARM64 in our build scripts.
上级
399c21f1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
118 addition
and
68 deletion
+118
-68
external/buildscripts/Build.bee.cs
external/buildscripts/Build.bee.cs
+1
-1
external/buildscripts/build.pl
external/buildscripts/build.pl
+38
-24
external/buildscripts/build_all_osx.pl
external/buildscripts/build_all_osx.pl
+72
-39
external/buildscripts/build_classlibs_osx.pl
external/buildscripts/build_classlibs_osx.pl
+1
-0
libgc/gcj_mlc.c
libgc/gcj_mlc.c
+2
-0
support/sys-uio.c
support/sys-uio.c
+4
-4
未找到文件。
external/buildscripts/Build.bee.cs
浏览文件 @
bd8d105e
...
...
@@ -75,7 +75,7 @@ namespace BuildProgram
Artifacts
.
Add
(
"MacBuildEnvironment"
,
new
Tuple
<
string
,
string
>(
"
MacBuildEnvironment/9df1e3b3b120_2fc8e616a2e5dfb7907fc42d9576b427e692223c266dc3bc305de4bf03714e30.7z
"
,
"
mac-toolchain-11_0/12.0-12A8158a_2b346a6c93e9c82250a1d88c02f24a5dea9f0bd1aa2ef44109896a44800e8c68.zip
"
,
"unity-internal"
));
Artifacts
.
Add
(
"mono-build-tools-extra"
,
...
...
external/buildscripts/build.pl
浏览文件 @
bd8d105e
...
...
@@ -52,6 +52,7 @@ my $forceDefaultBuildDeps=0;
my
$existingMonoRootPath
=
'';
my
$sdk
=
'';
my
$arch32
=
0
;
my
$targetArch
=
"";
my
$winPerl
=
"";
my
$winMonoRoot
=
"";
my
$msBuildVersion
=
"
14.0
";
...
...
@@ -97,6 +98,7 @@ GetOptions(
'
runtimetests=i
'
=>\
$runRuntimeTests
,
'
classlibtests=i
'
=>\
$runClasslibTests
,
'
arch32=i
'
=>\
$arch32
,
'
targetarch=s
'
=>\
$targetArch
,
'
jobs=i
'
=>\
$jobs
,
'
sdk=s
'
=>\
$sdk
,
'
existingmono=s
'
=>\
$existingMonoRootPath
,
...
...
@@ -206,10 +208,16 @@ if($^O eq "linux")
}
elsif
(
$^O
eq
'
darwin
')
{
$monoHostArch
=
$arch32
?
"
i386
"
:
"
x86_64
";
$monoHostArch
=
"
x86_64
";
$existingExternalMono
=
"
$existingExternalMonoRoot
";
$existingExternalMonoBinDir
=
"
bin
";
if
(
$targetArch
eq
"
arm64
")
{
$disableMcs
=
1
;
$test
=
0
;
}
# From Massi: I was getting failures in install_name_tool about space
# for the commands being too small, and adding here things like
# $ENV{LDFLAGS} = '-headerpad_max_install_names' and
...
...
@@ -447,22 +455,12 @@ if ($build)
}
my
$macSdkPath
=
"";
my
$macversion
=
'
10.
8
';
my
$macversion
=
'
10.
12
';
my
$darwinVersion
=
"
10
";
if
(
$^O
eq
'
darwin
')
{
if
(
$sdk
eq
'')
{
$sdk
=
'
10.11
';
}
my
$macBuildEnvDir
=
"
$externalBuildDeps
/MacBuildEnvironment
";
$macSdkPath
=
"
$macBuildEnvDir
/builds/MacOSX
$sdk
.sdk
";
if
(
!
-
d
$macSdkPath
)
{
print
("
>>> Unzipping mac build toolchain
\n
");
system
("
unzip
",
'
-qd
',
"
$macBuildEnvDir
",
"
$macBuildEnvDir
/builds.zip
")
eq
0
or
die
("
failed unzipping mac build toolchain
\n
");
}
$sdk
=
'
11.0
';
$macSdkPath
=
"
$externalBuildDeps
/mac-toolchain-11_0/MacOSX
$sdk
.sdk
";
}
if
(
$iphone
||
$iphoneSimulator
)
...
...
@@ -1156,20 +1154,37 @@ if ($build)
$existingMonoRootPath
=
"
$monoInstalls
/
$monoVersionToUse
";
}
if
(
$targetArch
eq
"
arm64
")
{
$macversion
=
"
11.0
";
# To build on ARM64, we need to specify min OS version as 11.0 as we need to use new APIs from 11.0
}
$mcs
=
"
EXTERNAL_MCS=
$existingMonoRootPath
/bin/mcs
";
$ENV
{'
CC
'}
=
"
$macSdkPath
/../usr/bin/clang
";
$ENV
{'
CXX
'}
=
"
$macSdkPath
/../usr/bin/clang++
";
$ENV
{'
CFLAGS
'}
=
$ENV
{
MACSDKOPTIONS
}
=
"
-
D_XOPEN_SOURCE -I
$macBuildEnvDir
/builds/usr/include -mmacosx-version-min=
$macversion
-isysroot
$macSdkPath
";
$ENV
{'
CFLAGS
'}
=
$ENV
{
MACSDKOPTIONS
}
=
"
-
mmacosx-version-min=
$macversion
-isysroot
$macSdkPath
-g
";
$ENV
{
CFLAGS
}
=
"
$ENV
{CFLAGS} -
g -
O0
"
if
$debug
;
$ENV
{
CFLAGS
}
=
"
$ENV
{CFLAGS} -O0
"
if
$debug
;
$ENV
{
CFLAGS
}
=
"
$ENV
{CFLAGS} -Os
"
if
not
$debug
;
#optimize for size
$ENV
{
CC
}
=
"
$ENV
{CC} -arch
$
monoHos
tArch
";
$ENV
{
CXX
}
=
"
$ENV
{CXX} -arch
$
monoHos
tArch
";
$ENV
{
CC
}
=
"
$ENV
{CC} -arch
$
targe
tArch
";
$ENV
{
CXX
}
=
"
$ENV
{CXX} -arch
$
targe
tArch
";
# Add OSX specific autogen args
push
@configureparams
,
"
--host=
$monoHostArch
-apple-darwin12.2.0
";
if
(
$targetArch
eq
"
x86_64
")
{
push
@configureparams
,
"
--host=x86_64-apple-darwin12.2.0
";
}
elsif
(
$targetArch
eq
"
arm64
")
{
push
@configureparams
,
"
--host=aarch64-apple-darwinmacos12.2.0
";
}
else
{
die
("
Unsupported macOS architecture:
$targetArch
");
}
# Need to define because Apple's SIP gets in the way of us telling mono where to find this
push
@configureparams
,
"
--with-libgdiplus=
$addtoresultsdistdir
/lib/libgdiplus.dylib
";
...
...
@@ -1507,10 +1522,9 @@ if ($artifact)
}
elsif
(
$^O
eq
'
darwin
')
{
# Note these tmp directories will get merged into a single 'osx' directory later by a parent script
$embedDirArchDestination
=
"
$embedDirRoot
/osx-tmp-
$monoHostArch
";
$distDirArchBin
=
"
$distdir
/bin-osx-tmp-
$monoHostArch
";
$versionsOutputFile
=
$arch32
?
"
$buildsroot
/versions-osx32.txt
"
:
"
$buildsroot
/versions-osx64.txt
";
$embedDirArchDestination
=
"
$embedDirRoot
/osx-tmp-
$targetArch
";
$distDirArchBin
=
"
$distdir
/bin-osx-tmp-
$targetArch
";
$versionsOutputFile
=
"
$buildsroot
/versions-macos-
$targetArch
.txt
";
}
else
{
...
...
@@ -1724,4 +1738,4 @@ else
print
("
>>> Skipping unit tests
\n
");
}
chdir
(
$currentdir
);
\ No newline at end of file
chdir
(
$currentdir
);
external/buildscripts/build_all_osx.pl
浏览文件 @
bd8d105e
...
...
@@ -62,48 +62,29 @@ if ($buildUsAndBoo)
}
print
("
>>> Building x86_64
\n
");
system
("
perl
",
"
$buildscriptsdir
/build.pl
",
"
--clean=1
",
"
--classlibtests=0
",
@passAlongArgs
)
eq
0
or
die
('
failing building x86_64
');
system
("
perl
",
"
$buildscriptsdir
/build.pl
",
"
--clean=1
",
"
--classlibtests=0
",
"
--targetarch=x86_64
",
@passAlongArgs
)
eq
0
or
die
('
failing building x86_64
');
print
("
>>> Building ARM64
\n
");
system
("
perl
",
"
$buildscriptsdir
/build.pl
",
"
--clean=1
",
"
--classlibtests=0
",
"
--targetarch=arm64
",
@passAlongArgs
)
eq
0
or
die
("
failing building ARM64
");
if
(
$artifact
)
{
print
("
>>> Moving built binaries to final output directories
\n
");
# Merge stuff in the embedruntimes directory
my
$embedDirRoot
=
"
$buildsroot
/embedruntimes
";
my
$embedDirDestination
=
"
$embedDirRoot
/osx
";
my
$embedDirSource64
=
"
$embedDirRoot
/osx-tmp-x86_64
";
system
("
mkdir -p
$embedDirDestination
");
if
(
!
(
-
d
$embedDirSource64
))
{
die
("
Expected source directory not found :
$embedDirSource64
\n
");
}
for
my
$file
('
libmonobdwgc-2.0.dylib
','
libmonosgen-2.0.dylib
','
libMonoPosixHelper.dylib
')
{
print
("
>>> cp
$embedDirSource64
/
$file
$embedDirDestination
/
$file
\n\n
");
system
('
cp
',
"
$embedDirSource64
/
$file
",
"
$embedDirDestination
/
$file
");
}
if
(
not
$buildMachine
)
{
print
("
>>> Doing non-build machine stuff...
\n
");
for
my
$file
('
libmonobdwgc-2.0.dylib
','
libmonosgen-2.0.dylib
','
libMonoPosixHelper.dylib
')
{
print
("
>>> Removing
$embedDirDestination
/
$file
.dSYM
\n
");
rmtree
("
$embedDirDestination
/
$file
.dSYM
");
print
("
>>> 'dsymutil
$embedDirDestination
/
$file
\n
");
system
('
dsymutil
',
"
$embedDirDestination
/
$file
")
eq
0
or
warn
("
Failed creating
$embedDirDestination
/
$file
.dSYM
");
}
# Copy stuff in the embedruntimes directory
my
$embedDirRoot
=
"
$buildsroot
/embedruntimes
";
my
$embedDirSourceX64
=
"
$embedDirRoot
/osx-tmp-x86_64
";
my
$embedDirSourceARM64
=
"
$embedDirRoot
/osx-tmp-arm64
";
print
("
>>> Done with non-build machine stuff
\n
");
}
CopyEmbedRuntimeBinaries
(
$embedDirSourceX64
,
"
$embedDirRoot
/osx
");
CopyEmbedRuntimeBinaries
(
$embedDirSourceARM64
,
"
$embedDirRoot
/osx-arm64
");
# Merge stuff in the monodistribution directory
my
$distDirRoot
=
"
$buildsroot
/monodistribution
";
my
$distDirDestinationBin
=
"
$buildsroot
/monodistribution/bin
";
my
$distDirDestinationLib
=
"
$buildsroot
/monodistribution/lib
";
my
$distDirSourceBin64
=
"
$distDirRoot
/bin-osx-tmp-x86_64
";
my
$distDirSourceBinX64
=
"
$distDirRoot
/bin-osx-tmp-x86_64
";
my
$distDirSourceBinARM64
=
"
$distDirRoot
/bin-osx-tmp-arm64
";
# Should always exist because build_all would have put stuff in it, but in some situations
# depending on the options it may not. So create it if it does not exist
...
...
@@ -117,27 +98,79 @@ if ($artifact)
system
("
mkdir -p
$distDirDestinationLib
");
}
if
(
!
(
-
d
$distDirSourceBin64
))
if
(
!
(
-
d
$distDirSourceBinX64
))
{
die
("
Expected source directory not found :
$distDirSourceBinX64
\n
");
}
if
(
!
(
-
d
$distDirSourceBinARM64
))
{
die
("
Expected source directory not found :
$distDirSourceBinARM64
\n
");
}
for
my
$file
('
mono
')
{
die
("
Expected source directory not found :
$distDirSourceBin64
\n
");
MergeIntoFatBinary
("
$distDirSourceBinX64
/
$file
",
"
$distDirSourceBinARM64
/
$file
",
"
$distDirDestinationBin
/
$file
");
}
for
my
$file
('
mono
','
pedump
')
for
my
$file
('
pedump
')
{
system
('
mv
',
"
$distDirSourceBin64
/
$file
",
"
$distDirDestinationBin
/
$file
");
# pedump doens't get cross-compiled
system
('
mv
',
"
$distDirSourceBinX64
/
$file
",
"
$distDirDestinationBin
/
$file
")
eq
0
or
die
("
Failed to move '
$distDirSourceBinX64
/
$file
' to '
$distDirDestinationBin
/
$file
'.
");
}
for
my
$file
('
libMonoPosixHelper.dylib
')
{
print
("
>>> cp
$embedDirSource64
/
$file
$distDirDestinationLib
/
$file
\n\n
");
system
('
cp
',
"
$embedDirSource64
/
$file
",
"
$distDirDestinationLib
/
$file
");
MergeIntoFatBinary
("
$embedDirSourceX64
/
$file
",
"
$embedDirSourceARM64
/
$file
",
"
$distDirDestinationLib
/
$file
");
}
if
(
$buildMachine
)
{
print
("
>>> Clean up temporary arch specific build directories
\n
");
rmtree
("
$distDirSourceBin64
");
rmtree
("
$embedDirSource64
");
rmtree
("
$distDirSourceBinX64
");
rmtree
("
$distDirSourceBinARM64
");
rmtree
("
$embedDirSourceX64
");
rmtree
("
$embedDirSourceARM64
");
}
}
sub
CopyEmbedRuntimeBinaries
{
my
(
$embedDirSource
,
$embedDirDestination
)
=
@_
;
system
("
mkdir -p
$embedDirDestination
");
if
(
!
(
-
d
$embedDirSource
))
{
die
("
Expected source directory not found :
$embedDirSource
\n
");
}
for
my
$file
('
libmonobdwgc-2.0.dylib
','
libmonosgen-2.0.dylib
','
libMonoPosixHelper.dylib
')
{
print
("
>>> cp
$embedDirSource
/
$file
$embedDirDestination
/
$file
\n\n
");
system
('
cp
',
"
$embedDirSource
/
$file
",
"
$embedDirDestination
/
$file
")
eq
0
or
die
("
Failed to copy '
$embedDirSource
/
$file
' to '
$embedDirDestination
/
$file
'.
");
}
if
(
not
$buildMachine
)
{
print
("
>>> Doing non-build machine stuff...
\n
");
for
my
$file
('
libmonobdwgc-2.0.dylib
','
libmonosgen-2.0.dylib
','
libMonoPosixHelper.dylib
')
{
print
("
>>> Removing
$embedDirDestination
/
$file
.dSYM
\n
");
rmtree
("
$embedDirDestination
/
$file
.dSYM
");
print
("
>>> 'dsymutil
$embedDirDestination
/
$file
\n
");
system
('
dsymutil
',
"
$embedDirDestination
/
$file
")
eq
0
or
warn
("
Failed creating
$embedDirDestination
/
$file
.dSYM
");
}
print
("
>>> Done with non-build machine stuff
\n
");
}
}
sub
MergeIntoFatBinary
{
my
(
$binary1
,
$binary2
,
$binaryOutput
)
=
@_
;
print
("
>>> Merging '
$binary1
' and '
$binary2
' into '
$binaryOutput
'
\n\n
");
system
('
lipo
',
"
$binary1
",
"
$binary2
",
"
-create
",
"
-output
",
"
$binaryOutput
")
eq
0
or
die
("
Failed to run lipo!
");
}
\ No newline at end of file
external/buildscripts/build_classlibs_osx.pl
浏览文件 @
bd8d105e
...
...
@@ -34,6 +34,7 @@ system(
"
--build=
$build
",
"
--clean=
$clean
",
"
--mcsonly=
$mcsOnly
",
"
--targetarch=x86_64
",
"
--skipmonomake=
$skipMonoMake
",
"
--artifact=1
",
"
--artifactscommon=1
",
...
...
libgc/gcj_mlc.c
浏览文件 @
bd8d105e
...
...
@@ -50,6 +50,8 @@ int GC_gcj_debug_kind; /* The kind of objects that is always marked */
ptr_t
*
GC_gcjobjfreelist
;
ptr_t
*
GC_gcjdebugobjfreelist
;
void
GC_start_debugging
();
/* Caller does not hold allocation lock. */
void
GC_init_gcj_malloc
(
int
mp_index
,
void
*
/* really GC_mark_proc */
mp
)
{
...
...
support/sys-uio.c
浏览文件 @
bd8d105e
...
...
@@ -82,7 +82,7 @@ Mono_Posix_Syscall_writev (int dirfd, struct Mono_Posix_Iovec *iov, gint32 iovcn
}
#endif
/* def HAVE_WRITEV */
#if
def HAVE_PREADV
#if
defined(HAVE_PREADV) && !defined(__APPLE__) // Configure incorrectly detects that this function is available on macOS SDK 11.0 (it is not)
gint64
Mono_Posix_Syscall_preadv
(
int
dirfd
,
struct
Mono_Posix_Iovec
*
iov
,
gint32
iovcnt
,
gint64
off
)
{
...
...
@@ -100,9 +100,9 @@ Mono_Posix_Syscall_preadv (int dirfd, struct Mono_Posix_Iovec *iov, gint32 iovcn
free
(
v
);
return
res
;
}
#endif
/* def
HAVE_PREADV
*/
#endif
/* def
ined(HAVE_PREADV) && !defined(__APPLE__)
*/
#if
def HAVE_PWRITEV
#if
defined(HAVE_PWRITEV) && !defined(__APPLE__) // Configure incorrectly detects that this function is available on macOS SDK 11.0 (it is not)
gint64
Mono_Posix_Syscall_pwritev
(
int
dirfd
,
struct
Mono_Posix_Iovec
*
iov
,
gint32
iovcnt
,
gint64
off
)
{
...
...
@@ -120,7 +120,7 @@ Mono_Posix_Syscall_pwritev (int dirfd, struct Mono_Posix_Iovec *iov, gint32 iovc
free
(
v
);
return
res
;
}
#endif
/* def
HAVE_PWRITEV
*/
#endif
/* def
ined(HAVE_PWRITEV) && !defined(__APPLE__)
*/
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录