update unifdef causing partial header generation and

Vineet Gupta Vineet.Gupta1 at synopsys.com
Wed Jan 8 05:33:21 UTC 2014


On Tuesday 07 January 2014 10:48 PM, Bernhard Reutner-Fischer wrote:
> On 7 January 2014 13:03, Vineet Gupta <Vineet.Gupta1 at synopsys.com> wrote:
>> 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.Gupta1 at 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 <vgupta at 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 <vgupta at 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
> I have just pushed
> http://git.uclibc.org/uClibc/commit/?id=c71f8bc18e33da575c2f637a4dfa5e6bf120cd3c
>
> does that work for you, Vineet?

Yep fixes it for me. Thank.
I was still concerned about clearing up of state machine from a -f <file> run so
used a incomplete ifdef construct in sym file and now parser correctly bails out -
so doesn't leave transient state behind for next run.

-Vineet


>
> Tony, when parsing defundefile there is an error in the linestate
> machine, it seems. For me, several entries are "swallowed", i.e. not
> parsed unless i conditionalize the fgets in skiphash on linestate.
> When the state machine is confused and leaves defundefile,
> processinout then starts with a confused state and throws away lines
> erroneously (which is what the hunk cited above would attempt to
> workaround after the fact, i guess).
>
> Please consider applying the 2 hunks in abovementioned commit c71f8bc
> or let me know if that is either wrong or you need me to submit a
> format patch.
>
> TIA and cheers,
>



More information about the uClibc mailing list