-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.xml
68 lines (66 loc) · 3.72 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<project default="build-rust-mmtk">
<property name="rvm-binding.dir" location="${config.third-party-heap}/jikesrvm"/>
<property name="rvm-binding.source" location="${config.third-party-heap}/jikesrvm/rvm"/>
<property name="rvm-binding.tools" location="${config.third-party-heap}/jikesrvm/tools"/>
<property name="mmtk-binding.dir" location="${config.third-party-heap}/mmtk"/>
<property name="rust.binding_side_ref_proc" value="false"/>
<property environment="env"/>
<!-- Generate a few files that will be used by Rust mmtk -->
<target name="gen-jtoc">
<property name="rust-jtoc.dir" location="${rvm-binding.tools}/rustjtoc"/>
<property name="rust-jtoc.build" location="${rvm-binding.tools}/rustjtoc/build"/>
<mkdir dir="${rust-jtoc.build}"/>
<javac srcdir="${rust-jtoc.dir}" destdir="${rust-jtoc.build}"
source="${rvm.java.version}" target="${rvm.java.version}" includeantruntime="false">
<classpath>
<pathelement location="${build.vm.jar}"/>
<pathelement location="${build.rt.jar}"/>
<pathelement location="${build.classes}"/>
<pathelement location="${build.vmmagic.classes}"/>
</classpath>
</javac>
<!-- Similar to gen-interface in JikesRVM's build.xml -->
<java classname="org.jikesrvm.runtime.RustJTOC" fork="true" failonerror="true">
<classpath>
<pathelement location="${rust-jtoc.build}"/>
<pathelement location="${build.vm.jar}"/>
<pathelement location="${build.rt.jar}"/>
<pathelement location="${build.classes}"/>
<pathelement path="${build.extra.rt.jars}"/>
</classpath>
<sysproperty key="mmtk.hostjvm" value="org.jikesrvm.mm.mmtk.Factory"/>
<sysproperty key="mmtk.properties" value="${mmtk.properties}"/>
<jvmarg value="-Xbootclasspath/a:${build.rt.jar}"/>
<arg value="${mmtk-binding.dir}/src/"/>
</java>
</target>
<target name="build-rust-mmtk" depends="gen-jtoc">
<condition property="mmtk-binding.build" value="${mmtk-binding.dir}/target/i686-unknown-linux-gnu/release" else="${mmtk-binding.dir}/target/i686-unknown-linux-gnu/debug">
<contains string="${rust.args}" substring="release"/>
</condition>
<echo message="Build Rust MMTk ${mmtk-binding.dir} to ${mmtk-binding.build}"/>
<exec executable="cargo" dir="${mmtk-binding.dir}" failonerror="true">
<arg value="version"/>
</exec>
<exec executable="/usr/bin/as" failonerror="true">
<arg line="--32 -o ${build.base}/${target.obj-prefix}glue${target.obj-ext} -I ${mmtk-binding.dir}/src ${mmtk-binding.dir}/src/glue.asm"/>
</exec>
<!-- When rust.binding_side_ref_proc is true, binding_side_ref_proc will be appended to the features.
If it’s false, the features will remain unchanged. -->
<condition property="rust.features" value="${rust.features},binding_side_ref_proc">
<equals arg1="${rust.binding_side_ref_proc}" arg2="true"/>
</condition>
<exec executable="cargo" dir="${mmtk-binding.dir}" failonerror="true">
<arg value="rustc"/>
<arg value="--manifest-path=${mmtk-binding.dir}/Cargo.toml"/>
<arg value="--target=i686-unknown-linux-gnu"/>
<arg value="--features=${rust.features}"/>
<arg line="${rust.args}"/>
<arg value="--"/>
<arg value="-C"/>
<arg value="force-frame-pointers=yes"/>
</exec>
<copy file="${mmtk-binding.build}/libmmtk_jikesrvm.so" tofile="${build.base}/libmmtk.so">
</copy>
</target>
</project>