dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't include config.h when building helpers using the native compiler
@ 2020-06-22  5:25 Fabrice Fontaine
  2020-06-22  7:42 ` Herbert Xu
  2020-06-22  8:53 ` Harald van Dijk
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2020-06-22  5:25 UTC (permalink / raw)
  To: dash; +Cc: Fabrice Fontaine, Peter Korsgaard

config.h contains settings for the cross compiler (most importantly
32/64bit versions of functions), so don't include it when calling the
native compiler to build the helpers.

Otherwise we get build errors like:

/usr/bin/gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN  -g -O2 -Wall    -o mkinit mkinit.c
In file included from /usr/include/sys/stat.h:107,
                 from /usr/include/fcntl.h:38,
                 from mkinit.c:50:
/usr/include/bits/stat.h:117: error: redefinition of ‘struct stat’
In file included from /usr/include/fcntl.h:38,
                 from mkinit.c:50:
/usr/include/sys/stat.h:504: error: redefinition of ‘stat’
/usr/include/sys/stat.h:455: note: previous definition of ‘stat’ was here

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/dash/0001-no-config.h-for-helpers.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 src/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 1732465..3b1b54e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,6 @@ COMMON_CPPFLAGS = \
 AM_CFLAGS = $(COMMON_CFLAGS)
 AM_CPPFLAGS = -include $(top_builddir)/config.h $(COMMON_CPPFLAGS)
 AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS) 
-AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS)
 
 COMPILE_FOR_BUILD = \
 	$(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-22 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22  5:25 [PATCH] Don't include config.h when building helpers using the native compiler Fabrice Fontaine
2020-06-22  7:42 ` Herbert Xu
2020-06-22  8:53 ` Harald van Dijk
2020-06-22 10:44   ` Fabrice Fontaine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).