From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A641D3858D1E for ; Thu, 19 Oct 2023 18:33:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A641D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A641D3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697740425; cv=none; b=n5sstTgtPqViR5Plt7MGfsoAiEaA0guhPXRa9MuYEpDTFPCOH+P/lYC6RDgasr/INZMHvHSqhjBntCqa5lsuM1R/lqleW7wdxdViIIkqG0LGHA7+22hy7F78nFgnnLeZhxLaG0WWhD767D7AfA0Y2LW60SHT9pjgK+OZxGcPWMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697740425; c=relaxed/simple; bh=RvTyOkCuc89mjMnfyt1PSJot+E6rBVu4AG8YeVavwaU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=QZlo68H3qTd4k3/nh2B577KFXjzlgZuPsEQg8jPawfqsDt6ka5lUHN33iSJNnAu41xVZFxAMfSqXNA+Jd9BU3TYyNoS7j+dxL3FySE1i41A2agrVu5SlpQvfpmFiIqRoeGDm1qoHt8f5CaDIdbyr0InZX2ePWo/TZ+x6aVMpRIk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697740424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kZ0lqgcZJ9cgf73D3OAZcjpcxaHFd5EvAGlfOPHxRyg=; b=B8Wsa9HW631MHHdbliOARc+jl5z/WBIPiR/OtGXT4YgeeAEvY//8UksgB/FByjRAAK43va fUBYlrm5y/Qbm71uNuaETZsH7+Q1fyBhom0NA1nGAkgSlAlHiiGtWsKiHkDvoycU1QhS2c j9oA3t522rdLEBGNXE8mG57PZaJTeSQ= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-PNHRbLQPOAmeeNgZvTeERw-1; Thu, 19 Oct 2023 14:33:28 -0400 X-MC-Unique: PNHRbLQPOAmeeNgZvTeERw-1 Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-4a5d8991201so2119654e0c.2 for ; Thu, 19 Oct 2023 11:33:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740406; x=1698345206; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kZ0lqgcZJ9cgf73D3OAZcjpcxaHFd5EvAGlfOPHxRyg=; b=TmYW7LUoGow+OyMd6E+n3rhQaMKlBJ+EUUcmMjgyT6GjAROKCiRjWPRUJPAKzbzwSk yDnrr5VYmeBFk9NCAKyQ1dXZn8r7GB80QvddfI44SBGezRMYbpOWNV8BkYc145qTSOQh M7aZkMFs7TZGB7/P/D4vgNqEGqyVK+dcB7B2qEcJQ6tuYJnRWKMrajn/ct2TWe8m7xOx zpjt6we36BzL2GiI4JFsBiW2gKb1+wnCEAiBmVEdw/u4uUI9km6c/OsHNiU5kdrp0D3Z oDhM1gTrbbPCIXW5MluETVEo+TUFPd7b2L3zPxBsIbE71/RGnR0dcnphyQITbI+epRly 9a3Q== X-Gm-Message-State: AOJu0YyiERd1cOBJ1nCncmiO+OV0fTW3SL5yd8zc9vpJlFRrW44eEP0Q 8+60OsB+EjO7P7Y+b0aAHPpRCSG2UETBePMoM5dHiHt5oANtYqWfyRxTw7prS4/SfyrWUkid/gB 40jtah8KNA97BdOiXTQ== X-Received: by 2002:a05:6122:1789:b0:495:d846:ebc0 with SMTP id o9-20020a056122178900b00495d846ebc0mr2954523vkf.16.1697740406207; Thu, 19 Oct 2023 11:33:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbLA4flxJ3H5Mfc7dZeH/diEuHrqj2lhhWbqjL6JP68xNNkwJfktAz0MpS/Yxjyh9jE5YhLw== X-Received: by 2002:a05:6122:1789:b0:495:d846:ebc0 with SMTP id o9-20020a056122178900b00495d846ebc0mr2954469vkf.16.1697740405086; Thu, 19 Oct 2023 11:33:25 -0700 (PDT) Received: from redhat.com (2603-7000-9500-34a5-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:34a5::1db4]) by smtp.gmail.com with ESMTPSA id l9-20020ac80789000000b00419732075b4sm4430qth.84.2023.10.19.11.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:33:24 -0700 (PDT) Date: Thu, 19 Oct 2023 14:33:23 -0400 From: Marek Polacek To: Sam James Cc: Richard Biener , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] gcc: Introduce -fhardened Message-ID: References: <20230915150816.18190-1-polacek@redhat.com> <87wmvihju9.fsf@gentoo.org> MIME-Version: 1.0 In-Reply-To: <87wmvihju9.fsf@gentoo.org> User-Agent: Mutt/2.2.9 (2022-11-12) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Oct 19, 2023 at 01:33:51PM +0100, Sam James wrote: > > Richard Biener writes: > > > On Wed, Oct 11, 2023 at 10:48 PM Marek Polacek wrote: > >> > >> On Tue, Sep 19, 2023 at 10:58:19AM -0400, Marek Polacek wrote: > >> > On Mon, Sep 18, 2023 at 08:57:39AM +0200, Richard Biener wrote: > >> > > On Fri, Sep 15, 2023 at 5:09 PM Marek Polacek via Gcc-patches > >> > > wrote: > >> > > > > >> > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, powerpc64le-unknown-linux-gnu, > >> > > > and aarch64-unknown-linux-gnu; ok for trunk? > >> > > > > >> > > > -- >8 -- > >> > > > In > >> > > > I proposed -fhardened, a new umbrella option that enables a reasonable set > >> > > > of hardening flags. The read of the room seems to be that the option > >> > > > would be useful. So here's a patch implementing that option. > >> > > > > >> > > > Currently, -fhardened enables: > >> > > > > >> > > > -D_FORTIFY_SOURCE=3 (or =2 for older glibcs) > >> > > > -D_GLIBCXX_ASSERTIONS > >> > > > -ftrivial-auto-var-init=pattern > > > > I think =zero is much better here given the overhead is way > > cheaper and pointers get a more reliable behavior. > > Yes please, as I wouldn't want us to use =pattern distro-wide. Thanks for the feedback, I switched back to =zero. Marek