From nobody Sun Nov 24 14:40:29 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1723542792; cv=none; d=zohomail.com; s=zohoarc; b=Kc00JB6xHAJgjsqO4qE5c7c3bkmHF6Izucy7x8AyzM+ifYhRVaUJy6JeZI0eAYQ0LmlNlorkJT0ii0yjwS1vbDuCLcp+YX6459jM1EC+VXYJWrHogwXwPyz1opYzn9NvmxiJaNfnRJwH+XaqCILc+E9fp95WROErVTOYMAdhILg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723542792; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=o1DR36HIvFu76vDBuU+Z8chsrK+BUROUUvsk8uqfEyc=; b=OatAEzuVYKx8Ft7tpSQ8iy+qO5gQoXTggsda45YPOTo5RU/N1n+G3VMZILQav4KHcu1G2QpdreSea2DGCgW7fQc3Ok6PunMQDfkW9AAzlI58RI0mmrJJGqdFm5oE66K7Ir/WGUDgt5BD5mTT5+A9DHNvpyOZC7DEfLrEW+Fg9SE= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723542792830925.5583710383606; Tue, 13 Aug 2024 02:53:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdoCg-0005Km-OX; Tue, 13 Aug 2024 05:52:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdoCe-0005CZ-0G for qemu-devel@nongnu.org; Tue, 13 Aug 2024 05:52:32 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdoCc-0001zP-29 for qemu-devel@nongnu.org; Tue, 13 Aug 2024 05:52:31 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1fc47abc040so34485195ad.0 for ; Tue, 13 Aug 2024 02:52:29 -0700 (PDT) Received: from stoup.. ([203.30.4.111]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d1c9ca796fsm10851876a91.30.2024.08.13.02.52.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 02:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723542748; x=1724147548; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=o1DR36HIvFu76vDBuU+Z8chsrK+BUROUUvsk8uqfEyc=; b=pGPo9EzCrkyaBaDcM1z0BjHOwjx8bmt5MR0nH4okc64f4A+99gLG3LhS9wdOuleni+ HOnKH8/hk0BSEMk68n4jEGLtVdtxb7y/xfW44RKU1oA9cJ7LJUMWj3x73d8KCA0M2FDP i08bOraICmmxwLTqhOZg/WCiii+Kj1j2/gMHKmgcQMj0YTiA9/nEBwEN3zJ7gNK/eu2c eEKsFr84IH2sJ6CpUFST4NngZXTK80wGiMy7OWTKCTpCHHKYIfHErn9t0IhLlD8ruByb PlIqNODtTrFZcLZLtfPtLXwHsNFCK7nkIGO+EndZWuBJSIu0nSHY+vGzuqKgJwrL5AZf RPQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723542748; x=1724147548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o1DR36HIvFu76vDBuU+Z8chsrK+BUROUUvsk8uqfEyc=; b=t14bK1O3lwzyQAyBuROqtI3f/5jSzJ2egZbPOQ0hJYnNcvI9JTfnLdbrNu0N2pZaPL IIzJxUhvFOcl1oeQYlEg4y6LVr4kgL/mDjW/cVfJ47N6BUMH4C9+OQkpKsvVLkQTAvC2 4c9mmvDvKipHuTHA6LyhdWC2WDY7TX7ZQH9CSDiFmp6YhlJaMw/Ieeq8Tt/hwdIctu/4 h84KFEFr7jS+758ZRCytpjIqj9BHxBYC9r4RdrNst6kbiQjmv2vSuwmbwobt4lzPlole kfeVyLCeQCv835/PYRgTdbu/IKAODznY+erw9OHdWe+o5ElMR0t+d2gBPhgWLlS8gwW/ fpAw== X-Gm-Message-State: AOJu0YwCNd2Gh/d7XVJPcl3sFdkZ3Uoj+GxDh1jgApfLas8AG7I1BTv0 J7aOmrc3hwU+N3Z2F4UflziN1a5+NP+ICVXAOgv16u3yzdDoKwIZ5436bYEP+K/w9Ns7s9cxEYU LkZo= X-Google-Smtp-Source: AGHT+IEZG0DUpBxXyzQionAqYXLKyqixoxJOSPvTMDhKZOkYIm/3ZytC0/zn4uJYXMiGXAt5JCgDVw== X-Received: by 2002:a17:90a:ba92:b0:2c9:7cb6:38b0 with SMTP id 98e67ed59e1d1-2d39254ebd9mr3233051a91.19.1723542748266; Tue, 13 Aug 2024 02:52:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/2] meson: Move -fsanitize=undefined into normal configuraton Date: Tue, 13 Aug 2024 19:52:16 +1000 Message-ID: <20240813095216.306555-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813095216.306555-1-richard.henderson@linaro.org> References: <20240813095216.306555-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1723542794342116600 Content-Type: text/plain; charset="utf-8" With 8e466dd09246 and 23ef50ae2d0c, we disable function pointer sanitization in CI because the qemu code base does not support it. We must disable this for normal usage of --enable-ubsan as well, so move it there. Append options rather than prepend, since all of this requires proper ordering of options. Signed-off-by: Richard Henderson --- .gitlab-ci.d/buildtest.yml | 10 ++++------ meson.build | 11 +++++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index aa32782405..fc5d516557 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -428,9 +428,8 @@ clang-system: job: amd64-fedora-container variables: IMAGE: fedora - CONFIGURE_ARGS: --cc=3Dclang --cxx=3Dclang++ - --extra-cflags=3D-fsanitize=3Dundefined --extra-cflags=3D-fno-saniti= ze-recover=3Dundefined - --extra-cflags=3D-fno-sanitize=3Dfunction + CONFIGURE_ARGS: --cc=3Dclang --cxx=3Dclang++ --enable-ubsan + --extra-cflags=3D-fno-sanitize-recover=3Dundefined TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-s= oftmmu MAKE_CHECK_ARGS: check-qtest check-tcg =20 @@ -441,10 +440,9 @@ clang-user: timeout: 70m variables: IMAGE: debian-all-test-cross - CONFIGURE_ARGS: --cc=3Dclang --cxx=3Dclang++ --disable-system + CONFIGURE_ARGS: --cc=3Dclang --cxx=3Dclang++ --disable-system --enable= -ubsan --target-list-exclude=3Dalpha-linux-user,microblazeel-linux-user,aar= ch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xte= nsaeb-linux-user - --extra-cflags=3D-fsanitize=3Dundefined --extra-cflags=3D-fno-saniti= ze-recover=3Dundefined - --extra-cflags=3D-fno-sanitize=3Dfunction + --extra-cflags=3D-fno-sanitize-recover=3Dundefined MAKE_CHECK_ARGS: check-unit check-tcg =20 # Set LD_JOBS=3D1 because this requires LTO and ld consumes a large amount= of memory. diff --git a/meson.build b/meson.build index 19b18b4a8a..5b9ac6c6c5 100644 --- a/meson.build +++ b/meson.build @@ -488,8 +488,15 @@ if get_option('ubsan') # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84285 if cc.links('int main(int argc, char **argv) { return argc + 1; }', args: [qemu_ldflags, '-fsanitize=3Dundefined']) - qemu_cflags =3D ['-fsanitize=3Dundefined'] + qemu_cflags - qemu_ldflags =3D ['-fsanitize=3Dundefined'] + qemu_ldflags + qemu_cflags +=3D ['-fsanitize=3Dundefined'] + qemu_ldflags +=3D ['-fsanitize=3Dundefined'] + + # Suppress undefined behaviour from function call to mismatched type. + # In addition, tcg prologue does not emit function type prefix + # required by function call sanitizer. + if cc.has_argument('-fno-sanitize=3Dfunction') + qemu_cflags +=3D ['-fno-sanitize=3Dfunction'] + endif else error('Your compiler does not support -fsanitize=3Dundefined') endif --=20 2.43.0