diff --git a/.github/.ci/aosc/Dockerfile b/.github/.ci/aosc.Dockerfile similarity index 81% rename from .github/.ci/aosc/Dockerfile rename to .github/.ci/aosc.Dockerfile index fb3aa977cdd..079fd3b504a 100644 --- a/.github/.ci/aosc/Dockerfile +++ b/.github/.ci/aosc.Dockerfile @@ -24,4 +24,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ oma install -y systemd && \ oma install -y ${DEPENDENCIES} +ARG RUNNER_ARCH +RUN --mount=type=bind,source=install-static-clang.sh,target=/usr/local/bin/install-static-clang \ + [ -n "{RUNNER_ARCH}" ] && install-static-clang + RUN git config --global --add safe.directory /io diff --git a/.github/.ci/debian/Dockerfile b/.github/.ci/debian.Dockerfile similarity index 82% rename from .github/.ci/debian/Dockerfile rename to .github/.ci/debian.Dockerfile index d6cfe591030..24adb26a523 100644 --- a/.github/.ci/debian/Dockerfile +++ b/.github/.ci/debian.Dockerfile @@ -24,4 +24,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ apt-get update \ && apt-get install -y ${DEPENDENCIES} +ARG RUNNER_ARCH +RUN --mount=type=bind,source=install-static-clang.sh,target=/usr/local/bin/install-static-clang \ + [ -n "{RUNNER_ARCH}" ] && install-static-clang + RUN git config --global --add safe.directory /io diff --git a/.github/.ci/fedora/Dockerfile b/.github/.ci/fedora.Dockerfile similarity index 65% rename from .github/.ci/fedora/Dockerfile rename to .github/.ci/fedora.Dockerfile index ff01d329650..f629e3ddc09 100644 --- a/.github/.ci/fedora/Dockerfile +++ b/.github/.ci/fedora.Dockerfile @@ -2,18 +2,25 @@ FROM ghcr.io/fedora-remix-loongarch/mini-image:f43 ARG TARGETARCH ARG DEPENDENCIES=" \ + ccache \ + curl \ gcc \ + git \ g++ \ make \ - git \ ninja-build \ meson \ openssl-devel \ glib2-devel \ - tar" + tar \ + xz" RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \ dnf update -y \ && dnf install -y ${DEPENDENCIES} +ARG RUNNER_ARCH +RUN --mount=type=bind,source=install-static-clang.sh,target=/usr/local/bin/install-static-clang \ + [ -n "{RUNNER_ARCH}" ] && install-static-clang + RUN git config --global --add safe.directory /io diff --git a/.github/.ci/install-static-clang.sh b/.github/.ci/install-static-clang.sh new file mode 100755 index 00000000000..dee5271e458 --- /dev/null +++ b/.github/.ci/install-static-clang.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +# Stop at any error, show all commands +set -exuo pipefail + +TOOLCHAIN_PATH=/opt/clang + +# Download static-clang +DEFAULT_ARCH="$(uname -m)" +if [ "${STATIC_CLANG_ARCH:-}" == "" ]; then + STATIC_CLANG_ARCH="${RUNNER_ARCH:-${DEFAULT_ARCH}}" +fi +case "${STATIC_CLANG_ARCH}" in + ARM64|aarch64|arm64|arm64/*) GO_ARCH=arm64;; + ARM|armv7l|armv8l|arm|arm/v7) GO_ARCH=arm;; # assume arm/v7 for arm + X64|x86_64|amd64|amd64/*) GO_ARCH=amd64;; + X86|i686|386) GO_ARCH=386;; + loongarch64) GO_ARCH=loong64;; + ppc64le) GO_ARCH=ppc64le;; + riscv64) GO_ARCH=riscv64;; + s390x) GO_ARCH=s390x;; + *) echo "No static-clang toolchain for ${CLANG_ARCH}">2; exit 1;; +esac +STATIC_CLANG_VERSION=22.1.8.1 +STATIC_CLANG_FILENAME="static-clang-linux-${GO_ARCH}.tar.xz" +STATIC_CLANG_URL="https://github.com/mayeut/static-clang-images/releases/download/v${STATIC_CLANG_VERSION}/${STATIC_CLANG_FILENAME}" +pushd /tmp +cat<<'EOF' | grep "${STATIC_CLANG_FILENAME}" > "${STATIC_CLANG_FILENAME}.sha256" +f3f643d7d6b0a7fdce6060d1e05e00e0f00a71107b38b32280a02d1be67faa5d static-clang-linux-386.tar.xz +6a5419dbb658dd9c379e4cddc2a130d33aef458add0c7ccd1f529f12b0a4d67a static-clang-linux-amd64.tar.xz +8e789c1883562f5b51f2d0e4e74c3930e2a9cce1147c63553b4dd13d99f087e7 static-clang-linux-arm.tar.xz +380e282fcf11d716f15a57bafbdb6a35ca2018f58fa343a01cb0b274887ef988 static-clang-linux-arm64.tar.xz +54020fb3dee9e6af801f1f9f314f96368b7ea5aef460dc1cbda8a8527b88b78b static-clang-linux-loong64.tar.xz +f7a82ff0e2a9dbef1dd5ee8d5bbf8c8cbaf4c05e36ebd8ae969b8225c66f4b6d static-clang-linux-ppc64le.tar.xz +ee928c2a94b39e895c3e800fc2ea89c326e20d5daf4af37af6cf12fe4a3d1f03 static-clang-linux-riscv64.tar.xz +84f6508a7eaca447e91a15ce61b07eff7a38383255ef3de43b88f5ab7afe9ea9 static-clang-linux-s390x.tar.xz +EOF +curl -fsSLO "${STATIC_CLANG_URL}" +sha256sum -c "${STATIC_CLANG_FILENAME}.sha256" +tar -C /opt -xf "${STATIC_CLANG_FILENAME}" +popd + +# configure target triple +DEFAULT_POLICY="manylinux_2_38" +if ldd /bin/ls 2>&1 | grep -q 'musl'; then + DEFAULT_POLICY="musllinux_1_2" +fi +if [ "${AUDITWHEEL_POLICY:-}" == "" ]; then + AUDITWHEEL_POLICY="${DEFAULT_POLICY}" +fi +if [ "${AUDITWHEEL_ARCH:-}" == "" ]; then + AUDITWHEEL_ARCH="${DEFAULT_ARCH}" +fi +if [ "${AUDITWHEEL_PLAT:-}" == "" ]; then + AUDITWHEEL_PLAT="${AUDITWHEEL_POLICY}-${AUDITWHEEL_ARCH}" +fi +case "${AUDITWHEEL_PLAT}" in + manylinux*-armv7l) TARGET_TRIPLE=armv7-unknown-linux-gnueabihf;; + musllinux*-armv7l) TARGET_TRIPLE=armv7-alpine-linux-musleabihf;; + manylinux*-ppc64le) TARGET_TRIPLE=powerpc64le-unknown-linux-gnu;; + musllinux*-ppc64le) TARGET_TRIPLE=powerpc64le-alpine-linux-musl;; + manylinux*-*) TARGET_TRIPLE=${AUDITWHEEL_ARCH}-unknown-linux-gnu;; + musllinux*-*) TARGET_TRIPLE=${AUDITWHEEL_ARCH}-alpine-linux-musl;; +esac +case "${AUDITWHEEL_PLAT}" in + *-riscv64) M_ARCH="-march=rv64gc";; + *-x86_64) M_ARCH="-march=x86-64";; + *-armv7l) M_ARCH="-march=armv7a";; + manylinux*-i686) M_ARCH="-march=k8 -mtune=generic";; # same as gcc manylinux2014 / manylinux_2_28 + musllinux*-i686) M_ARCH="-march=pentium-m -mtune=generic";; # same as gcc musllinux_1_2 +esac +GCC_TRIPLE=$(gcc -dumpmachine) + +pushd "${TOOLCHAIN_PATH}/bin" +ln -s clang "${TOOLCHAIN_PATH}/bin/gcc" +ln -s clang "${TOOLCHAIN_PATH}/bin/cc" +ln -s clang-cpp "${TOOLCHAIN_PATH}/bin/cpp" +ln -s clang++ "${TOOLCHAIN_PATH}/bin/g++" +ln -s clang++ "${TOOLCHAIN_PATH}/bin/c++" +ln -s lld "${TOOLCHAIN_PATH}/bin/ld" +popd + +cat<"${TOOLCHAIN_PATH}/bin/${AUDITWHEEL_PLAT}.cfg" + -target ${TARGET_TRIPLE} + ${M_ARCH:-} + --gcc-toolchain=${DEVTOOLSET_ROOTPATH:-}/usr + --gcc-triple=${GCC_TRIPLE} +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang.cfg" + @${AUDITWHEEL_PLAT}.cfg + -fuse-ld=lld +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang++.cfg" + @${AUDITWHEEL_PLAT}.cfg + -fuse-ld=lld +EOF + +cat<"${TOOLCHAIN_PATH}/bin/clang-cpp.cfg" + @${AUDITWHEEL_PLAT}.cfg +EOF diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index f3a56014478..7565a7e2676 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -18,7 +18,7 @@ on: jobs: build: - runs-on: ${{ matrix.IMAGE.RUNNER }} + runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read @@ -30,9 +30,9 @@ jobs: fail-fast: false matrix: IMAGE: - - {TAG_NAME: "latx-runner-aosc:loong64", DOCKER_PLATFORM: "linux/loong64", DOCKERFILE_PATH: ".github/.ci/aosc", RUNNER: "ubuntu-latest"} - - {TAG_NAME: "latx-runner-debian:loong64", DOCKER_PLATFORM: "linux/loong64", DOCKERFILE_PATH: ".github/.ci/debian", RUNNER: "ubuntu-latest"} - - {TAG_NAME: "latx-runner-fedora:loongarch64", DOCKER_PLATFORM: "linux/loong64", DOCKERFILE_PATH: ".github/.ci/fedora", RUNNER: "ubuntu-latest"} + - {TAG_NAME: "latx-runner-aosc:loong64", DOCKER_PLATFORM: "linux/loong64", DOCKER_PATH: ".github/.ci", DOCKER_FILE: "aosc.Dockerfile"} + - {TAG_NAME: "latx-runner-debian:loong64", DOCKER_PLATFORM: "linux/loong64", DOCKER_PATH: ".github/.ci", DOCKER_FILE: "debian.Dockerfile"} + - {TAG_NAME: "latx-runner-fedora:loongarch64", DOCKER_PLATFORM: "linux/loong64", DOCKER_PATH: ".github/.ci", DOCKER_FILE: "fedora.Dockerfile"} name: "${{ matrix.IMAGE.TAG_NAME }}" steps: @@ -70,11 +70,11 @@ jobs: uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 id: docker-build with: - context: ${{ matrix.IMAGE.DOCKERFILE_PATH }} - cache-from: ghcr.io/${{ github.repository_owner }}/${{ matrix.IMAGE.TAG_NAME }} - tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.IMAGE.TAG_NAME }} + context: ${{ matrix.IMAGE.DOCKER_PATH }} + file: ${{ matrix.IMAGE.DOCKER_PATH }}/${{ matrix.IMAGE.DOCKER_FILE }} platforms: ${{ matrix.IMAGE.DOCKER_PLATFORM }} - pull: true + build-args: RUNNER_ARCH + tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.IMAGE.TAG_NAME }} push: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' }} - uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 541e083757c..ad2df3a5641 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,6 +67,7 @@ jobs: DOCKER_CMD="./latxbuild/${{ matrix.type.NAME }}.sh ${{ matrix.type.OPT }}" docker run --rm \ --platform linux/loong64 \ + --env RUNNER_ARCH \ --volume /tmp/.cache:/root/.cache \ --volume "$(pwd):/io" \ --workdir /io \ diff --git a/configure b/configure index efe200ff64a..7671e5e7938 100755 --- a/configure +++ b/configure @@ -1741,13 +1741,7 @@ if test "$latx" = "yes" ; then QEMU_LDFLAGS="$latx_ldflags $QEMU_LDFLAGS" ;; esac - if test "$debug" = "yes" ; then - # add `--export-dynamic`, used for backtrace - QEMU_LDFLAGS="-export-dynamic $QEMU_LDFLAGS" - else - QEMU_LDFLAGS="-export-dynamic $QEMU_LDFLAGS" - fi - QEMU_LDFLAGS="-lcrypto -lz $QEMU_LDFLAGS" + QEMU_LDFLAGS="-fuse-ld=bfd -Wl,--export-dynamic -lcrypto -lz $QEMU_LDFLAGS" else echo "build for target $target_list" if test "$target_list" = "x86_64-linux-user" ; then diff --git a/latxbuild/build-release.sh b/latxbuild/build-release.sh index 20f9ee0c5a8..921d303e3d8 100755 --- a/latxbuild/build-release.sh +++ b/latxbuild/build-release.sh @@ -8,6 +8,10 @@ srcdir=$(realpath "$(dirname "$0")/../") pkgdir=$srcdir/pkg tarballs=$pkgname-$pkgver-$pkgdate.tar.xz +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + prepare() { [ -d $srcdir/build32 ] || mkdir -p $srcdir/build32 [ -d $srcdir/build64 ] || mkdir -p $srcdir/build64 diff --git a/latxbuild/build32-dbg.sh b/latxbuild/build32-dbg.sh index 3180d686683..4eae8a2dde0 100755 --- a/latxbuild/build32-dbg.sh +++ b/latxbuild/build32-dbg.sh @@ -6,6 +6,10 @@ opt_level=1 low_mem_mode="" avx_support="" +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/build32.sh b/latxbuild/build32.sh index c63a14af6e1..549036a6702 100755 --- a/latxbuild/build32.sh +++ b/latxbuild/build32.sh @@ -6,6 +6,10 @@ opt_level=1 low_mem_mode="" avx_support="" +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/build64-dbg.sh b/latxbuild/build64-dbg.sh index 666582f7e72..7f2e94fc9c8 100755 --- a/latxbuild/build64-dbg.sh +++ b/latxbuild/build64-dbg.sh @@ -5,6 +5,10 @@ make_configure=0 opt_level=1 avx_support="" +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/build64.sh b/latxbuild/build64.sh index 9de3bfa89f9..8c3d75409ef 100755 --- a/latxbuild/build64.sh +++ b/latxbuild/build64.sh @@ -6,6 +6,10 @@ opt_level=1 low_mem_mode="" avx_support="" +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/buildtcg32-dbg.sh b/latxbuild/buildtcg32-dbg.sh index e543fa3391f..b297241cc0b 100755 --- a/latxbuild/buildtcg32-dbg.sh +++ b/latxbuild/buildtcg32-dbg.sh @@ -3,6 +3,10 @@ set -e make_configure=0 +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/buildtcg32.sh b/latxbuild/buildtcg32.sh index 34810dee27b..ec551ca5ded 100755 --- a/latxbuild/buildtcg32.sh +++ b/latxbuild/buildtcg32.sh @@ -3,6 +3,10 @@ set -e make_configure=0 +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/buildtcg64-dbg.sh b/latxbuild/buildtcg64-dbg.sh index 6c901769418..16258e09d97 100755 --- a/latxbuild/buildtcg64-dbg.sh +++ b/latxbuild/buildtcg64-dbg.sh @@ -3,6 +3,10 @@ set -e make_configure=0 +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/latxbuild/buildtcg64.sh b/latxbuild/buildtcg64.sh index 9682103d67f..674fa8a2b15 100755 --- a/latxbuild/buildtcg64.sh +++ b/latxbuild/buildtcg64.sh @@ -3,6 +3,10 @@ set -e make_configure=0 +if [ -n "${RUNNER_ARCH}" ] && [ -d "/opt/clang/bin" ]; then + export PATH=/opt/clang/bin:$PATH +fi + help() { echo "Usage:" echo " -c configure" diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 7c0be316ef1..fdf313a0003 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -250,11 +250,13 @@ __asm__(".macro parse_v var val\n\t" __asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" + _IFC_REG(a0,4) _IFC_REG(a1,5) _IFC_REG(a2,6) _IFC_REG(a3,7) + _IFC_REG(fp,22) _IFC_REG(r0,0) _IFC_REG(r1,1) _IFC_REG(r2,2) _IFC_REG(r3,3) _IFC_REG(r4,4) _IFC_REG(r5,5) _IFC_REG(r6,6) _IFC_REG(r7,7) _IFC_REG(r8,8) _IFC_REG(r9,9) _IFC_REG(r10,10) _IFC_REG(r11,11) _IFC_REG(r12,12) _IFC_REG(r13,13) _IFC_REG(r14,14) _IFC_REG(r15,15) - _IFC_REG(r16,16) _IFC_REG(r17,17) _IFC_REG(r18,18) _IFC_REG(r17,19) + _IFC_REG(r16,16) _IFC_REG(r17,17) _IFC_REG(r18,18) _IFC_REG(r19,19) _IFC_REG(r20,20) _IFC_REG(r21,21) _IFC_REG(r22,22) _IFC_REG(r23,23) _IFC_REG(r24,24) _IFC_REG(r25,25) _IFC_REG(r26,26) _IFC_REG(r27,27) _IFC_REG(r28,28) _IFC_REG(r29,29) _IFC_REG(r30,30) _IFC_REG(r31,31) diff --git a/target/i386/latx/include/reg-alloc.h b/target/i386/latx/include/reg-alloc.h index 82ad4b67da8..f3feacd1500 100644 --- a/target/i386/latx/include/reg-alloc.h +++ b/target/i386/latx/include/reg-alloc.h @@ -188,24 +188,27 @@ void imm_cache_free_temp_helper(IR2_OPND dest_op); IR2_OPND ra_alloc_st(int); IR2_OPND ra_alloc_mda(void); -#define _IFC_REG(n) \ - ".ifc \\r, $r" #n "\n\t" \ - "\\var = " #n "\n\t" \ - ".endif\n\t" +/* Match an individual register number and assign to \var */ +#define _IFC_REG(r, n) \ + ".ifc \\r, $" #r "\n\t" \ + "\\var = " #n "\n\t" \ + ".endif\n\t" - __asm__(".macro parse_r var r, imm\n\t" - "\\var = -1\n\t" - _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) - _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) - _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) - _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) - _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) - _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) - _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) - _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) - ".iflt \\var\n\t" - ".error \"Unable to parse register name \\r\"\n\t" - ".endif\n\t" - ".endm"); +__asm__(".macro parse_r var r, imm\n\t" + "\\var = -1\n\t" + _IFC_REG(a0,4) _IFC_REG(a1,5) _IFC_REG(a2,6) _IFC_REG(a3,7) + _IFC_REG(fp,22) + _IFC_REG(r0,0) _IFC_REG(r1,1) _IFC_REG(r2,2) _IFC_REG(r3,3) + _IFC_REG(r4,4) _IFC_REG(r5,5) _IFC_REG(r6,6) _IFC_REG(r7,7) + _IFC_REG(r8,8) _IFC_REG(r9,9) _IFC_REG(r10,10) _IFC_REG(r11,11) + _IFC_REG(r12,12) _IFC_REG(r13,13) _IFC_REG(r14,14) _IFC_REG(r15,15) + _IFC_REG(r16,16) _IFC_REG(r17,17) _IFC_REG(r18,18) _IFC_REG(r19,19) + _IFC_REG(r20,20) _IFC_REG(r21,21) _IFC_REG(r22,22) _IFC_REG(r23,23) + _IFC_REG(r24,24) _IFC_REG(r25,25) _IFC_REG(r26,26) _IFC_REG(r27,27) + _IFC_REG(r28,28) _IFC_REG(r29,29) _IFC_REG(r30,30) _IFC_REG(r31,31) + ".iflt \\var\n\t" + ".error \"Unable to parse register name \\r\"\n\t" + ".endif\n\t" + ".endm"); #endif diff --git a/target/i386/latx/sbt/aot_recover_tb.c b/target/i386/latx/sbt/aot_recover_tb.c index 334c78cb436..07cec45da8f 100644 --- a/target/i386/latx/sbt/aot_recover_tb.c +++ b/target/i386/latx/sbt/aot_recover_tb.c @@ -214,8 +214,12 @@ static void recover_tb_range(target_ulong page, struct aot_tb *p_aot_tbs, /* Reserve space for tu tbmin table. */ TBMini *tbmini_ptr= (TBMini *) ROUND_UP((uintptr_t)tcg_ctx->code_gen_ptr, CODE_GEN_ALIGN); - qatomic_set(&tcg_ctx->code_gen_ptr, ROUND_UP((uintptr_t)tbmini_ptr + - sizeof(struct TBMini) * (tb_num_in_tu + 1), qemu_icache_linesize)); + uintptr_t code_gen_addr = + ROUND_UP((uintptr_t)tbmini_ptr + + sizeof(struct TBMini) * (tb_num_in_tu + 1), + qemu_icache_linesize); + qatomic_set(&tcg_ctx->code_gen_ptr, + (__typeof__(tcg_ctx->code_gen_ptr))code_gen_addr); /* First tbm save tb_num_in_tu and TB_MAGIC. */ aot_tbmini_set_pointer((uintptr_t)tbmini_ptr, tb_num_in_tu, TB_MAGIC); for (int k = i; k < j; k++) {