From patchwork Wed Dec 26 14:54:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Roberts X-Patchwork-Id: 10743185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70CA51399 for ; Wed, 26 Dec 2018 14:54:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E424284D4 for ; Wed, 26 Dec 2018 14:54:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FF3B285A8; Wed, 26 Dec 2018 14:54:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8536284D4 for ; Wed, 26 Dec 2018 14:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbeLZOyk (ORCPT ); Wed, 26 Dec 2018 09:54:40 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42112 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeLZOyk (ORCPT ); Wed, 26 Dec 2018 09:54:40 -0500 Received: by mail-pl1-f195.google.com with SMTP id y1so7613597plp.9 for ; Wed, 26 Dec 2018 06:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xdSOQYTilgeq+j6a1W5blPb0T5vwCBaMapoI57QPMKM=; b=dkFrLMDdDAg7CVwDGqDfekojq/MdgzPbpqZFNQopzu57pgOaC8NPNtA/FQ408UwBSF hGx6exyCZWISTqZziPCzYaBpws01WXfJGqK7i43VWnWBvX5YZnAhhQWx06sLHaaSh1Ty rFBueg70jLnTLBXerrs3qNkBzOEuwBBP83R/z1Q0yUehSnWwQZ9lpsA1yz42hlUMUXEa b4CQatGtR4o1KIIbq2faFq0jZx05KB+3Wk3rYZVltYyhlt85hy5W9SMTZEEGlDXW+G0K YSM9BxMiejK+4hJukiKKC+qzur0dNvFK3uDHWuwfRRBJtZzbYWFvtq4kkWdXnXjWIY0L fWgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xdSOQYTilgeq+j6a1W5blPb0T5vwCBaMapoI57QPMKM=; b=S05LoZmv/9H3TIQ/hQ/IAD0xxo9xXITYCFbnfPGiAu/9S0Q1qzYpAIavkEYmwVg4Ng PVSlcfZ5KAdrmatR/L1WR6ZqUMkNjfpao2LzT1FBRoff1mFNe6h9YFSzf4Qc5ScLQlH8 cv0bs+7OmmIiz1s/yqZ29hhQi+4BLB2l8Y4aU7kyt2WUiTjn51HSbOzpOS0S/IL+q+s4 4mcPylgMEsEf+eG/tYpglVYhqf+WTt99G955cH+LCb7YBG1Ap6nZO+m6RyOpSlZ4RkNg 9vCfyS34KoHoPDC4hLdLCfddlsVXosA0kFkHj1vc+c6jR69m2AsT8hWi8GgGy7i99ft6 uGfQ== X-Gm-Message-State: AJcUukeQTDugmoLqkGDw+RrhevnpHSmEKcGJJGTBkjiDuluRPlSdcLAz Bd6q5j7Noyz9s3nYWUjlRD7EECHQ X-Google-Smtp-Source: ALg8bN4sOHniO//4iDAwe0J0xoGasidz1vKbXDbrAwB44d7jmZ9z+5/aaNRXpyMG8s03jg2JXkaB5w== X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr19941162plb.238.1545836078812; Wed, 26 Dec 2018 06:54:38 -0800 (PST) Received: from wcrobert-MOBL1.amr.corp.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id 125sm45110583pfg.39.2018.12.26.06.54.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Dec 2018 06:54:37 -0800 (PST) From: bill.c.roberts@gmail.com X-Google-Original-From: william.c.roberts@intel.com To: selinux@vger.kernel.org Cc: sds@tycho.nsa.gov, William Roberts Subject: [V2 PATCH 1/3] Makefile: fix _FORTIFY_SOURCE redefined build error Date: Wed, 26 Dec 2018 06:54:26 -0800 Message-Id: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 2.7.4 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: William Roberts Certain builds of gcc enable _FORTIFY_SOURCE which results in the error: :0:0: warning: "_FORTIFY_SOURCE" redefined :0:0: note: this is the location of the previous definition Correct this by undefining it first and redefining it. Also, the previous command line option was using -Wp which is passing the value *AS IS* to the pre-processor rather than to the compiler driver. The C pre-processor has an undocumented interface subject to change per man 1 gcc. Just use the -D option to specify this value. Signed-off-by: William Roberts Acked-by: Jason Zaman --- libselinux/src/Makefile | 2 +- libselinux/utils/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 977b5c8cfcca..6263d11393e6 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -64,7 +64,7 @@ ifeq ($(COMPILER), gcc) EXTRA_CFLAGS = -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \ -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \ - -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wp,-D_FORTIFY_SOURCE + -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE else EXTRA_CFLAGS = -Wunused-command-line-argument endif diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index d06ffd66893b..890ff36f3bbc 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile @@ -30,7 +30,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \ -Woverflow -Wpointer-to-int-cast -Wpragmas \ -Wno-missing-field-initializers -Wno-sign-compare \ - -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -Wp,-D_FORTIFY_SOURCE \ + -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE \ -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \ -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \ -Werror -Wno-aggregate-return -Wno-redundant-decls \