From patchwork Mon Aug 19 13:02:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1852 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A90A760C1E for ; Mon, 19 Aug 2019 15:02:55 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 29607510 for ; Mon, 19 Aug 2019 15:02:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1566219775; bh=smnyKwvRKinU2i/rIAxH7POZPwIrL9/HAAMpg4TMY5Y=; h=From:To:Subject:Date:From; b=s1+x7rmm7C7kSM5N8XfGfvYFW5ZVoPpCHJepb+ZVMCnbTAJXepzd31hzenZBetcQ0 Oq7bxGLSpSVD/lymqoL0Mfhg36rVo0XF6X8p5sGbFgPke2gOmYNGNDkxSDc6OI/m8J 3EIpTq9mg7wJJjy7aLz1qJ7+M1Xn9Cqm+UyyW7mk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 19 Aug 2019 16:02:45 +0300 Message-Id: <20190819130245.7298-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] meson: Define _FORTIFY_SOURCE for non-debug builds X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 13:02:55 -0000 _FORTIFY_SOURCE add useful checks during compilation. Enable it by default, except for debug builds as it requires at least a -O1 optimisation level. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 13d0605f903c..53263d68791d 100644 --- a/meson.build +++ b/meson.build @@ -35,6 +35,12 @@ common_arguments = [ '-include', 'config.h', ] +if get_option('buildtype') != 'debug' + common_arguments += [ + '-D_FORTIFY_SOURCE=1', + ] +endif + c_arguments = common_arguments cpp_arguments = common_arguments