From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103277 invoked by alias); 12 Nov 2018 12:03:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 103256 invoked by uid 89); 12 Nov 2018 12:03:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Nov 2018 12:03:44 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 63F60AD90; Mon, 12 Nov 2018 12:03:42 +0000 (UTC) From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Do not allow -mabi=ms and -fsanitize={,kernel-}address (PR sanitizer/87930). To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek Message-ID: <936a42b5-84f3-53e2-84e9-0e5cc80e6736@suse.cz> Date: Mon, 12 Nov 2018 12:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------75A7FC870E91F1A78EEAAB1F" X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00932.txt.bz2 This is a multi-part message in MIME format. --------------75A7FC870E91F1A78EEAAB1F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 358 Hi. The patch reject usage of the mentioned options. Ready for trunk? Thanks, Martin gcc/ChangeLog: 2018-11-12 Martin Liska PR sanitizer/87930 * config/i386/i386.c (ix86_option_override_internal): Error about usage -mabi=ms and -fsanitize={,kernel-}address. --- gcc/config/i386/i386.c | 5 +++++ 1 file changed, 5 insertions(+) --------------75A7FC870E91F1A78EEAAB1F Content-Type: text/x-patch; name="0001-Do-not-allow-mabi-ms-and-fsanitize-kernel-address-PR.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Do-not-allow-mabi-ms-and-fsanitize-kernel-address-PR.pa"; filename*1="tch" Content-length: 823 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 711bec0cc9d..b3e0807b894 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3546,6 +3546,11 @@ ix86_option_override_internal (bool main_args_p, error ("-mabi=ms not supported with X32 ABI"); gcc_assert (opts->x_ix86_abi == SYSV_ABI || opts->x_ix86_abi == MS_ABI); + if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) && opts->x_ix86_abi == MS_ABI) + error ("%<-mabi=ms%> not supported with %<-fsanitize=address%>"); + if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_ix86_abi == MS_ABI) + error ("%<-mabi=ms%> not supported with %<-fsanitize=kernel-address%>"); + /* For targets using ms ABI enable ms-extensions, if not explicit turned off. For non-ms ABI we turn off this option. */ --------------75A7FC870E91F1A78EEAAB1F--