From a2bda2ea92f142a876951f92c5a2ed37861bc15b Mon Sep 17 00:00:00 2001 From: jiang-dawei15 Date: Tue, 15 Mar 2022 09:50:10 +0800 Subject: [PATCH] cflages: add cflags '-ftls-model=initial-exec' This option changes the thread local storage (TLS) model. Thread-local storage is a mechanism by which variables are allocated in a way that causes one instance of the variable per extant thread. i.global-dynamic Generates a generic TLS code. The code can be used everywhere and the code can access variables defined anywhere else. This setting causes the largest size code to be generated and uses the most run time to produce. ii.local-dynamic Generates an optimized TLS code. To use this setting, the thread-local variables must be defined in the same object in which they are referenced. iii.initial-exec Generates a restrictive, optimized TLS code. To use this setting, the thread-local variables accessed must be defined in one of the modules available to the program. iv.local-exec Generates the most restrictive TLS code. To use this setting, the thread-local variables must be defined in the executable. Optimize qemu cflags with '-ftls-model=initial-exec' which means we use initial-exec mode. --- qemu.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index 9ae6a04..d2d8e81 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,6 +1,6 @@ Name: qemu Version: 6.2.0 -Release: 25 +Release: 26 Epoch: 2 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 @@ -383,7 +383,7 @@ cd ../ ./configure \ --prefix=%{_prefix} \ --target-list=${buildarch} \ - --extra-cflags="%{optflags} -fPIE -DPIE -fPIC" \ + --extra-cflags="%{optflags} -fPIE -DPIE -fPIC -ftls-model=initial-exec" \ --extra-ldflags="-Wl,--build-id -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack" \ --datadir=%{_datadir} \ --docdir=%{_docdir}/ \ @@ -682,6 +682,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Mar 15 2022 jiangdawei +- cflags: add ftls-mode=initial-exec + * Tue Mar 15 2022 yezengruan - sw_64: Add sw64 architecture support - update BinDir