From patchwork Mon May 23 17:57:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 625345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rD5qx1Wy7z9t6K for ; Tue, 24 May 2016 03:58:20 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A1E80B921F3; Mon, 23 May 2016 19:58:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 23 May 2016 19:58:11 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B9CCDB921F3 for ; Mon, 23 May 2016 19:58:09 +0200 (CEST) X-policyd-weight: using cached result; rate: -7 Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com [198.182.60.111]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 23 May 2016 19:58:09 +0200 (CEST) Received: from dc8secmta1.synopsys.com (dc8secmta1.synopsys.com [10.13.218.200]) by smtprelay.synopsys.com (Postfix) with ESMTP id 332DA10C051F; Mon, 23 May 2016 10:58:06 -0700 (PDT) Received: from dc8secmta1.internal.synopsys.com (dc8secmta1.internal.synopsys.com [127.0.0.1]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 26CE627113; Mon, 23 May 2016 10:58:06 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id EA0E127102; Mon, 23 May 2016 10:58:05 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id D4964918; Mon, 23 May 2016 10:58:05 -0700 (PDT) Received: from abrodkin-7440l.internal.synopsys.com (unknown [10.121.8.125]) by mailhost.synopsys.com (Postfix) with ESMTP id A38388F2; Mon, 23 May 2016 10:58:03 -0700 (PDT) From: Alexey Brodkin To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org Date: Mon, 23 May 2016 20:57:28 +0300 Message-Id: <1464026248-23499-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.5.5 Subject: [OpenWrt-Devel] [PATCH] _GNU_SOURCE should be defined for building vs uClibc X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Waldemar Brodkorb , Alexey Brodkin MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" In uClibc-ng O_PATH and O_DIRECTORY are only defined if _GNU_SOURCE is defined. So explicitly define _GNU_SOURCE in sources that use O_PATH and O_DIRECTORY. Without that extra definition that's what happens when building procd. utils/utils.c: ------------------------->8---------------------- .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c: In function 'patch_fd': .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:22: error: 'O_PATH' undeclared (first use in this function) dfd = open("/dev", O_PATH|O_DIRECTORY); ^ .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:22: note: each undeclared identifier is reported only once for each function it appears in .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:29: error: 'O_DIRECTORY' undeclared (first use in this function) dfd = open("/dev", O_PATH|O_DIRECTORY); ^ CMakeFiles/init.dir/build.make:182: recipe for target 'CMakeFiles/init.dir/utils/utils.c.o' failed ------------------------->8---------------------- inittab.c: ------------------------->8---------------------- .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c: In function 'dev_exist': .../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:21: error: 'O_PATH' undeclared (first use in this function) dfd = open("/dev", O_PATH|O_DIRECTORY); ^ .../git/openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:21: note: each undeclared identifier is reported only once for each function it appears in .../git/openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:28: error: 'O_DIRECTORY' undeclared (first use in this function) dfd = open("/dev", O_PATH|O_DIRECTORY); ^ CMakeFiles/procd.dir/build.make:134: recipe for target 'CMakeFiles/procd.dir/inittab.c.o' failed make[6]: *** [CMakeFiles/procd.dir/inittab.c.o] Error 1 ------------------------->8---------------------- Signed-off-by: Alexey Brodkin Cc: Waldemar Brodkorb Cc: John Crispin Cc: Jo-Philipp Wich --- inittab.c | 1 + utils/utils.c | 1 + 2 files changed, 2 insertions(+) diff --git a/inittab.c b/inittab.c index 528396e..6dde11a 100644 --- a/inittab.c +++ b/inittab.c @@ -12,6 +12,7 @@ * GNU General Public License for more details. */ +#define _GNU_SOURCE #include #include #include diff --git a/utils/utils.c b/utils/utils.c index e2e3396..8f14aad 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -12,6 +12,7 @@ * GNU General Public License for more details. */ +#define _GNU_SOURCE #include #include #include "utils.h"