Add xtensa AOT support and fix build issue of alios (#223)
* Clean compiling warnings of zephyr samples * Support xtensa AOT and fix build issue of alios
This commit is contained in:
44
wamr-compiler/build_llvm_xtensa.sh
Executable file
44
wamr-compiler/build_llvm_xtensa.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
DEPS_DIR=${PWD}/../core/deps
|
||||
|
||||
cd ${DEPS_DIR}
|
||||
if [ ! -d "llvm" ]; then
|
||||
echo "Clone llvm Xtensa to core/deps/ .."
|
||||
git clone https://github.com/espressif/llvm-project.git llvm
|
||||
fi
|
||||
|
||||
cd llvm
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [ ! -f bin/llvm-lto ]; then
|
||||
|
||||
CORE_NUM=$(nproc --all)
|
||||
if [ -z "${CORE_NUM}" ]; then
|
||||
CORE_NUM=1
|
||||
fi
|
||||
|
||||
echo "Build llvm with" ${CORE_NUM} "cores"
|
||||
|
||||
cmake ../llvm \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING="Xtensa" \
|
||||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
|
||||
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
|
||||
-DLLVM_APPEND_VC_REV:BOOL=OFF
|
||||
make -j ${CORE_NUM}
|
||||
|
||||
else
|
||||
echo "llvm has already been built"
|
||||
fi
|
||||
|
||||
cd ${PWD}
|
||||
|
||||
@ -14,7 +14,7 @@ print_help()
|
||||
{
|
||||
printf("Usage: wamrc [options] -o output_file wasm_file\n");
|
||||
printf(" --target=<arch-name> Set the target arch, which has the general format: <arch><sub>\n");
|
||||
printf(" <arch> = x86_64, i386, aarch64, arm, thumb, mips.\n");
|
||||
printf(" <arch> = x86_64, i386, aarch64, arm, thumb, xtensa, mips.\n");
|
||||
printf(" Default is host arch, e.g. x86_64\n");
|
||||
printf(" <sub> = for ex. on arm or thumb: v5, v6m, v7a, v7m, etc.\n");
|
||||
printf(" Use --target=help to list supported targets\n");
|
||||
|
||||
Reference in New Issue
Block a user