Skip to content

Commit

Permalink
[GR-27432] [GR-27434] Make sulong build on Windows (by ignoring offen…
Browse files Browse the repository at this point in the history
…ding projects).

PullRequest: graal/8095
  • Loading branch information
zapster committed Jan 25, 2021
2 parents 6b37bb9 + 454d809 commit a6a268b
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 141 deletions.
5 changes: 5 additions & 0 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
"packages": {
"cmake": "==3.15.2"
}
},
"windows": {
"packages": {
"msvc": "==10.0"
}
}
}
}
Expand Down
14 changes: 8 additions & 6 deletions sdk/mx.sdk/mx_sdk_vm_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,25 +486,26 @@ def _add_native_image_macro(image_config, component=None):
for profile in _image_profile(GraalVmNativeProperties.canonical_image_name(image_config)):
_add(layout, _macro_dir, 'file:{}'.format(abspath(profile)))

def _add_link(_dest, _target, _component=None):
def _add_link(_dest, _target, _component=None, _dest_base_name=None):
assert _dest.endswith('/')
_linkname = relpath(path_substitutions.substitute(_target), start=path_substitutions.substitute(_dest[:-1]))
if _linkname != basename(_target):
dest_base_name = _dest_base_name or basename(_target)
if _linkname != dest_base_name:
if mx.is_windows():
if _target.endswith('.exe') or _target.endswith('.cmd'):
link_template_name = join(_suite.mxDir, 'vm', 'exe_link_template.cmd')
with open(link_template_name, 'r') as template:
_template_subst = mx_subst.SubstitutionEngine(mx_subst.string_substitutions)
_template_subst.register_no_arg('target', normpath(_linkname))
contents = _template_subst.substitute(template.read())
full_dest = _dest + basename(_target)[:-len('.exe')] + '.cmd'
full_dest = _dest + dest_base_name[:-len('.exe')] + '.cmd'
_add(layout, full_dest, 'string:{}'.format(contents), _component)
return full_dest
else:
mx.abort("Cannot create link on windows for {}->{}".format(_dest, _target))
else:
_add(layout, _dest, 'link:{}'.format(_linkname), _component)
return _dest + basename(_target)
_add(layout, _dest + dest_base_name, 'link:{}'.format(_linkname), _component)
return _dest + dest_base_name

