File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed
Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 3333export DART_CONFIGURATION=${DART_CONFIGURATION:- ReleaseX64}
3434BIN_DIR=" $OUT_DIR$DART_CONFIGURATION "
3535
36- OPTIONS=()
37- SNAPSHOT=()
38- for arg in " $@ " ; do
39- case $arg in
40- --* )
41- OPTIONS+=(" $arg " )
42- ;;
43- * )
44- SNAPSHOT=" $arg "
45- ;;
46- esac
47- done
48-
49- # Pass an absolute file path to the snapshot so that the dynamic linker can find
50- # ELF snapshots which are not in the system load path.
51- SNAPSHOT=$( realpath " $SNAPSHOT " )
52-
53- exec " $BIN_DIR " /dart_precompiled_runtime " ${OPTIONS[@]} " " $SNAPSHOT "
36+ exec " $BIN_DIR " /dart_precompiled_runtime " $@ "
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ #include < memory>
6+
57#include " bin/snapshot_utils.h"
68
79#include " bin/dartutils.h"
@@ -240,7 +242,17 @@ AppSnapshot* Snapshot::TryReadAppSnapshot(const char* script_name) {
240242#if defined(DART_PRECOMPILED_RUNTIME)
241243 // For testing AOT with the standalone embedder, we also support loading
242244 // from a dynamic library to simulate what happens on iOS.
245+
246+ #if defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS)
247+ // On Linux and OSX, resolve the script path before passing into dlopen()
248+ // since dlopen will not search the filesystem for paths like 'libtest.so'.
249+ std::unique_ptr<char , decltype (std::free)*> absolute_path{
250+ realpath (script_name, nullptr ), std::free};
251+ script_name = absolute_path.get ();
252+ #endif
253+
243254 snapshot = TryReadAppSnapshotDynamicLibrary (script_name);
255+
244256 if (snapshot != NULL ) {
245257 return snapshot;
246258 }
You can’t perform that action at this time.
0 commit comments