From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tools/Makefile: Move _GNU_SOURCE to Makefile
Date: Tue, 30 Jul 2013 15:26:11 -0700 [thread overview]
Message-ID: <1375223171-23596-1-git-send-email-yorksun@freescale.com> (raw)
Commit 669dfc2e adds libfdt_env.h to HOSTCPPFLAGS. It causes stdio.h
to be included before _GNU_SOURCE is defined in C files. On some old hosts
some prototypes are protected by #ifdef __USE_GNU, which is set when
_GNU_SOURCE is defined.
Signed-off-by: York Sun <yorksun@freescale.com>
---
Compiled on powerpc 83xx, 85xx, 86xx paltforms.
tools/Makefile | 4 +++-
tools/aisimage.c | 3 ---
tools/imximage.c | 3 ---
tools/kwbimage.c | 3 ---
tools/mkenvimage.c | 3 ---
tools/omapimage.c | 3 ---
tools/pblimage.c | 2 --
tools/ublimage.c | 3 ---
8 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile
index 33fad6b..6d45656 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -154,6 +154,7 @@ NOPEDOBJS := $(addprefix $(obj),$(NOPED_OBJ_FILES-y))
#
# Use native tools and options
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
+# Define _GNU_SOURCE to obtain the getline prototype from stdio.h
#
HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \
-idirafter $(SRCTREE)/include \
@@ -163,7 +164,8 @@ HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \
-I $(SRCTREE)/tools \
-DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-DUSE_HOSTCC \
- -D__KERNEL_STRICT_NAMES
+ -D__KERNEL_STRICT_NAMES \
+ -D_GNU_SOURCE
all: $(obj).depend $(BINS) $(LOGO-y) subdirs
diff --git a/tools/aisimage.c b/tools/aisimage.c
index cd89145..980bf2e 100644
--- a/tools/aisimage.c
+++ b/tools/aisimage.c
@@ -5,9 +5,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include "aisimage.h"
#include <image.h>
diff --git a/tools/imximage.c b/tools/imximage.c
index c8a9ad5..cab208b 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -9,9 +9,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include <image.h>
#include "imximage.h"
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index d08e498..1df6b20 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -6,9 +6,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include <image.h>
#include "kwbimage.h"
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index f685ff2..bbd3041 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -9,9 +9,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* We want the GNU version of basename() */
-#define _GNU_SOURCE
-
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
diff --git a/tools/omapimage.c b/tools/omapimage.c
index d4d77d8..00853dd 100644
--- a/tools/omapimage.c
+++ b/tools/omapimage.c
@@ -14,9 +14,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include <image.h>
#include "omapimage.h"
diff --git a/tools/pblimage.c b/tools/pblimage.c
index 4542a9c..bac5faf 100644
--- a/tools/pblimage.c
+++ b/tools/pblimage.c
@@ -3,8 +3,6 @@
*
* SPDX-License-Identifier: GPL-2.0+
*/
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include <image.h>
#include "pblimage.h"
diff --git a/tools/ublimage.c b/tools/ublimage.c
index 6495db6..b4ef7f0 100644
--- a/tools/ublimage.c
+++ b/tools/ublimage.c
@@ -13,9 +13,6 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
#include "mkimage.h"
#include <image.h>
#include "ublimage.h"
--
1.7.9.5
next reply other threads:[~2013-07-30 22:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 22:26 York Sun [this message]
2013-07-30 22:41 ` [U-Boot] [PATCH] tools/Makefile: Move _GNU_SOURCE to Makefile Simon Glass
2013-08-18 21:49 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375223171-23596-1-git-send-email-yorksun@freescale.com \
--to=yorksun@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.