On Tuesday 07 January 2014 04:40 PM, Vineet Gupta wrote: > On Tuesday 07 January 2014 02:59 PM, Bernhard Reutner-Fischer wrote: >> On 3 January 2014 05:53, Vineet Gupta <vineet.gup...@synopsys.com> wrote: >>> On Monday 23 December 2013 07:46 PM, Bernhard Reutner-Fischer wrote: >>> > ------------------->8----------------------------- > ./extra/scripts/unifdef -B -t -f .//include/generated/unifdef_config.h -U_LIBC > -U__UCLIBC_GEN_LOCALE -U__NO_CTYPE include/bits/uClibc_config.h > #if !defined _FEATURES_H && !defined __need_uClibc_config_h > # error Never include <bits/uClibc_config.h> directly; use <features.h> > instead > unifdef: include/bits/uClibc_config.h: 3: Inappropriate #endif > unifdef: output may be truncated > > I debugged it a bit and it seems removing -t option to unifdef seems to elide > the > issue. > Attached are my symbol file and the src file - see if u can reproduce it at > your end.
Following fixes the issue - although it might be incomplete. --------------------> >From 4f72593ad75f2c8a5a52501e020997f7d6e86aac Mon Sep 17 00:00:00 2001 From: Vineet Gupta <vgu...@synopsys.com> Date: Tue, 7 Jan 2014 17:25:14 +0530 Subject: [PATCH] Reset unifdef state machine after a -f <file> parsing After commit 2a021ae81c36 "buildsys: update unifdef" there were sporadic build failures at the time of uClibc header generation. ----------------->8------------------ unifdef: include/bits/kernel_sigaction.h: 24: Inappropriate #endif unifdef: output may be truncated unifdef: include/bits/uClibc_config.h: 3: Inappropriate #endif ... ... ----------------->8------------------ Turns out that unifdef now has -f <file> option to provide def/undef symbols from a file. This helper file parsing uses the same code as the SRC file parsing. However the parsing state machine uses global variables which need to be "reset" after the -f pass. Signed-off-by: Vineet Gupta <vgu...@synopsys.com> --- extra/scripts/unifdef.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extra/scripts/unifdef.c b/extra/scripts/unifdef.c index b159df0a665b..f71ee66c896d 100644 --- a/extra/scripts/unifdef.c +++ b/extra/scripts/unifdef.c @@ -378,6 +378,8 @@ processinout(const char *ifn, const char *ofn) { struct stat st; + incomment = linestate = 0; + if (ifn == NULL || strcmp(ifn, "-") == 0) { filename = "[stdin]"; linefile = NULL; -- 1.8.3.2 _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc