[{"id":27744,"web_url":"https://patchwork.libcamera.org/comment/27744/","msgid":"<43zb2rtkdeakxkra62n3ddm35rxnoen3leqdfdrdnlrgvqs2fc@tognm6zvzvco>","date":"2023-09-08T07:05:23","subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi George\n\nOn Thu, Sep 07, 2023 at 10:12:59AM -0600, George Burgess IV via libcamera-devel wrote:\n> ChromeOS is moving to a platform default of `_FORTIFY_SOURCE=3`, and\n> this definition conflicts with that:\n>\n> ```\n> <command line>:4:9: error: '_FORTIFY_SOURCE' macro redefined\n> [-Werror,-Wmacro-redefined]\n> ```\n\nI think we can drop the ``` ?\n\n>\n> Rather than adding logic to keep up with their local configuration, it\n> seems best to leave setting _FORTIFY_SOURCE on ChromeOS up to ChromeOS.\n>\n> Signed-off-by: George Burgess IV <gbiv@google.com>\n> ---\n>  meson.build | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/meson.build b/meson.build\n> index 7959b538..109923ac 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -101,7 +101,8 @@ if cc.get_id() == 'clang'\n>\n>      # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1\n>      # or higher). This is needed on clang only as gcc enables it by default.\n> -    if get_option('optimization') != '0'\n> +    # CrOS sets their preferred FORTIFY level in platform-level CFLAGS.\n\nNot a native speaker here but, is \"sets\" and \"their\" in the same\nphrase ok ? Shouldn't this be either (\"set\" and \"their\") or (\"sets\" and\n\"its\") ?\n\n> +    if get_option('optimization') != '0' and get_option('android_platform') != 'cros'\n\nMinor nitpicking apart, I think the patch is fine. Just curious to\nknow if switching to FORTIFY_SOURCE=3 will generate new bug reports :)\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n\n>          common_arguments += [\n>              '-D_FORTIFY_SOURCE=2',\n>          ]\n> --\n> 2.42.0.283.g2d96d420d3-goog\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 22238C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Sep 2023 07:05:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 57308628EC;\n\tFri,  8 Sep 2023 09:05:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB45A61DF6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Sep 2023 09:05:26 +0200 (CEST)","from ideasonboard.com (mob-5-90-58-221.net.vodafone.it\n\t[5.90.58.221])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F12F11B4;\n\tFri,  8 Sep 2023 09:03:58 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1694156729;\n\tbh=PaGyey/mx8gIWcBQHbWU1tripjSzsv1CmFALFYOK2OI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ddSBqe37Azi29M6XXSc88Bq4RXp1QVjh0GjiMDDsku/lRVREv4eu/enKv/zE/Q7WI\n\tLCf69/vjGxCrZ4bp+BY8JSq5m4604xAYONxKGS93WowtbkvlLgyzBZf8/+69612Qlp\n\tFIMptJTm+33TlR5mTAH6PvAAaPGuNdh2bIyREAL+lnOikbylh9yDQjlacScKrDjZsT\n\tQv3H4HjZDssuY5V3ekx3xV2gXlCulv2U52tI7YkWF/FmsZOtFDUkPGPm7ArrXq0ekG\n\teuz9OOA5q2QiBrxZHghO1nnbBw0H1YVRdVC4VqyS8y2muNVJp5+jimwtVeqjPAaDtq\n\t4gTPZjReqxsgA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1694156638;\n\tbh=PaGyey/mx8gIWcBQHbWU1tripjSzsv1CmFALFYOK2OI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YFAab5Q+1ILDDxoMRXuNV6RQhBG6h/jgdzYwiuBjxLsq84QtFPId7zXY5ZJJJIhK3\n\tymWAjaH1+CJi0I86HDRUaNelIyHOKgn+B/OboBb1v4DZ6z6k/khdvHhdGTaUptTxrn\n\tOWmywAS1eVBTOi8mskPa1A/hx8+gCg9NeengHQ+Y="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"YFAab5Q+\"; dkim-atps=neutral","Date":"Fri, 8 Sep 2023 09:05:23 +0200","To":"George Burgess IV <gbiv@google.com>","Message-ID":"<43zb2rtkdeakxkra62n3ddm35rxnoen3leqdfdrdnlrgvqs2fc@tognm6zvzvco>","References":"<20230907161259.2942654-1-gbiv@google.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230907161259.2942654-1-gbiv@google.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27745,"web_url":"https://patchwork.libcamera.org/comment/27745/","msgid":"<20230908150857.GE17610@pendragon.ideasonboard.com>","date":"2023-09-08T15:08:57","subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Sep 07, 2023 at 10:12:59AM -0600, George Burgess IV via libcamera-devel wrote:\n> ChromeOS is moving to a platform default of `_FORTIFY_SOURCE=3`, and\n> this definition conflicts with that:\n> \n> ```\n> <command line>:4:9: error: '_FORTIFY_SOURCE' macro redefined\n> [-Werror,-Wmacro-redefined]\n> ```\n> \n> Rather than adding logic to keep up with their local configuration, it\n> seems best to leave setting _FORTIFY_SOURCE on ChromeOS up to ChromeOS.\n> \n> Signed-off-by: George Burgess IV <gbiv@google.com>\n> ---\n>  meson.build | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 7959b538..109923ac 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -101,7 +101,8 @@ if cc.get_id() == 'clang'\n>  \n>      # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1\n>      # or higher). This is needed on clang only as gcc enables it by default.\n> -    if get_option('optimization') != '0'\n> +    # CrOS sets their preferred FORTIFY level in platform-level CFLAGS.\n\nSomeone else may do the same. I wonder, would it be possible here to add\n-D_FORTIFY_SOURCES only if not already set in CFLAGS ?\n\n> +    if get_option('optimization') != '0' and get_option('android_platform') != 'cros'\n>          common_arguments += [\n>              '-D_FORTIFY_SOURCE=2',\n>          ]","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B2773BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Sep 2023 15:08:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0FE2628EC;\n\tFri,  8 Sep 2023 17:08:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CEB8961DF8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Sep 2023 17:08:43 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [93.93.133.154])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 066A6836;\n\tFri,  8 Sep 2023 17:07:14 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1694185726;\n\tbh=2xExt83IPRojWEiEWvpaVaVr3mMvWJRDp1HSrPYOZmM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=RzDsubfJEm3Itb9iq1C2efLmu4+fIAixdEw4S9+KbmE8woyHxby6rCNMUsmPzCkTb\n\tJLn65n57Lk1gINsZsJsJeZKKAEIb/ge+/wdnYLrusWz4/PL/8QrRGMX+iPbV0wBI5Y\n\tcRPCjsfflZfOFTk/Zusin1LxtcL0sDk2nDZcbLnBtCgYWuivi5E3UjvLAbJ3/AhjPD\n\tRM+ZQLS9hRTGRHGLRUikO3hIOozf3CmXKpO80jD6kHlcduaAvlWGOciup7F4joY67v\n\tO1iU3EDzxDZdXPNq2A/HcKlNOzFW+wYxx8pFQVwwpv6D8YHk85Oe8ezt2ue3VI78HG\n\tlJ5HUfr+pULJQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1694185635;\n\tbh=2xExt83IPRojWEiEWvpaVaVr3mMvWJRDp1HSrPYOZmM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SoQTV9C20sbO6W1QtgDJWBJBkRN14FvLkVQbgF03UWK2skUMsEL1cYOmClr7+9rNc\n\tukHI88KrLy5djS2TUIvvwxQVvE11V8hGhOXwDjIdPTo1tKY0lZW3ZR0iRRBY8Xn8u0\n\tkOUIJOF1/sk2ZrS6qtJBCvvmyQNNOg76R4bew5ho="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"SoQTV9C2\"; dkim-atps=neutral","Date":"Fri, 8 Sep 2023 18:08:57 +0300","To":"George Burgess IV <gbiv@google.com>","Message-ID":"<20230908150857.GE17610@pendragon.ideasonboard.com>","References":"<20230907161259.2942654-1-gbiv@google.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230907161259.2942654-1-gbiv@google.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27746,"web_url":"https://patchwork.libcamera.org/comment/27746/","msgid":"<CA+rzOEkyhosk_U+N7YLfVBtApijO1_=toLKfMFFOLiT-5CLnng@mail.gmail.com>","date":"2023-09-08T15:48:15","subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","submitter":{"id":172,"url":"https://patchwork.libcamera.org/api/people/172/","name":"George Burgess","email":"gbiv@google.com"},"content":"Thank you both for the quick feedback!\n\n> I think we can drop the ``` ?\n\nDone\n\n> Not a native speaker here but, is \"sets\" and \"their\" in the same\n> phrase ok ? Shouldn't this be either (\"set\" and \"their\") or (\"sets\" and\n> \"its\") ?\n\nYeah, I agree the wording here was strange on my part. Fixed.\n\n> Minor nitpicking apart, I think the patch is fine. Just curious to\n> know if switching to FORTIFY_SOURCE=3 will generate new bug reports :)\n\nMaybe? :) The switch has been pretty clean for us so far.\n\n> Someone else may do the same. I wonder, would it be possible here to add\n> -D_FORTIFY_SOURCES only if not already set in CFLAGS ?\n\nChromeOS is... a bit weird. Our ${CC}, ${CXX}, etc are actually wrappers that\napply global CFLAGS (among other things). This makes it pretty hard to detect\nthe complete set of flags are actually being set for a given build.\n\n*That said*, I can probably add a nop -D_FORTIFY_SOURCE=3 to the actual\n${CFLAGS} for this package in ChromeOS, so this change can be made more\ngenerally applicable. I'll send v2 once I get the chance to test that.\n\nGeorge\n\nOn Fri, Sep 8, 2023 at 9:08 AM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> On Thu, Sep 07, 2023 at 10:12:59AM -0600, George Burgess IV via libcamera-devel wrote:\n> > ChromeOS is moving to a platform default of `_FORTIFY_SOURCE=3`, and\n> > this definition conflicts with that:\n> >\n> > ```\n> > <command line>:4:9: error: '_FORTIFY_SOURCE' macro redefined\n> > [-Werror,-Wmacro-redefined]\n> > ```\n> >\n> > Rather than adding logic to keep up with their local configuration, it\n> > seems best to leave setting _FORTIFY_SOURCE on ChromeOS up to ChromeOS.\n> >\n> > Signed-off-by: George Burgess IV <gbiv@google.com>\n> > ---\n> >  meson.build | 3 ++-\n> >  1 file changed, 2 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/meson.build b/meson.build\n> > index 7959b538..109923ac 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -101,7 +101,8 @@ if cc.get_id() == 'clang'\n> >\n> >      # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1\n> >      # or higher). This is needed on clang only as gcc enables it by default.\n> > -    if get_option('optimization') != '0'\n> > +    # CrOS sets their preferred FORTIFY level in platform-level CFLAGS.\n>\n> Someone else may do the same. I wonder, would it be possible here to add\n> -D_FORTIFY_SOURCES only if not already set in CFLAGS ?\n>\n> > +    if get_option('optimization') != '0' and get_option('android_platform') != 'cros'\n> >          common_arguments += [\n> >              '-D_FORTIFY_SOURCE=2',\n> >          ]\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E6F5FC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Sep 2023 15:48:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4FE66628EC;\n\tFri,  8 Sep 2023 17:48:55 +0200 (CEST)","from mail-ua1-x934.google.com (mail-ua1-x934.google.com\n\t[IPv6:2607:f8b0:4864:20::934])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C32B661DF8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Sep 2023 17:48:53 +0200 (CEST)","by mail-ua1-x934.google.com with SMTP id\n\ta1e0cc1a2514c-7a4ee7f9c37so931338241.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 08 Sep 2023 08:48:53 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1694188135;\n\tbh=UbU+Zgjw/dk5ufS756cmokCDt/POm174Se7nHb6rbY4=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=30qbGuWnudl4X2BxFyjJjI9L1jgLe94DxmJf3QtvYew4s6AJ4/m6cZEXJ0g5dX7rP\n\tZ93lS16KHMJd2o1/Anc3TyPV3ph3R9vw1WHRN16nuwG6K74rgr46utxuF2hCqJywJs\n\tQ2IUlU4v+EwQNPONi0EW5kQvPv7MimIxuqODhOiJgd3ao2thQgFE3vYCGAQ+9BthdE\n\t91DtM5WhCO10JEF+pgPJ96mxRPRNVCBuG0YI8nPcH3/a/EFxriHn9zP6k+rbPvcV6J\n\tsmonuih5CKOnwCLkdEUmrBW3YdcWOAXkZlBr9Mz3lDFqfMnA+32Z70HoOkE8uaL6ct\n\tEpsQWWpnrAfSg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20221208; t=1694188132; x=1694792932;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=oPndSyrDDOPiCuAy9/LrdC7RUCSxefpePS1782fJDRU=;\n\tb=pv/RssbUTBbq4d2+aAEFOwQyguy3fhkRk4MXnWrRIzOYeCQX5rWJFq4DJOIudIdhan\n\tBMD7M/fKV8BUmjvEnEicJDwCnJw5CeZqOi6x5GFsM4aHvcgqGgYbakbzoKjEP7cObEXP\n\tepV3k+0xfrWQCKBnAVS9toadkIJfH3CaZsYzzbk5qsDOHmgfdfGhiSNwp8L3pVbbinP8\n\tYodhd5OkYxB//K2fH3AdyDw9HjPQfUzebk+oXW9QLAStw3bbkpB+c6LZ4LrpWspYlUng\n\tjWfIp5qBeWN7JYMisZwAoi+LGj66jzuu/9sDW20g6yZwE8Oz7g/zEt5Txx1whrlfL//T\n\tC7aA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=google.com\n\theader.i=@google.com header.b=\"pv/RssbU\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1694188132; x=1694792932;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=oPndSyrDDOPiCuAy9/LrdC7RUCSxefpePS1782fJDRU=;\n\tb=E5ptAvxyFf6cbdtOQ/NugtmYnGAQ7p6qYy3Yc5CP4y0D47H13NjBi4hlePn1BXy+tR\n\t9FQCH8gFOr5v3vFUJiedGjuRb0QZ5uO7hS2YyUeBn7NzURY/SoGTWca8n/dqcL6DCt8X\n\tQbxyivPPiJ4wD9opN5s2FJAzMwNSxFIfKVqStnDa7GguewyLaA0MdtibHD7UKkkSUXhW\n\tj31JkL6bEzO58M00yVMCWNnCruNfUKI2ib+NSI0aMH5dGBgZMk38rlA0zgEn4d7Mkdb+\n\tC2BRcaetlxFAdw5M4xinXsSJZg9pghnOglTHJem5kUJ0aM+1pU+oBehrh88lnKLr9D9b\n\tcE8A==","X-Gm-Message-State":"AOJu0Yx0/MdGQdeYXCJ4ljVEJUVL4XVXpzY1H6jzEqEcQ4/EquXCeIys\n\t993K+gJZxm5hAbce7yB6ms+phrSNE6xyetbjJW429WuPOJ8RLZ5Xtvp+Mg==","X-Google-Smtp-Source":"AGHT+IEB0BZAHDhiCI9P0TV9u1WDralyma8hYIgsntFsnMCceCglN1Nwae223uQHGMW8qyDlsZZcEt3KH3jL3rYQiNQ=","X-Received":"by 2002:a67:fc09:0:b0:44e:9c7a:949 with SMTP id\n\to9-20020a67fc09000000b0044e9c7a0949mr2918336vsq.30.1694188132156;\n\tFri, 08 Sep 2023 08:48:52 -0700 (PDT)","MIME-Version":"1.0","References":"<20230907161259.2942654-1-gbiv@google.com>\n\t<20230908150857.GE17610@pendragon.ideasonboard.com>","In-Reply-To":"<20230908150857.GE17610@pendragon.ideasonboard.com>","Date":"Fri, 8 Sep 2023 09:48:15 -0600","Message-ID":"<CA+rzOEkyhosk_U+N7YLfVBtApijO1_=toLKfMFFOLiT-5CLnng@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"George Burgess via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"George Burgess <gbiv@google.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27747,"web_url":"https://patchwork.libcamera.org/comment/27747/","msgid":"<20230909155926.GC21014@pendragon.ideasonboard.com>","date":"2023-09-09T15:59:26","subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Sep 08, 2023 at 09:48:15AM -0600, George Burgess wrote:\n> Thank you both for the quick feedback!\n> \n> > I think we can drop the ``` ?\n> \n> Done\n> \n> > Not a native speaker here but, is \"sets\" and \"their\" in the same\n> > phrase ok ? Shouldn't this be either (\"set\" and \"their\") or (\"sets\" and\n> > \"its\") ?\n> \n> Yeah, I agree the wording here was strange on my part. Fixed.\n> \n> > Minor nitpicking apart, I think the patch is fine. Just curious to\n> > know if switching to FORTIFY_SOURCE=3 will generate new bug reports :)\n> \n> Maybe? :) The switch has been pretty clean for us so far.\n> \n> > Someone else may do the same. I wonder, would it be possible here to add\n> > -D_FORTIFY_SOURCES only if not already set in CFLAGS ?\n> \n> ChromeOS is... a bit weird. Our ${CC}, ${CXX}, etc are actually wrappers that\n> apply global CFLAGS (among other things). This makes it pretty hard to detect\n> the complete set of flags are actually being set for a given build.\n> \n> *That said*, I can probably add a nop -D_FORTIFY_SOURCE=3 to the actual\n> ${CFLAGS} for this package in ChromeOS, so this change can be made more\n> generally applicable. I'll send v2 once I get the chance to test that.\n\nThank you, much appreciated.\n\n> On Fri, Sep 8, 2023 at 9:08 AM Laurent Pinchart wrote:\n> > On Thu, Sep 07, 2023 at 10:12:59AM -0600, George Burgess IV via libcamera-devel wrote:\n> > > ChromeOS is moving to a platform default of `_FORTIFY_SOURCE=3`, and\n> > > this definition conflicts with that:\n> > >\n> > > ```\n> > > <command line>:4:9: error: '_FORTIFY_SOURCE' macro redefined\n> > > [-Werror,-Wmacro-redefined]\n> > > ```\n> > >\n> > > Rather than adding logic to keep up with their local configuration, it\n> > > seems best to leave setting _FORTIFY_SOURCE on ChromeOS up to ChromeOS.\n> > >\n> > > Signed-off-by: George Burgess IV <gbiv@google.com>\n> > > ---\n> > >  meson.build | 3 ++-\n> > >  1 file changed, 2 insertions(+), 1 deletion(-)\n> > >\n> > > diff --git a/meson.build b/meson.build\n> > > index 7959b538..109923ac 100644\n> > > --- a/meson.build\n> > > +++ b/meson.build\n> > > @@ -101,7 +101,8 @@ if cc.get_id() == 'clang'\n> > >\n> > >      # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1\n> > >      # or higher). This is needed on clang only as gcc enables it by default.\n> > > -    if get_option('optimization') != '0'\n> > > +    # CrOS sets their preferred FORTIFY level in platform-level CFLAGS.\n> >\n> > Someone else may do the same. I wonder, would it be possible here to add\n> > -D_FORTIFY_SOURCES only if not already set in CFLAGS ?\n> >\n> > > +    if get_option('optimization') != '0' and get_option('android_platform') != 'cros'\n> > >          common_arguments += [\n> > >              '-D_FORTIFY_SOURCE=2',\n> > >          ]","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D0E72BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  9 Sep 2023 15:59:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 007C5628EC;\n\tSat,  9 Sep 2023 17:59:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EB539628DA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  9 Sep 2023 17:59:23 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [80.194.85.162])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 35A54B1;\n\tSat,  9 Sep 2023 17:57:54 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1694275166;\n\tbh=kXUF7Stur6W1+Qag4kD+M8p6I5fx5/fSef0Nn2yQtEM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=dwJAr9MMkvQkw9sQlfAP1azOU/JcwWhd8KXqrHeNekYveXZWaQfR/QknUR2oDjEzH\n\tR5NtB7rljQgUZjTqOUIFdG5FDOMdhJGt4okCRZWqedckXiSgqN//cJWXu4JccZ7VUS\n\tfMW10Ij8LGaVvi5d8+2JlmwROR7sk0wx7FBTACATVhQ8xqGY3ugUPIefVJoGvnqSWb\n\teReEr2MJ6qL8lK12TedtrHBwPT3FSWRa2gg4tIVlDcxZq2sosyMbtS3AR3UisBu18f\n\tZsn5j9ERIApYHZRlwWXaCTJWynBcwMj2MVSJpIWEId1N0iZiFd4cVLZe+yyTN/QMRV\n\tuNjVtN36x+4Nw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1694275074;\n\tbh=kXUF7Stur6W1+Qag4kD+M8p6I5fx5/fSef0Nn2yQtEM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=G+D92cU0kon4Ioqb8xk114w3UmZLHaaD5TqIOrnjdgf29MYH7pgZ5mjbnp3pkdKIK\n\ttozfNz5CYsVt5O4CGDprNdWKq/4m6r8uNN09DmnamFj/2hKmNyYKMRhCM+sy4E08D2\n\tY3EVEAnq7AfRthHVGPz56k9C+6CThVfHqyZCfVRU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"G+D92cU0\"; dkim-atps=neutral","Date":"Sat, 9 Sep 2023 18:59:26 +0300","To":"George Burgess <gbiv@google.com>","Message-ID":"<20230909155926.GC21014@pendragon.ideasonboard.com>","References":"<20230907161259.2942654-1-gbiv@google.com>\n\t<20230908150857.GE17610@pendragon.ideasonboard.com>\n\t<CA+rzOEkyhosk_U+N7YLfVBtApijO1_=toLKfMFFOLiT-5CLnng@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CA+rzOEkyhosk_U+N7YLfVBtApijO1_=toLKfMFFOLiT-5CLnng@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: Don't set _FORTIFY_SOURCE for\n\tChromeOS","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]