From nobody Tue Feb 10 06:42:56 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1597760471; cv=none; d=zohomail.com; s=zohoarc; b=YteqzT+h9ffw69ZydZ15rc+7QbfEVzpFVpRHOHeJGZcfx1ZCPpi69bWJX+tUGML10WfGgFMJ2aQfOf2Z0XPlJhTWq9idsF0YiSVg8CcLTlytKZRXP6pzDTpooDLDc+kJQwHrZ7nYAko7baW43GjPmCFlhm2rlRC5lcYqMbeq8bE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597760471; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/9cnuSUY7R8bNQaayK9fc2xPxyOR/SLBtuCwfgtQfHE=; b=oAFk5IMP5P8eIVFpFCnlCC/6ZXFMjvelQEWKhDlJoEmp2lIZvYYavKLrJsLbEEl02YrV6oDLeaXHkleBpj8ncOQp0nLQ3K+KyOG6zQgRdVCGiRQdmq1XH+kur5ATYGNpui3/FQpmXp6+1EbEjUMM8v90ixFt3CNw/jW6vR8TH1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597760471017483.27364913397787; Tue, 18 Aug 2020 07:21:11 -0700 (PDT) Received: from localhost ([::1]:45320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k82U9-00040s-KU for importer@patchew.org; Tue, 18 Aug 2020 10:21:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k82K9-0003AD-6b for qemu-devel@nongnu.org; Tue, 18 Aug 2020 10:10:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k82K5-0007Jf-1L for qemu-devel@nongnu.org; Tue, 18 Aug 2020 10:10:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-0lFcxY2DM9q4QeNlPs6XTA-1; Tue, 18 Aug 2020 10:10:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51E1F100CA89 for ; Tue, 18 Aug 2020 14:10:41 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20C2EBA63 for ; Tue, 18 Aug 2020 14:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597759843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/9cnuSUY7R8bNQaayK9fc2xPxyOR/SLBtuCwfgtQfHE=; b=TTImaufKUN1yRhJwZTXwPMLTBrQRRfXjloO3hpp0g/vuumz6LCm/27+cHQWXOxS49HEtgJ /G8Vy8EeERRivLDgk1VDbbZtAa/yVgypw6MHU1bEWTEhGmn/Xoc6AqpWqpaIw/PaUZbUTw UQesYfjsXugmnCnSwyJJWwpWBgDPtjQ= X-MC-Unique: 0lFcxY2DM9q4QeNlPs6XTA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 014/150] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson Date: Tue, 18 Aug 2020 10:08:09 -0400 Message-Id: <20200818141025.21608-15-pbonzini@redhat.com> In-Reply-To: <20200818141025.21608-1-pbonzini@redhat.com> References: <20200818141025.21608-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 03:22:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Split between CFLAGS/QEMU_CFLAGS and CXXFLAGS/QEMU_CXXFLAGS so that we will use CFLAGS and CXXFLAGS for flags that we do not want to pass to add_project_arguments. Signed-off-by: Paolo Bonzini --- configure | 78 ++++++++++++++++++++----------------------- rules.mak | 4 +-- softmmu/Makefile.objs | 2 +- 3 files changed, 40 insertions(+), 44 deletions(-) diff --git a/configure b/configure index 373bb22287..42f0c1c20b 100755 --- a/configure +++ b/configure @@ -107,15 +107,12 @@ update_cxxflags() { # options which some versions of GCC's C++ compiler complain about # because they only make sense for C programs. QEMU_CXXFLAGS=3D"$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTAN= T_MACROS -D__STDC_FORMAT_MACROS" - + CXXFLAGS=3D$(echo "$CFLAGS" | sed s/-std=3Dgnu99/-std=3Dgnu++11/) for arg in $QEMU_CFLAGS; do case $arg in -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ -Wold-style-declaration|-Wold-style-definition|-Wredundant-dec= ls) ;; - -std=3Dgnu99) - QEMU_CXXFLAGS=3D${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }"-std=3Dg= nu++98" - ;; *) QEMU_CXXFLAGS=3D${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg ;; @@ -125,13 +122,13 @@ update_cxxflags() { =20 compile_object() { local_cflags=3D"$1" - do_cc $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC + do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC } =20 compile_prog() { local_cflags=3D"$1" local_ldflags=3D"$2" - do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $QEMU_LDFLAGS $local_ldf= lags + do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $QEMU_L= DFLAGS $local_ldflags } =20 # symbolically link $1 to $2. Portable version of "ln -sf". @@ -597,15 +594,14 @@ ARFLAGS=3D"${ARFLAGS-rv}" # left shift of signed integers is well defined and has the expected # 2s-complement style results. (Both clang and gcc agree that it # provides these semantics.) -QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv -std=3Dgnu99 $QEMU= _CFLAGS" -QEMU_CFLAGS=3D"-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CF= LAGS" +QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" +QEMU_CFLAGS=3D"-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS=3D"-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS=3D"-D_GNU_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE = $QEMU_CFLAGS" QEMU_INCLUDES=3D"-iquote . -iquote ${source_path} -iquote ${source_path}/a= ccel/tcg -iquote ${source_path}/include" QEMU_INCLUDES=3D"$QEMU_INCLUDES -iquote ${source_path}/disas/libvixl" -if test "$debug_info" =3D "yes"; then - CFLAGS=3D"-g $CFLAGS" -fi +CFLAGS=3D"-std=3Dgnu99 -Wall" + =20 # running configure in the source tree? # we know that's the case if configure is there. @@ -886,7 +882,6 @@ SunOS) QEMU_CFLAGS=3D"-D_XOPEN_SOURCE=3D600 $QEMU_CFLAGS" # needed for TIOCWIN* defines in termios.h QEMU_CFLAGS=3D"-D__EXTENSIONS__ $QEMU_CFLAGS" - QEMU_CFLAGS=3D"-std=3Dgnu99 $QEMU_CFLAGS" solarisnetlibs=3D"-lsocket -lnsl -lresolv" LIBS=3D"$solarisnetlibs $LIBS" libs_qga=3D"$solarisnetlibs $libs_qga" @@ -2109,7 +2104,7 @@ EOF for flag in $gcc_flags; do # We need to check both a compile and a link, since some compiler # setups fail only on a .c->.o compile and some only at link time - if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && + if compile_object "-Werror $flag" && compile_prog "-Werror $flag" ""; then QEMU_CFLAGS=3D"$QEMU_CFLAGS $flag" QEMU_LDFLAGS=3D"$QEMU_LDFLAGS $flag" @@ -2184,7 +2179,7 @@ fi =20 if test "$static" =3D "yes"; then if test "$pie" !=3D "no" && compile_prog "-Werror -fPIE -DPIE" "-static-= pie"; then - QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" + CFLAGS=3D"-fPIE -DPIE $CFLAGS" QEMU_LDFLAGS=3D"-static-pie $QEMU_LDFLAGS" pie=3D"yes" elif test "$pie" =3D "yes"; then @@ -2194,11 +2189,11 @@ if test "$static" =3D "yes"; then pie=3D"no" fi elif test "$pie" =3D "no"; then - QEMU_CFLAGS=3D"$CFLAGS_NOPIE $QEMU_CFLAGS" - QEMU_LDFLAGS=3D"$LDFLAGS_NOPIE $QEMU_LDFLAGS" + CFLAGS=3D"$CFLAGS_NOPIE $CFLAGS" + LDFLAGS=3D"$LDFLAGS_NOPIE $LDFLAGS" elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then - QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" - QEMU_LDFLAGS=3D"-pie $QEMU_LDFLAGS" + CFLAGS=3D"-fPIE -DPIE $CFLAGS" + LDFLAGS=3D"-pie $LDFLAGS" pie=3D"yes" elif test "$pie" =3D "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -3981,7 +3976,7 @@ EOF if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then if cc_has_warning_flag "-Wno-unknown-attributes"; then glib_cflags=3D"-Wno-unknown-attributes $glib_cflags" - CFLAGS=3D"-Wno-unknown-attributes $CFLAGS" + QEMU_CFLAGS=3D"-Wno-unknown-attributes $CFLAGS" fi fi =20 @@ -6506,10 +6501,28 @@ if test "$gcov" =3D "yes" ; then QEMU_CFLAGS=3D"-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS" QEMU_LDFLAGS=3D"-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS" elif test "$fortify_source" =3D "yes" ; then - CFLAGS=3D"-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $CFLAGS" -elif test "$debug" =3D "no"; then + QEMU_CFLAGS=3D"-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $QEMU_CFLAGS" + debug=3Dno +fi +if test "$debug" =3D "no"; then CFLAGS=3D"-O2 $CFLAGS" fi +if test "$debug_info" =3D "yes"; then + CFLAGS=3D"-g $CFLAGS" + LDFLAGS=3D"-g $LDFLAGS" +fi + +case "$ARCH" in +alpha) + # Ensure there's only a single GP + QEMU_CFLAGS=3D"-msmall-data $QEMU_CFLAGS" +;; +esac + +if test "$gprof" =3D "yes" ; then + QEMU_CFLAGS=3D"-p $QEMU_CFLAGS" + QEMU_LDFLAGS=3D"-p $QEMU_LDFLAGS" +fi =20 if test "$have_asan" =3D "yes"; then QEMU_CFLAGS=3D"-fsanitize=3Daddress $QEMU_CFLAGS" @@ -6782,7 +6795,7 @@ EOF =20 update_cxxflags =20 - if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then + if do_cxx $CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAG= S; then # C++ compiler $cxx works ok with C compiler $cc : else @@ -7874,7 +7887,7 @@ if test "$fuzzing" =3D "yes" ; then if test "$have_fuzzer" =3D "yes"; then FUZZ_LDFLAGS=3D" -fsanitize=3Dfuzzer" FUZZ_CFLAGS=3D" -fsanitize=3Dfuzzer" - CFLAGS=3D"$CFLAGS -fsanitize=3Dfuzzer-no-link" + QEMU_CFLAGS=3D"$QEMU_CFLAGS -fsanitize=3Dfuzzer-no-link" else error_exit "Your compiler doesn't support -fsanitize=3Dfuzzer" exit 1 @@ -7961,6 +7974,7 @@ echo "NM=3D$nm" >> $config_host_mak echo "PKG_CONFIG=3D$pkg_config_exe" >> $config_host_mak echo "WINDRES=3D$windres" >> $config_host_mak echo "CFLAGS=3D$CFLAGS" >> $config_host_mak +echo "CXXFLAGS=3D$CXXFLAGS" >> $config_host_mak echo "CFLAGS_NOPIE=3D$CFLAGS_NOPIE" >> $config_host_mak echo "QEMU_CFLAGS=3D$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=3D$QEMU_CXXFLAGS" >> $config_host_mak @@ -8430,24 +8444,6 @@ if test "$tcg_interpreter" =3D "yes" ; then disas_config "TCI" fi =20 -case "$ARCH" in -alpha) - # Ensure there's only a single GP - cflags=3D"-msmall-data $cflags" -;; -esac - -if test "$gprof" =3D "yes" ; then - if test "$target_linux_user" =3D "yes" ; then - cflags=3D"-p $cflags" - ldflags=3D"-p $ldflags" - fi - if test "$target_softmmu" =3D "yes" ; then - ldflags=3D"-p $ldflags" - echo "GPROF_CFLAGS=3D-p" >> $config_target_mak - fi -fi - # Newer kernels on s390 check for an S390_PGSTE program header and # enable the pgste page table extensions in that case. This makes # the vm.allocate_pgste sysctl unnecessary. We enable this program diff --git a/rules.mak b/rules.mak index 56ba540a32..e79a4005a7 100644 --- a/rules.mak +++ b/rules.mak @@ -88,12 +88,12 @@ LINK =3D $(call quiet-command, $(LINKPROG) $(CFLAGS) $(= QEMU_LDFLAGS) -o $@ \ =20 %.o: %.cc $(call quiet-command,$(CXX) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) \ + $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CXXFLAGS) $($@-cflags) \ -c -o $@ $<,"CXX","$(TARGET_DIR)$@") =20 %.o: %.cpp $(call quiet-command,$(CXX) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) \ + $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CXXFLAGS) $($@-cflags) \ -c -o $@ $<,"CXX","$(TARGET_DIR)$@") =20 %.o: %.m diff --git a/softmmu/Makefile.objs b/softmmu/Makefile.objs index a414a74c50..c036887500 100644 --- a/softmmu/Makefile.objs +++ b/softmmu/Makefile.objs @@ -11,4 +11,4 @@ obj-y +=3D memory_mapping.o obj-y +=3D qtest.o =20 obj-y +=3D vl.o -vl.o-cflags :=3D $(GPROF_CFLAGS) $(SDL_CFLAGS) +vl.o-cflags :=3D $(SDL_CFLAGS) --=20 2.26.2