Skip to content

Commit

Permalink
Revert "qemu: fix resource exhaustion building QEMU TCTI"
Browse files Browse the repository at this point in the history
This reverts commit 9f6ab1d.

Fixes #4516
  • Loading branch information
osy committed Oct 21, 2022
1 parent e9cb872 commit 75efcca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 67 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
- name: Build Sysroot
if: steps.cache-sysroot.outputs.cache-hit != 'true' || github.event.inputs.rebuild_sysroot == 'true'
run: ./scripts/build_dependencies.sh -p ${{ matrix.platform }} -a ${{ matrix.arch }}
env:
NCPU: ${{ matrix.platform == 'ios-tci' && '1' || '0' }} # limit 1 CPU for TCI build due to memory issues, 0 = unlimited for other builds
- name: Compress Sysroot
if: steps.cache-sysroot.outputs.cache-hit != 'true' || github.event_name == 'release' || github.event.inputs.test_release == 'true'
run: tar -acf sysroot.tgz sysroot*
Expand Down
67 changes: 0 additions & 67 deletions patches/qemu-7.0.0-utm.patch
Original file line number Diff line number Diff line change
Expand Up @@ -594,70 +594,3 @@ index e139f7115e1f..765892f84f1c 100644
qemu_console_get_height(s, -1) == height) {
return;
}
From 7f65c39e6865763cb8a614a8903b25f23a9a8683 Mon Sep 17 00:00:00 2001
From: osy <[email protected]>
Date: Fri, 19 Aug 2022 14:07:10 -0700
Subject: [PATCH] tcg-tcti: fix memory usage issues with clang build

Build with -O0 to avoid blowing up the memory during build.
---
meson.build | 12 ++++++++++++
tcg/meson.build | 8 +++++++-
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d66b73d009..b144789c5e 100644
--- a/meson.build
+++ b/meson.build
@@ -2649,6 +2649,7 @@ qom_ss = ss.source_set()
softmmu_ss = ss.source_set()
specific_fuzz_ss = ss.source_set()
specific_ss = ss.source_set()
+specific_nooptimize_ss = ss.source_set()
stub_ss = ss.source_set()
trace_ss = ss.source_set()
user_ss = ss.source_set()
@@ -3217,6 +3218,17 @@ foreach target : target_dirs
arch_srcs += target_specific.sources()
arch_deps += target_specific.dependencies()

+ nooptimize_ss = specific_nooptimize_ss.apply(config_target, strict: false)
+ if nooptimize_ss.sources().length() > 0
+ libnooptimize = static_library('qemu-' + target + '-nooptimize',
+ sources: genh + nooptimize_ss.sources(),
+ include_directories: target_inc,
+ dependencies: nooptimize_ss.dependencies(),
+ c_args: c_args + '-O0')
+ nooptimize = declare_dependency(link_whole: libnooptimize)
+ arch_deps += nooptimize
+ endif
+
if config_all.has_key('CONFIG_SHARED_LIBRARY_BUILD')
build_lib_args = {
'target_type': 'shared_library',
diff --git a/tcg/meson.build b/tcg/meson.build
index c4c63b19d4..16c226e114 100644
--- a/tcg/meson.build
+++ b/tcg/meson.build
@@ -3,7 +3,6 @@ tcg_ss = ss.source_set()
tcg_ss.add(files(
'optimize.c',
'region.c',
- 'tcg.c',
'tcg-common.c',
'tcg-op.c',
'tcg-op-gvec.c',
@@ -18,3 +17,10 @@ if get_option('tcg_interpreter')
endif

specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
+
+# TCTI requires -O0 or otherwise clang memory usage blows up
+if get_option('tcg_threaded_interpreter')
+ specific_nooptimize_ss.add(when: 'CONFIG_TCG', if_true: files('tcg.c'))
+else
+ specific_ss.add(when: 'CONFIG_TCG', if_true: files('tcg.c'))
+endif
--
2.28.0

0 comments on commit 75efcca

Please sign in to comment.