def _find_escaping_links(root_dir):
escaping_links = []
Expand Down Expand Up @@ -696,7 +697,8 @@ def _find_escaping_links(root_dir):
for _component_link in _launcher_config.links:
_link_dest = _component_base + _component_link
# add links `LauncherConfig.links` -> `LauncherConfig.destination`
_add(layout, _link_dest, 'link:{}'.format(relpath(_launcher_dest, start=dirname(_link_dest))), _component)
_link_dest_dir, _link_dest_base_name = os.path.split(_link_dest)
_add_link(_link_dest_dir + '/', _launcher_dest, _component, _dest_base_name=_link_dest_base_name)
# add links from jre/bin to component link
if _launcher_config.default_symlinks:
_link_path = _add_link(_jdk_jre_bin, _link_dest, _component)
Expand Down
183 changes: 96 additions & 87 deletions sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -39,7 +39,7 @@
# SOFTWARE.
#
suite = {
"mxversion" : "5.279.1",
"mxversion" : "5.282.0",
"name" : "sdk",
"version" : "21.1.0",
"release" : False,
Expand Down Expand Up @@ -93,44 +93,51 @@
"license" : "BSD-new"
},
"LLVM_ORG" : {
"version" : "10.0.0-4-g22d2637565-bg83994d0b4b",
"version" : "10.0.0-5-g67b19b2aed-bgb23ce12f48",
"host" : "https://lafo.ssw.uni-linz.ac.at/pub/llvm-org",
"os_arch" : {
"linux" : {
"amd64" : {
"urls" : ["{host}/llvm-llvmorg-{version}-linux-amd64.tar.gz"],
"sha1" : "7fa523a9a1a40674da5ad6c3bdd91375bb566830",
"sha1" : "a342aa46f6a45d91c5dbda8cd42d4a493166babe",
},
"aarch64" : {
"urls" : ["{host}/llvm-llvmorg-{version}-linux-aarch64.tar.gz"],
"sha1" : "6ae659cc5bab9e76b457b595f7e84943aa97e056",
"sha1" : "772d729ae66105ceeb647e8e69b3b6204dc9ff7b",
}
},
"darwin" : {
"amd64" : {
"urls" : ["{host}/llvm-llvmorg-{version}-darwin-amd64.tar.gz"],
"sha1" : "8b9e665f1b734d41c62a83b1b6081ffe50f63a4c",
"sha1" : "3f0c7311c5bf3371ebf34cdd6a73f51c997ab9c2",
}
},
"windows" : {
"amd64" : {
# version difference due to rebuilding to statically link the standard library on windows
# "urls" : ["{host}/llvm-llvmorg-{version}-windows-amd64.tar.gz"],
"urls" : ["{host}/llvm-llvmorg-10.0.0-5-g67b19b2aed-bgfbfba28a74-windows-amd64.tar.gz"],
"sha1" : "7973931f1dcef6b3259d39c53efd5f7891c956c6",
}
},
"<others>": {
"<others>": {
"optional": True,
}
},
"license" : "Apache-2.0-LLVM",
}
},
"license" : "Apache-2.0-LLVM",
},
"LLVM_ORG_COMPILER_RT_LINUX" : {
"version" : "10.0.0-4-g22d2637565-bg83994d0b4b",
"version" : "10.0.0-5-g67b19b2aed-bgb23ce12f48",
"host" : "https://lafo.ssw.uni-linz.ac.at/pub/llvm-org",
# we really want linux-amd64, also on non-linux and non-amd64 platforms for cross-compilation
"urls" : ["{host}/compiler-rt-llvmorg-{version}-linux-amd64.tar.gz"],
"sha1" : "c70e1aef1e685eb9c7294d8dacbc1b5c35c1bc21",
"sha1" : "8ebce7c8e9937246572e066f533f910778b7c870",
"license" : "Apache-2.0-LLVM",
},
"LLVM_ORG_SRC" : {
# The sources contain a backport to fix libunwind CMake issue with cmake 3.19 [GR-27589]
# https://github.com/llvm/llvm-project/commit/c48974ffd7d1676f79d39d3b1e70f07d3a5e2e44
# version difference as the sources did not change
"version" : "10.0.0-5-g67b19b2aed-bg83994d0b4b",
"host" : "https://lafo.ssw.uni-linz.ac.at/pub/llvm-org",
"packedResource" : True,
Expand Down Expand Up @@ -378,88 +385,90 @@
{
"source_type": "extracted-dependency",
"dependency": "LLVM_ORG",
"path": ".",
"path": "*",
"dereference": "never",
"exclude": [
"./bin/bugpoint",
"./bin/c-index-test",
"./bin/clang-check",
"./bin/clang-extdef-mapping",
"./bin/clang-import-test",
"./bin/clang-offload-bundler",
"./bin/clang-refactor",
"./bin/clang-rename",
"./bin/clang-scan-deps",
"./bin/diagtool",
"./bin/dsymutil",
"./bin/git-clang-format",
"./bin/hmaptool",
"./bin/llvm-addr2line",
"./bin/llvm-bcanalyzer",
"./bin/llvm-cat",
"./bin/llvm-cfi-verify",
"./bin/llvm-cov",
"./bin/llvm-c-test",
"./bin/llvm-cvtres",
"./bin/llvm-cxxdump",
"./bin/llvm-cxxfilt",
"./bin/llvm-cxxmap",
"./bin/llvm-dwp",
"./bin/llvm-elfabi",
"./bin/llvm-exegesis",
"./bin/llvm-jitlink",
"./bin/llvm-lipo",
"./bin/llvm-lto",
"./bin/llvm-lto2",
"./bin/llvm-mc",
"./bin/llvm-mca",
"./bin/llvm-modextract",
"./bin/llvm-mt",
"./bin/llvm-opt-report",
"./bin/llvm-pdbutil",
"./bin/llvm-profdata",
"./bin/llvm-rc",
"./bin/llvm-rtdyld",
"./bin/llvm-size",
"./bin/llvm-split",
"./bin/llvm-stress",
"./bin/llvm-strings",
"./bin/llvm-symbolizer",
"./bin/llvm-tblgen",
"./bin/llvm-undname",
"./bin/llvm-xray",
"./bin/obj2yaml",
"./bin/sancov",
"./bin/sanstats",
"./bin/scan-build",
"./bin/scan-view",
"./bin/verify-uselistorder",
"./bin/yaml2obj",
"./bin/set-xcode-analyzer",
"./share",
"./include/clang",
"./include/clang-c",
"./include/lld",
"./include/llvm",
"./include/llvm-c",
"./lib/cmake",
"./lib/Checker*",
"./lib/Sample*",
"./lib/libRemarks*",
"./lib/libLLVM*.a",
"./lib/libclang.so*",
"./lib/libclang.dylib*",
"./lib/libclang*.a",
"./lib/liblld*.a",
"./libexec",
"bin/bugpoint*",
"bin/c-index-test*",
"bin/clang-check*",
"bin/clang-extdef-mapping*",
"bin/clang-import-test*",
"bin/clang-offload-*",
"bin/clang-refactor*",
"bin/clang-rename*",
"bin/clang-scan-deps*",
"bin/diagtool*",
"bin/dsymutil*",
"bin/git-clang-format",
"bin/hmaptool",
"bin/llvm-addr2line*",
"bin/llvm-bcanalyzer*",
"bin/llvm-cat*",
"bin/llvm-cfi-verify*",
"bin/llvm-cov*",
"bin/llvm-c-test*",
"bin/llvm-cvtres*",
"bin/llvm-cxxdump*",
"bin/llvm-cxxfilt*",
"bin/llvm-cxxmap*",
"bin/llvm-dwp*",
"bin/llvm-elfabi*",
"bin/llvm-exegesis*",
"bin/llvm-jitlink*",
"bin/llvm-lipo*",
"bin/llvm-lto*",
"bin/llvm-lto2*",
"bin/llvm-mc*",
"bin/llvm-mca*",
"bin/llvm-modextract*",
"bin/llvm-mt*",
"bin/llvm-opt-report*",
"bin/llvm-pdbutil*",
"bin/llvm-profdata*",
"bin/llvm-rc*",
"bin/llvm-rtdyld*",
"bin/llvm-size*",
"bin/llvm-split*",
"bin/llvm-stress*",
"bin/llvm-strings*",
"bin/llvm-symbolizer*",
"bin/llvm-tblgen*",
"bin/llvm-undname*",
"bin/llvm-xray*",
"bin/obj2yaml*",
"bin/sancov*",
"bin/sanstats*",
"bin/scan-build*",
"bin/scan-view*",
"bin/verify-uselistorder*",
"bin/yaml2obj*",
"bin/set-xcode-analyzer",
"share",
"include/clang",
"include/clang-c",
"include/lld",
"include/llvm",
"include/llvm-c",
"lib/cmake",
"lib/Checker*",
"lib/Sample*",
"lib/libRemarks*",
"lib/libLLVM*.a",
"lib/libclang.so*",
"lib/libclang.dylib*",
"lib/libclang*.a",
"lib/liblld*.a",
"libexec",
# the following is added by COMPILER_RT
"./lib/clang/*/lib/linux/*clang_rt*",
"lib/clang/*/lib/linux/*clang_rt*",
# Windows libarary excludes
"lib/*.lib",
]
},
"extracted-dependency:LLVM_ORG_COMPILER_RT_LINUX",
"file:3rd_party_license_llvm-toolchain.txt",
],
"./patches/" : "file:llvm-patches",
"./patches/" : "file:llvm-patches/*",
},
"platformDependent" : True,
"maven": False,
Expand All @@ -473,7 +482,7 @@
{
"source_type": "extracted-dependency",
"dependency": "LLVM_ORG",
"path": ".",
"path": "*",
"dereference": "never",
},
],
Expand Down
2 changes: 1 addition & 1 deletion sdk/mx.sdk/vm/exe_link_template.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

call :getScriptLocation location
"%location%<target>" %*
goto :eof
exit /b %errorlevel%

:: If this script is in `%PATH%` and called quoted without a full path (e.g., `"js"`), `%~dp0` is expanded to `cwd`
:: rather than the path to the script.
Expand Down
4 changes: 2 additions & 2 deletions sdk/mx.sdk/vm/launcher_template.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ if "%VERBOSE_GRAALVM_LAUNCHERS%"=="true" echo on

"%location%<jre_bin>\java" <extra_jvm_args> %jvm_args% -cp "%absolute_cp%" <main_class> %launcher_args%

exit /b %errorlevel%
:: Function are defined via labels, so have to be defined at the end of the file and skipped
:: in order not to be executed. :eof is implicitly defined.
goto :eof
:: in order not to be executed.

:escape_args
set "args=%*"
Expand Down
Loading

0 comments on commit a6a268b

Please sign in to comment.