Commit
2db1c3fc673c2ddfa1f8dbb41326d9763ea0ae64
Exists in
master
and in
55 other branches
8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, emb_lf_v2024.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x
tools/Makefile: Move _GNU_SOURCE to Makefile
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>
Acked-by: Simon Glass <sjg@chromium.org>
Showing
8 changed files
with
3 additions
and
21 deletions
Side-by-side Diff
... |
... |
@@ -154,6 +154,7 @@ |
154
|
154 |
# |
155
|
155 |
# Use native tools and options |
156
|
156 |
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps |
|
157 |
+# Define _GNU_SOURCE to obtain the getline prototype from stdio.h |
157
|
158 |
# |
158
|
159 |
HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \ |
159
|
160 |
-idirafter $(SRCTREE)/include \ |
... |
... |
@@ -163,7 +164,8 @@ |
163
|
164 |
-I $(SRCTREE)/tools \ |
164
|
165 |
-DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \ |
165
|
166 |
-DUSE_HOSTCC \ |
166
|
|
- -D__KERNEL_STRICT_NAMES |
|
167 |
+ -D__KERNEL_STRICT_NAMES \ |
|
168 |
+ -D_GNU_SOURCE |
167
|
169 |
|
168
|
170 |
|
169
|
171 |
all: $(obj).depend $(BINS) $(LOGO-y) subdirs |
... |
... |
@@ -5,9 +5,6 @@ |
5
|
5 |
* SPDX-License-Identifier: GPL-2.0+ |
6
|
6 |
*/ |
7
|
7 |
|
8
|
|
-/* Required to obtain the getline prototype from stdio.h */ |
9
|
|
-#define _GNU_SOURCE |
10
|
|
- |
11
|
8 |
#include "mkimage.h" |
12
|
9 |
#include "aisimage.h" |
13
|
10 |
#include <image.h> |
... |
... |
@@ -9,9 +9,6 @@ |
9
|
9 |
* SPDX-License-Identifier: GPL-2.0+ |
10
|
10 |
*/ |
11
|
11 |
|
12
|
|
-/* Required to obtain the getline prototype from stdio.h */ |
13
|
|
-#define _GNU_SOURCE |
14
|
|
- |
15
|
12 |
#include "mkimage.h" |
16
|
13 |
#include <image.h> |
17
|
14 |
#include "imximage.h" |
... |
... |
@@ -6,9 +6,6 @@ |
6
|
6 |
* SPDX-License-Identifier: GPL-2.0+ |
7
|
7 |
*/ |
8
|
8 |
|
9
|
|
-/* Required to obtain the getline prototype from stdio.h */ |
10
|
|
-#define _GNU_SOURCE |
11
|
|
- |
12
|
9 |
#include "mkimage.h" |
13
|
10 |
#include <image.h> |
14
|
11 |
#include "kwbimage.h" |
... |
... |
@@ -9,9 +9,6 @@ |
9
|
9 |
* SPDX-License-Identifier: GPL-2.0+ |
10
|
10 |
*/ |
11
|
11 |
|
12
|
|
-/* We want the GNU version of basename() */ |
13
|
|
-#define _GNU_SOURCE |
14
|
|
- |
15
|
12 |
#include <errno.h> |
16
|
13 |
#include <fcntl.h> |
17
|
14 |
#include <stdio.h> |
... |
... |
@@ -14,9 +14,6 @@ |
14
|
14 |
* SPDX-License-Identifier: GPL-2.0+ |
15
|
15 |
*/ |
16
|
16 |
|
17
|
|
-/* Required to obtain the getline prototype from stdio.h */ |
18
|
|
-#define _GNU_SOURCE |
19
|
|
- |
20
|
17 |
#include "mkimage.h" |
21
|
18 |
#include <image.h> |
22
|
19 |
#include "omapimage.h" |
... |
... |
@@ -3,8 +3,6 @@ |
3
|
3 |
* |
4
|
4 |
* SPDX-License-Identifier: GPL-2.0+ |
5
|
5 |
*/ |
6
|
|
-#define _GNU_SOURCE |
7
|
|
- |
8
|
6 |
#include "mkimage.h" |
9
|
7 |
#include <image.h> |
10
|
8 |
#include "pblimage.h" |
... |
... |
@@ -13,9 +13,6 @@ |
13
|
13 |
* SPDX-License-Identifier: GPL-2.0+ |
14
|
14 |
*/ |
15
|
15 |
|
16
|
|
-/* Required to obtain the getline prototype from stdio.h */ |
17
|
|
-#define _GNU_SOURCE |
18
|
|
- |
19
|
16 |
#include "mkimage.h" |
20
|
17 |
#include <image.h> |
21
|
18 |
#include "ublimage.h" |