Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add green text for info message. #20

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bin/elfconv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ main() {
fi

# build runtime
echo "[INFO] Building elfconv-Runtime ..."
echo -e "[\033[32mINFO\033[0m] Building elfconv-Runtime ..."
if [ "$TARGET" = "wasm-host" ]; then
WASMCC=$WASISDKCXX
WASMCCFLAGS=$WASISDKFLAGS
Expand All @@ -56,35 +56,35 @@ main() {
$WASMAR rcs libelfconv.a Entry.o Memory.o Syscall.o VmIntrinsics.o Util.o elfconv.o
mv libelfconv.a "${BIN_DIR}/"
rm *.o
echo "[INFO] Generate libelfconv.a."
echo -e "[\033[32mINFO\033[0m] Generate libelfconv.a."

# ELF -> LLVM bc
cp -p "${BUILD_LIFTER_DIR}/elflift" "${BIN_DIR}/"
echo "[INFO] Converting ELF to LLVM bitcode ..."
echo -e "[\033[32mINFO\033[0m] Converting ELF to LLVM bitcode ..."
cd "${BIN_DIR}" || { echo "cd Failure"; exit 1; }
./elflift \
--arch aarch64 \
--bc_out lift.bc \
--target_elf "$ELFPATH" \
--dbg_fun_cfg "$2"
echo "[INFO] Generate lift.bc."
echo -e "[\033[32mINFO\033[0m] Generate lift.bc."

# LLVM bc -> target file
case "$TARGET" in
wasm-browser)
echo "[INFO] Converting LLVM bitcode to WASM binary (for browser) ..."
echo -e "[\033[32mINFO\033[0m] Converting LLVM bitcode to WASM binary (for browser) ..."
cd "${BIN_DIR}" || { echo "cd Failure"; exit 1; }
$WASMCC -c lift.bc -o lift.o && \
$WASMCC -o exe.wasm.html -L"./" -sWASM -sALLOW_MEMORY_GROWTH lift.o -lelfconv
echo "[INFO] Generate WASM binary."
echo -e "[\033[32mINFO\033[0m] Generate WASM binary."
return 0
;;
wasm-host)
echo "[INFO] Converting LLVM bitcode to WASM binary (for server) ..."
echo -e "[\033[32mINFO\033[0m] Converting LLVM bitcode to WASM binary (for server) ..."
cd "${BIN_DIR}" || { echo "cd Failure"; exit 1; }
$WASMCC -c lift.bc -o lift.o && \
$WASMCC -o exe.wasm -L"./" lift.o -lelfconv
echo "[INFO] Generate WASM binary."
echo -e "[\033[32mINFO\033[0m] Generate WASM binary."
return 0
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion lifter/Lift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ int main(int argc, char *argv[]) {
host_arch->PrepareModule(module.get());
remill::StoreModuleToFile(module.get(), FLAGS_bc_out);

printf("[INFO] Lift Done.\n");
printf("[\033[32mINFO\033[0m] Lift Done.\n");
return 0;
}