From patchwork Mon Sep 7 15:32:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 515209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 819E6140129 for ; Tue, 8 Sep 2015 01:34:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=XkqsOPBL; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 76CA328C0EF; Mon, 7 Sep 2015 17:33:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id DCB0628C04F for ; Mon, 7 Sep 2015 17:33:00 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .googlemail. - helo: .mail-wi0-f180.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 7 Sep 2015 17:33:00 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so49690451wic.1 for ; Mon, 07 Sep 2015 08:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=npdI4bpTsLJemjfvc3EstRm16KjRCaAPVmGmuK37MUc=; b=XkqsOPBL6R0/Az907xdXw7XNWm0TLHm0uwm84OgbL7MiU6jm8bZ6lEIkYtY1c0TGyH MnZG36QYLTM96M4qVPXDGVrDI4WmWJOiv9bgbQ5HJf11jvBvT0L7ox7usSPOqJWMmXqA VrMhyvl8xZpl5ku+0SaKBe9SdP7gFzNgp1hyk/v7b0US9aZ53d/jAhu3wUWMvD2M8xsA 4oE8IlomoUI5vNvXyx0TI3ENmBkkQ+3qYIOc38iC5R9TQqQzn+0dEmnAlL53+uuh0cn5 A0JqOBSXzyTxKJpgPPjr4J6nTfLYLWVtSsULkTtz+iAQ7zJQy+iDSgJ1NQi5YnMAfJwJ ZsMQ== X-Received: by 10.180.75.41 with SMTP id z9mr36626022wiv.27.1441640043237; Mon, 07 Sep 2015 08:34:03 -0700 (PDT) Received: from hschaa-desktop.site (HSI-KBW-217-008-059-040.hsi.kabelbw.de. [217.8.59.40]) by smtp.gmail.com with ESMTPSA id c7sm20679492wjb.19.2015.09.07.08.33.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 08:33:59 -0700 (PDT) From: Helmut Schaa To: openwrt-devel@lists.openwrt.org Date: Mon, 7 Sep 2015 17:32:13 +0200 Message-Id: <1441639933-24172-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.8.4.5 Subject: [OpenWrt-Devel] [PATCH] openwrt/hardening: Fix CFLAGS usage for -D_FORTIFY_SOURCE X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Fix the following configure error with c-ares by using CPPFLAGS for -D_FORTIFY_SOURCE. Not sure if any other packages suffer from the same issue. configure: using CFLAGS: -Os -pipe -march=74kc -fno-caller-saves -mno-branch-likely -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro configure: CFLAGS error: CFLAGS may only be used to specify C compiler flags, not macro definitions. Use CPPFLAGS for: -D_FORTIFY_SOURCE=1 configure: error: Can not continue. Fix errors mentioned immediately above this line. Signed-off-by: Helmut Schaa --- include/hardening.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hardening.mk b/include/hardening.mk index c277081..4de9cfc 100644 --- a/include/hardening.mk +++ b/include/hardening.mk @@ -27,12 +27,12 @@ ifdef CONFIG_PKG_CC_STACKPROTECTOR_STRONG endif ifdef CONFIG_PKG_FORTIFY_SOURCE_1 ifeq ($(strip $(PKG_FORTIFY_SOURCE)),1) - TARGET_CFLAGS += -D_FORTIFY_SOURCE=1 + TARGET_CPPFLAGS += -D_FORTIFY_SOURCE=1 endif endif ifdef CONFIG_PKG_FORTIFY_SOURCE_2 ifeq ($(strip $(PKG_FORTIFY_SOURCE)),1) - TARGET_CFLAGS += -D_FORTIFY_SOURCE=2 + TARGET_CPPFLAGS += -D_FORTIFY_SOURCE=2 endif endif ifdef CONFIG_PKG_RELRO_PARTIAL