Skip to content

Commit 6b56a41

Browse files
mralephCommit Queue
authored andcommitted
Revert "[pkg/vm] Handle cross compilation in the precompiler2 sc..."
Revert changes to precompiler2 and dart_precompiled_runtime. Reason for revert: Golem is broken because host_arch helper does not handle aarch64 as a possibility (which is what we get from uname on these machines). Reverted changes: /q/submissionid:404600 Change-Id: I88cbaba2a369d6deeca0866ef28dc220ca4bf4d6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405641 Bot-Commit: Rubber Stamper <[email protected]> Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Slava Egorov <[email protected]>
1 parent 8ec312c commit 6b56a41

File tree

2 files changed

+11
-103
lines changed

2 files changed

+11
-103
lines changed

pkg/vm/tool/precompiler2

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
set -e
1616

1717
function follow_links() {
18-
local file="$1"
18+
file="$1"
1919
while [ -h "$file" ]; do
2020
# On Mac OS, readlink -f doesn't work.
2121
file="$(readlink "$file")"
@@ -31,8 +31,6 @@ CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
3131

3232
SDK_DIR="$CUR_DIR/../../.."
3333

34-
. "$CUR_DIR/shared_functions.sh"
35-
3634
OPTIONS=()
3735
GEN_KERNEL_OPTIONS=()
3836
PACKAGES=
@@ -100,36 +98,18 @@ else
10098
OUT_DIR="$SDK_DIR/out"
10199
fi
102100

103-
HOST_ARCH="$(host_arch)"
101+
HOST_ARCH="X64"
102+
if [[ `uname -m` == 'arm64' ]]; then
103+
HOST_ARCH="ARM64"
104+
fi
104105

105106
export DART_CONFIGURATION=${DART_CONFIGURATION:-Release$HOST_ARCH}
106-
TARGET_ARCH="$(parse_target_arch "$DART_CONFIGURATION")"
107107
BUILD_DIR="$OUT_DIR/$DART_CONFIGURATION"
108-
if [ ! -d "$BUILD_DIR" ]; then
109-
echo "$BUILD_DIR is not a directory"
110-
exit 1
111-
fi
112-
113-
function find_dart {
114-
local tools_dart="${SDK_DIR}/tools/sdks/dart-sdk/bin/dart"
115-
if [ -f "$tools_dart" ]; then
116-
echo "$tools_dart"
117-
else
118-
local host_dart=""
119-
if [[ "$HOST_ARCH" == "$TARGET_ARCH" ]]; then
120-
host_dart="$BUILD_DIR/dart"
121-
else
122-
host_dart="$OUT_DIR/Release$HOST_ARCH/dart"
123-
fi
124-
if [ ! -f "$host_dart" ]; then
125-
echo "Cannot find dart at either $tools_dart or $host_dart"
126-
exit 1
127-
fi
128-
echo "$host_dart"
129-
fi
130-
}
131108

132-
DART="$(find_dart)"
109+
DART="${SDK_DIR}/tools/sdks/dart-sdk/bin/dart"
110+
if [ ! -f "$DART" ]; then
111+
DART="$BUILD_DIR/dart"
112+
fi
133113

134114
function gen_kernel() {
135115
if [[ "$DART_GN_ARGS" == *"precompile_tools=true"* ]]; then
@@ -149,29 +129,10 @@ gen_kernel --platform "${BUILD_DIR}/vm_platform_strong.dill" \
149129
-o "$SNAPSHOT_FILE.dill" \
150130
"$SOURCE_FILE"
151131

152-
GEN_SNAPSHOT="gen_snapshot"
153-
# If the target architecture differs from the host architecture, use
154-
# gen_snapshot for the host architecture for cross compilation, which is
155-
# denoted by an X between the build mode and the architecture name,
156-
# e.g., ReleaseXARM64 on X64.
157-
if [[ ( "$DART_CONFIGURATION" =~ (Debug|Release|Product)X[^6] ) && \
158-
( "$HOST_ARCH" != "$TARGET_ARCH" ) ]]; then
159-
case "$HOST_ARCH" in
160-
"X64")
161-
GEN_SNAPSHOT="clang_x64/${GEN_SNAPSHOT}"
162-
;;
163-
"ARM64")
164-
GEN_SNAPSHOT="clang_arm64/${GEN_SNAPSHOT}"
165-
;;
166-
*)
167-
echo "Unexpected host architecture $HOST_ARCH for cross compilation"
168-
exit 1
169-
;;
170-
esac
171-
fi
132+
172133

173134
# Step 2: Generate snapshot from the Kernel binary.
174-
${BUILD_DIR}/${GEN_SNAPSHOT} \
135+
"$BUILD_DIR"/gen_snapshot \
175136
${GEN_SNAPSHOT_FLAGS} \
176137
"$GEN_SNAPSHOT_OPTION" \
177138
"$GEN_SNAPSHOT_FILENAME" \

pkg/vm/tool/shared_functions.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)