Skip to content

Commit

Permalink
Add preliminary support for FFIPlugin #43
Browse files Browse the repository at this point in the history
- Implement primitive 120, primitiveCalloutWithArgs, and primitiveLoadSymbolFromModule
- Let TruffleSqueak depend on `nfi`
- Introduce `de.hpi.swa.trufflesqueak.ffi.native` project with `SqueakFFIPrims.c`
- Turn `TRUFFLESQUEAK_GRAALVM_SUPPORT` into `TRUFFLESQUEAK_HOME`

Co-authored-by: Teresa Lasarow <[email protected]>
Co-authored-by: Fabio Niephaus <[email protected]>
  • Loading branch information
3 people authored May 26, 2020
1 parent cc0dee8 commit 04507ea
Show file tree
Hide file tree
Showing 17 changed files with 1,223 additions and 88 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ graal_dumps/
# Profile output directory
profiles/

# GraalSqueak
# TruffleSqueak
images
lib/**/*.dll
lib/**/*.dylib
lib/**/*.so
trufflesqueak*.zip
trufflesqueak*.jar
6 changes: 3 additions & 3 deletions mx.trufflesqueak/mx_trufflesqueak.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _graal_vm_args(args):
def _squeak(args, extra_vm_args=None, env=None, jdk=None, **kwargs):
"""run TruffleSqueak"""

env = env if env else os.environ
env = env if env else os.environ.copy()

vm_args, raw_args = mx.extract_VM_args(
args, useDoubleDash=True, defaultAllVMArgs=False)
Expand Down Expand Up @@ -521,14 +521,14 @@ def _get_path_to_test_image():
name='TruffleSqueak',
short_name='st',
dir_name=LANGUAGE_ID,
license_files=[], # already included in `TRUFFLESQUEAK_GRAALVM_SUPPORT`.
license_files=[], # already included in `TRUFFLESQUEAK_HOME`.
third_party_license_files=[],
truffle_jars=[
'trufflesqueak:TRUFFLESQUEAK',
'trufflesqueak:TRUFFLESQUEAK_SHARED',
],
support_distributions=[
'trufflesqueak:TRUFFLESQUEAK_GRAALVM_SUPPORT',
'trufflesqueak:TRUFFLESQUEAK_HOME',
],
launcher_configs=[
mx_sdk.LanguageLauncherConfig(
Expand Down
80 changes: 55 additions & 25 deletions mx.trufflesqueak/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,30 @@
"javaCompliance": "8+",
"workingSets": "TruffleSqueak",
},
"de.hpi.swa.trufflesqueak.ffi.native": {
"subDir" : "src",
"native" : "shared_lib",
"deliverable" : "SqueakFFIPrims",
"os_arch" : {
"windows" : {
"<others>" : {
"cflags" : []
}
},
"linux" : {
"<others>" : {
"cflags" : ["-g", "-Wall", "-Werror", "-D_GNU_SOURCE"],
"ldlibs" : ["-ldl"],
},
},
"<others>" : {
"<others>" : {
"cflags" : ["-g", "-Wall", "-Werror"],
"ldlibs" : ["-ldl"],
},
},
},
},
"de.hpi.swa.trufflesqueak.shared": {
"subDir": "src",
"sourceDirs": ["src"],
Expand Down Expand Up @@ -156,31 +180,54 @@
"TRUFFLESQUEAK_SHARED",
"truffle:TRUFFLE_API",
],
"javaProperties" : {
"org.graalvm.language.smalltalk.home": "<path:TRUFFLESQUEAK_HOME>",
},
"exclude": ["mx:JUNIT"],
},

"TRUFFLESQUEAK_SHARED": {
"TRUFFLESQUEAK_HOME": {
"native": True,
"platformDependent": True,
"description": "TruffleSqueak home distribution",
"layout": {
"LICENSE_TRUFFLESQUEAK.txt": "file:LICENSE",
"README_TRUFFLESQUEAK.md": "file:README.md",
"lib/" : "dependency:de.hpi.swa.trufflesqueak.ffi.native",
"resources": {
"source_type": "file",
"path": "src/resources",
"exclude": ["src/resources/.gitignore"],
},
"native-image.properties": "file:mx.trufflesqueak/native-image.properties",
},
"maven": False,
},

"TRUFFLESQUEAK_LAUNCHER": {
"description": "TruffleSqueak launcher",
"dependencies": [
"de.hpi.swa.trufflesqueak.shared",
"de.hpi.swa.trufflesqueak.launcher",
],
"distDependencies": [
"TRUFFLESQUEAK_SHARED",
"sdk:GRAAL_SDK",
"sdk:LAUNCHER_COMMON",
],
},

"TRUFFLESQUEAK_LAUNCHER": {
"TRUFFLESQUEAK_SHARED": {
"description": "TruffleSqueak shared distribution",
"dependencies": [
"de.hpi.swa.trufflesqueak.launcher",
"de.hpi.swa.trufflesqueak.shared",
],
"distDependencies": [
"TRUFFLESQUEAK_SHARED",
"sdk:GRAAL_SDK",
"sdk:LAUNCHER_COMMON",
],
},

"TRUFFLESQUEAK_TCK": {
"description": "TCK-based interoperability tests",
"description": "TruffleSqueak TCK-based interoperability tests",
"dependencies": [
"de.hpi.swa.trufflesqueak.tck",
],
Expand All @@ -196,25 +243,8 @@
"testDistribution": True,
},

"TRUFFLESQUEAK_GRAALVM_SUPPORT": {
"native": True,
"platformDependent": True,
"description": "TruffleSqueak support distribution for the GraalVM",
"layout": {
"LICENSE_TRUFFLESQUEAK.txt": "file:LICENSE",
"README_TRUFFLESQUEAK.md": "file:README.md",
"resources": {
"source_type": "file",
"path": "src/resources",
"exclude": ["src/resources/.gitignore"],
},
"native-image.properties": "file:mx.trufflesqueak/native-image.properties",
},
"maven": False,
},

"TRUFFLESQUEAK_TEST": {
"description": "JUnit and SUnit tests",
"description": "TruffleSqueak JUnit and SUnit tests",
"javaCompliance": "8+",
"dependencies": [
"de.hpi.swa.trufflesqueak.test",
Expand Down
Loading

0 comments on commit 04507ea

Please sign in to comment.