runs global constructors and part of qemu_init_subsystems

This commit is contained in:
Jacob Lifshay 2026-04-07 03:02:33 -07:00
parent 2fa256098d
commit b13cfd87f4
Signed by: programmerjake
SSH key fingerprint: SHA256:HnFTLGpSm4Q4Fj502oCFisjZSoakwEuTsJJMSke63RQ
3 changed files with 984 additions and 200 deletions

View file

@ -20,7 +20,7 @@ function build-qemu() (
cd "$QEMU_BUILD"
export CC="clang-20 --target=powerpc64le-linux-gnu"
export CXX="clang++-20 --target=powerpc64le-linux-gnu"
export LD="clang++-20 --target=powerpc64le-linux-gnu"
export LDFLAGS="-fuse-ld=lld-20 -Wl,--lto-emit-llvm -Wl,--lto-O0"
export AR="llvm-ar-20"
"../$QEMU_SOURCE/configure" \
--target-list=ppc64-softmmu \
@ -28,21 +28,9 @@ function build-qemu() (
--enable-tcg-interpreter \
--without-default-features \
--cross-prefix=powerpc64le-linux-gnu-
target="$(ninja -t query qemu-system-ppc64)"
mapfile -t target_lines <<<"$target"
# add missed libs
link_inputs=(libpage-vary-common.a libqemuutil.a)
# add the rest of the libs and object files
for l in "${target_lines[@]}"; do
if [[ "$l" =~ ^' '([a-z].*)$ ]]; then
link_inputs+=("${BASH_REMATCH[1]}")
elif [[ "$l" == " outputs:" ]]; then
break
fi
done
make -j"$(nproc)" qemu-system-ppc64
echo "linking bitcode"
llvm-link-20 --only-needed --ignore-non-bitcode -o ../qemu-system-ppc64.bc "${link_inputs[@]}"
echo "copying bitcode"
cp qemu-system-ppc64 ../qemu-system-ppc64.bc
echo "disassembling bitcode"
llvm-dis-20 -o ../qemu-system-ppc64.ll ../qemu-system-ppc64.bc
)

View file

@ -32,7 +32,7 @@ POUND_HEADER=('^"# SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"# See Notice
SLASH_HEADER=('^"// SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"// See Notices.txt for copyright information"$')
MD_HEADER=('^"<!--"$' '^"SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"See Notices.txt for copyright information"$')
JSON_HEADER=('^"{"$' '^" \"license_header\": ["$' '^" \"SPDX-License-Identifier: LGPL-3.0-or-later\","$' '^" \"See Notices.txt for copyright information\""')
ROCQ_HEADER=('^"(* SPDX-License-Identifier: LGPL-3.0-or-later"$' '^" See Notices.txt for copyright information *)"$')
LL_HEADER=('^"; SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"; See Notices.txt for copyright information"$')
function main()
{
@ -62,8 +62,8 @@ function main()
*.json)
check_file "$file" "${JSON_HEADER[@]}"
;;
*.v)
check_file "$file" "${ROCQ_HEADER[@]}"
*.ll)
check_file "$file" "${LL_HEADER[@]}"
;;
*)
fail_file "$file" 0 "unimplemented file kind -- you need to add it to $0"

1160
src/lib.rs

File diff suppressed because it is too large Load diff