public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Parallel build error for Blackfin target
@ 2009-09-01  6:50 Jie Zhang
  2009-09-01  7:11 ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Jie Zhang @ 2009-09-01  6:50 UTC (permalink / raw)
  To: Ralf.Wildenhues; +Cc: binutils

Hi Ralf,

Recently I found parallel build fails for all bfin-* targets. Configure 
with option: --target=bfin-linux-uclibc

$ make -j4

gives me

[snip]
/bin/sh /home/jie/sources/binutils/cvs-binutils/src/gas/../ylwrap 
/home/jie/sources/binutils/cvs-binutils/src/gas/config/bfin-parse.y 
y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- bison -y   -d ;
mv -f .deps/atof-ieee.Tpo .deps/atof-ieee.Po
gcc -DHAVE_CONFIG_H -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils  -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils -I../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../include 
-DLOCALEDIR="\"/home/jie/installs/bfin-snapshot/share/locale\"" 
-Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT rdcoff.o -MD 
-MP -MF .deps/rdcoff.Tpo -c -o rdcoff.o 
/home/jie/sources/binutils/cvs-binutils/src/binutils/rdcoff.c
mv -f .deps/ieee.Tpo .deps/ieee.Po
/bin/sh /home/jie/sources/binutils/cvs-binutils/src/gas/../ylwrap 
/home/jie/sources/binutils/cvs-binutils/src/gas/config/bfin-lex.l 
lex.yy.c bfin-lex.c -- flex
/home/jie/sources/binutils/cvs-binutils/src/gas/config/bfin-lex.l:218: 
warning, rule cannot be matched
mv -f .deps/rdcoff.Tpo .deps/rdcoff.Po
gcc -DHAVE_CONFIG_H -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils  -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils -I../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../include 
-DLOCALEDIR="\"/home/jie/installs/bfin-snapshot/share/locale\"" 
-Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT arparse.o 
-MD -MP -MF .deps/arparse.Tpo -c -o arparse.o arparse.c -Wno-error
mv -f .deps/arparse.Tpo .deps/arparse.Po
/bin/sh /home/jie/sources/binutils/cvs-binutils/src/binutils/../ylwrap 
/home/jie/sources/binutils/cvs-binutils/src/binutils/arlex.l lex.yy.c 
arlex.c -- flex
gcc -DHAVE_CONFIG_H -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/gas  -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/gas -I../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/gas/config 
-I/home/jie/sources/binutils/cvs-binutils/src/gas/../include 
-I/home/jie/sources/binutils/cvs-binutils/src/gas/.. 
-I/home/jie/sources/binutils/cvs-binutils/src/gas/../bfd 
-DLOCALEDIR="\"/home/jie/installs/bfin-snapshot/share/locale\""  -W 
-Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT 
bfin-lex.o -MD -MP -MF .deps/bfin-lex.Tpo -c -o bfin-lex.o bfin-lex.c 
-Wno-error
gcc -DHAVE_CONFIG_H -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils  -I. 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils -I../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../bfd 
-I/home/jie/sources/binutils/cvs-binutils/src/binutils/../include 
-DLOCALEDIR="\"/home/jie/installs/bfin-snapshot/share/locale\"" 
-Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT ar.o -MD -MP 
-MF .deps/ar.Tpo -c -o ar.o 
/home/jie/sources/binutils/cvs-binutils/src/binutils/ar.c
bfin-lex.l:25:24: error: bfin-parse.h: No such file or directory
bfin-lex.l: In function ‘yylex’:
bfin-lex.l:44: error: ‘yylval’ undeclared (first use in this function)
bfin-lex.l:44: error: (Each undeclared identifier is reported only once
[snip]

A second make will succeed.

Previously

bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
         $(COMPILE) -c $< $(NO_WERROR)

Now

bfin-lex.o: bfin-lex.c
if am__fastdepCC
         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ 
bfin-lex.c $(NO_WERROR)
         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
else
if AMDEP
         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
         $(COMPILE) -c bfin-lex.c $(NO_WERROR)
endif

Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the 
dependency of bfin-lex.o?


Jie

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

* Re: Parallel build error for Blackfin target
  2009-09-01  6:50 Parallel build error for Blackfin target Jie Zhang
@ 2009-09-01  7:11 ` Dave Korn
  2009-09-01  8:29   ` Jie Zhang
  2009-09-01 21:00   ` Parallel build error for Blackfin target Ralf Wildenhues
  0 siblings, 2 replies; 8+ messages in thread
From: Dave Korn @ 2009-09-01  7:11 UTC (permalink / raw)
  To: Jie Zhang; +Cc: Ralf.Wildenhues, binutils

Jie Zhang wrote:

> Previously
> 
> bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
>         $(COMPILE) -c $< $(NO_WERROR)
> 
> Now
> 
> bfin-lex.o: bfin-lex.c
> if am__fastdepCC
>         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@
> bfin-lex.c $(NO_WERROR)
>         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
> else
> if AMDEP
>         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
>         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
> endif
>         $(COMPILE) -c bfin-lex.c $(NO_WERROR)
> endif
> 
> Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the
> dependency of bfin-lex.o?

  Perhaps $(srcdir)/config/bfin-defs.h should be added as a preqrequisite of
bfin-parse.c (and hence implicitly of bfin-parse.h).

  Really the whole thing needs some kind of sentinel or stamp wrapped around
it(*); what we've got here is the typical "make doesn't understand when a
single rule updates more than one target at once" situation.  Running the rule
for bfin-parse.c actually also creates bfin-parse.h, which is what
necessitates the not-really-true-actually dependency of bfin-parse.h on
bfin-parse.c and the corresponding "@true" build rule.  See also Paul D.
Smith's Rules of Makefiles; this violates #2.

    cheers,
      DaveK

-- 
(*) - or perhaps to be converted to a multiple-output pattern rule, the other
way to resolve this kind of situation and the one place where make does
understand it might generate multiple outputs from a single rule.

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

* Re: Parallel build error for Blackfin target
  2009-09-01  7:11 ` Dave Korn
@ 2009-09-01  8:29   ` Jie Zhang
  2009-09-01  8:41     ` Jie Zhang
  2009-09-01 21:00   ` Parallel build error for Blackfin target Ralf Wildenhues
  1 sibling, 1 reply; 8+ messages in thread
From: Jie Zhang @ 2009-09-01  8:29 UTC (permalink / raw)
  To: Dave Korn; +Cc: Ralf.Wildenhues, binutils

Dave Korn wrote:
> Jie Zhang wrote:
> 
>> Previously
>>
>> bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
>>         $(COMPILE) -c $< $(NO_WERROR)
>>
>> Now
>>
>> bfin-lex.o: bfin-lex.c
>> if am__fastdepCC
>>         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@
>> bfin-lex.c $(NO_WERROR)
>>         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
>> else
>> if AMDEP
>>         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
>>         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
>> endif
>>         $(COMPILE) -c bfin-lex.c $(NO_WERROR)
>> endif
>>
>> Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the
>> dependency of bfin-lex.o?
> 
>   Perhaps $(srcdir)/config/bfin-defs.h should be added as a preqrequisite of
> bfin-parse.c (and hence implicitly of bfin-parse.h).
> 
>   Really the whole thing needs some kind of sentinel or stamp wrapped around
> it(*); what we've got here is the typical "make doesn't understand when a
> single rule updates more than one target at once" situation.  Running the rule
> for bfin-parse.c actually also creates bfin-parse.h, which is what
> necessitates the not-really-true-actually dependency of bfin-parse.h on
> bfin-parse.c and the corresponding "@true" build rule.  See also Paul D.
> Smith's Rules of Makefiles; this violates #2.
> 
The corresponding "@true" build rules are wrong here! They are

bfin-defs.h: ; @true
$(srcdir)/config/bfin-defs.h: ; @true

They should be

bfin-parse.h: ; @true
$(srcdir)/config/bfin-parse.h: ; @true

With this change, the bfin-* targets build well for me now. I'll make a 
patch and send out for approve soon.

Thanks!


Jie

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

* Re: Parallel build error for Blackfin target
  2009-09-01  8:29   ` Jie Zhang
@ 2009-09-01  8:41     ` Jie Zhang
  2009-09-01  9:58       ` [PATCH] Fix parallel build error for Blackfin target (was Re: Parallel build error for Blackfin target) Jie Zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Jie Zhang @ 2009-09-01  8:41 UTC (permalink / raw)
  To: Dave Korn; +Cc: Ralf.Wildenhues, binutils

Jie Zhang wrote:
> Dave Korn wrote:
>> Jie Zhang wrote:
>>
>>> Previously
>>>
>>> bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
>>>         $(COMPILE) -c $< $(NO_WERROR)
>>>
>>> Now
>>>
>>> bfin-lex.o: bfin-lex.c
>>> if am__fastdepCC
>>>         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@
>>> bfin-lex.c $(NO_WERROR)
>>>         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
>>> else
>>> if AMDEP
>>>         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
>>>         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
>>> endif
>>>         $(COMPILE) -c bfin-lex.c $(NO_WERROR)
>>> endif
>>>
>>> Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the
>>> dependency of bfin-lex.o?
>>
>>   Perhaps $(srcdir)/config/bfin-defs.h should be added as a 
>> preqrequisite of
>> bfin-parse.c (and hence implicitly of bfin-parse.h).
>>
>>   Really the whole thing needs some kind of sentinel or stamp wrapped 
>> around
>> it(*); what we've got here is the typical "make doesn't understand when a
>> single rule updates more than one target at once" situation.  Running 
>> the rule
>> for bfin-parse.c actually also creates bfin-parse.h, which is what
>> necessitates the not-really-true-actually dependency of bfin-parse.h on
>> bfin-parse.c and the corresponding "@true" build rule.  See also Paul D.
>> Smith's Rules of Makefiles; this violates #2.
>>
> The corresponding "@true" build rules are wrong here! They are
> 
> bfin-defs.h: ; @true
> $(srcdir)/config/bfin-defs.h: ; @true
> 
> They should be
> 
> bfin-parse.h: ; @true
> $(srcdir)/config/bfin-parse.h: ; @true
> 
> With this change, the bfin-* targets build well for me now. I'll make a 
> patch and send out for approve soon.
> 
I sent out the email too early. "make -j" still fails. :-(

It seems "bfin-parse.h $(srcdir)/config/bfin-defs.h" is still needed as 
the prerequisite for bfin-lex.o.


Jie

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

* [PATCH] Fix parallel build error for Blackfin target (was Re: Parallel  build error for Blackfin target)
  2009-09-01  8:41     ` Jie Zhang
@ 2009-09-01  9:58       ` Jie Zhang
  2009-09-01 21:14         ` Ralf Wildenhues
  0 siblings, 1 reply; 8+ messages in thread
From: Jie Zhang @ 2009-09-01  9:58 UTC (permalink / raw)
  To: binutils; +Cc: Dave Korn, Ralf.Wildenhues

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

Jie Zhang wrote:
> It seems "bfin-parse.h $(srcdir)/config/bfin-defs.h" is still needed as 
> the prerequisite for bfin-lex.o.
> 
This patch adds back "bfin-parse.h $(srcdir)/config/bfin-defs.h". But 
I'm not sure this is a good patch or not, since I don't know why Ralf 
removed them or just by accident. Anyway this fixes my build problem. So 
I'd like send out for review.


Jie

[-- Attachment #2: gas-prevent-bfin-parse-h-clobber.diff --]
[-- Type: text/x-patch, Size: 851 bytes --]


	* Makefile.am (bfin-defs.h, $(srcdir)/config/bfin-defs.h):
	Rename to ...
	(bfin-parse.h, $(srcdir)/config/bfin-parse.h): ... these. 
	* Makefile.in: Regenerate.

Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.181
diff -u -r1.181 Makefile.am
--- Makefile.am	26 Aug 2009 18:27:36 -0000	1.181
+++ Makefile.am	1 Sep 2009 09:36:56 -0000
@@ -606,8 +606,8 @@
 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
  $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
-bfin-defs.h: ; @true
-$(srcdir)/config/bfin-defs.h: ; @true
+bfin-parse.h: ; @true
+$(srcdir)/config/bfin-parse.h: ; @true
 
 bfin-lex.c: $(srcdir)/config/bfin-lex.l
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)


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

* Re: Parallel build error for Blackfin target
  2009-09-01  7:11 ` Dave Korn
  2009-09-01  8:29   ` Jie Zhang
@ 2009-09-01 21:00   ` Ralf Wildenhues
  1 sibling, 0 replies; 8+ messages in thread
From: Ralf Wildenhues @ 2009-09-01 21:00 UTC (permalink / raw)
  To: Dave Korn; +Cc: Jie Zhang, binutils

* Dave Korn wrote on Tue, Sep 01, 2009 at 09:25:10AM CEST:
> Jie Zhang wrote:
> > bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
> >         $(COMPILE) -c $< $(NO_WERROR)
> > 
> > Now
> > 
> > bfin-lex.o: bfin-lex.c
[...]
> > Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the
> > dependency of bfin-lex.o?
> 
>   Perhaps $(srcdir)/config/bfin-defs.h should be added as a preqrequisite of
> bfin-parse.c (and hence implicitly of bfin-parse.h).
> 
>   Really the whole thing needs some kind of sentinel or stamp wrapped around
> it(*);

The .c file or the .h file can be the sentinel, though.  The only
problem then is if their time stamp order is not the way we'd expect.

> what we've got here is the typical "make doesn't understand when a
> single rule updates more than one target at once" situation.  Running the rule
> for bfin-parse.c actually also creates bfin-parse.h, which is what
> necessitates the not-really-true-actually dependency of bfin-parse.h on
> bfin-parse.c and the corresponding "@true" build rule.  See also Paul D.
> Smith's Rules of Makefiles; this violates #2.

Yes, but we violate rule #1 by using non-GNU make, too.  ;-)

The Automake manual has a node 'Multiple Outputs' that describes
portable (i.e., also to non-GNU make) approaches to the issue.

> (*) - or perhaps to be converted to a multiple-output pattern rule, the other
> way to resolve this kind of situation and the one place where make does
> understand it might generate multiple outputs from a single rule.

Pattern rules are GNU make-specific.  AFAICS the current binutils-gdb
tree builds fine with FreeBSD make, for example (tried that out a couple
of days ago).

I'm wondering whether we should just bite the bullet and let automake
treat the yacc and lex files completely.  That would require another
make indirection (implied through BUILT_SOURCES) and convenience
archives for the per-target flags, but it should avoid us needing to
think about this further.  (I haven't tested such a patch yet, though.)

Cheers,
Ralf

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

* Re: [PATCH] Fix parallel build error for Blackfin target (was Re:  Parallel  build error for Blackfin target)
  2009-09-01  9:58       ` [PATCH] Fix parallel build error for Blackfin target (was Re: Parallel build error for Blackfin target) Jie Zhang
@ 2009-09-01 21:14         ` Ralf Wildenhues
  2009-09-02  6:24           ` Jie Zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Wildenhues @ 2009-09-01 21:14 UTC (permalink / raw)
  To: Jie Zhang; +Cc: binutils, Dave Korn

Hello,

* Jie Zhang wrote on Tue, Sep 01, 2009 at 11:57:59AM CEST:
> Jie Zhang wrote:
> >It seems "bfin-parse.h $(srcdir)/config/bfin-defs.h" is still
> >needed as the prerequisite for bfin-lex.o.

There is a typo here, both bfin-parse.h and ...bfin-defs.h appear on
this line.  You meant only bfin-parse.h instances I guess.

> This patch adds back "bfin-parse.h $(srcdir)/config/bfin-defs.h".
> But I'm not sure this is a good patch or not, since I don't know why
> Ralf removed them or just by accident. Anyway this fixes my build
> problem. So I'd like send out for review.

This is not sufficient, as per your own comment above.

Also, it seems it does not address the situation for itbl-parse.h
which is similar in this makefile.  I think the patch below should
fix things at least in gas.  An alternative would be to add the
generated headers to BUILT_SOURCES, that would ensure they are created
early enough.

Can you try this patch?

Thanks,
Ralf

> 	* Makefile.am (bfin-defs.h, $(srcdir)/config/bfin-defs.h):
> 	Rename to ...
> 	(bfin-parse.h, $(srcdir)/config/bfin-parse.h): ... these. 
> 	* Makefile.in: Regenerate.


diff --git a/gas/Makefile.am b/gas/Makefile.am
index b8e86b1..2ae94b1 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -606,12 +606,12 @@ bfin-parse.h: bfin-parse.c
 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
  $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
-bfin-defs.h: ; @true
-$(srcdir)/config/bfin-defs.h: ; @true
+bfin-parse.h: ; @true
+$(srcdir)/config/bfin-parse.h: ; @true
 
 bfin-lex.c: $(srcdir)/config/bfin-lex.l
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c
+bfin-lex.o: bfin-lex.c bfin-parse.h
 if am__fastdepCC
 	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
 	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -623,11 +623,14 @@ endif
 	$(COMPILE) -c bfin-lex.c $(NO_WERROR)
 endif
 
+bfin-lex.h: bfin-lex.c ; @true
+$(srcdir)/config/bfin-lex.h: ; @true
+
 # The instruction table specification lexical analyzer and parser.
 
 # Disable -Werror, if it has been enabled, since old versions of bison/
 # yacc will produce working code which contain compile time warnings.
-itbl-lex.o: itbl-lex.c
+itbl-lex.o: itbl-lex.c itbl-parse.h
 if am__fastdepCC
 	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
 	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -653,9 +656,11 @@ endif
 	$(COMPILE) -c itbl-parse.c $(NO_WERROR)
 endif
 
-itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
+itbl-parse.c: $(srcdir)/itbl-parse.y
 	$(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
 
+itbl-parse.h: itbl-parse.c ; @true
+
 # stand-alone itbl assembler & disassembler
 
 EXTRA_PROGRAMS = itbl-test

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

* Re: [PATCH] Fix parallel build error for Blackfin target (was Re:  Parallel  build error for Blackfin target)
  2009-09-01 21:14         ` Ralf Wildenhues
@ 2009-09-02  6:24           ` Jie Zhang
  0 siblings, 0 replies; 8+ messages in thread
From: Jie Zhang @ 2009-09-02  6:24 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: binutils, Dave Korn

[-- Attachment #1: Type: text/plain, Size: 3818 bytes --]

Ralf Wildenhues wrote:
> Hello,
> 
> * Jie Zhang wrote on Tue, Sep 01, 2009 at 11:57:59AM CEST:
>> Jie Zhang wrote:
>>> It seems "bfin-parse.h $(srcdir)/config/bfin-defs.h" is still
>>> needed as the prerequisite for bfin-lex.o.
> 
> There is a typo here, both bfin-parse.h and ...bfin-defs.h appear on
> this line.  You meant only bfin-parse.h instances I guess.
> 
I meant the string "bfin-parse.h $(srcdir)/config/bfin-defs.h".

>> This patch adds back "bfin-parse.h $(srcdir)/config/bfin-defs.h".
>> But I'm not sure this is a good patch or not, since I don't know why
>> Ralf removed them or just by accident. Anyway this fixes my build
>> problem. So I'd like send out for review.
> 
> This is not sufficient, as per your own comment above.
> 
> Also, it seems it does not address the situation for itbl-parse.h
> which is similar in this makefile.  I think the patch below should
> fix things at least in gas.  An alternative would be to add the
> generated headers to BUILT_SOURCES, that would ensure they are created
> early enough.
> 
> Can you try this patch?

Gas parallel build does not fail for bfin targets with your patch. But 
there is something need change in your patch, I think. See below.

>> 	* Makefile.am (bfin-defs.h, $(srcdir)/config/bfin-defs.h):
>> 	Rename to ...
>> 	(bfin-parse.h, $(srcdir)/config/bfin-parse.h): ... these. 
>> 	* Makefile.in: Regenerate.
> 
It seems I sent the wrong patch in my previous email. The patch I 
intended to send is attached.

> 
> diff --git a/gas/Makefile.am b/gas/Makefile.am
> index b8e86b1..2ae94b1 100644
> --- a/gas/Makefile.am
> +++ b/gas/Makefile.am
> @@ -606,12 +606,12 @@ bfin-parse.h: bfin-parse.c
>  bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
>   $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
>  
I think bfin-parse.h can be removed here. Since bfin-parse.o does not 
use bfin-parse.h. Instead, $(srcdir)/config/bfin-aux.h should be added 
as prerequisite. See

http://sourceware.org/ml/binutils/2009-09/msg00022.html

> -bfin-defs.h: ; @true
> -$(srcdir)/config/bfin-defs.h: ; @true
> +bfin-parse.h: ; @true
> +$(srcdir)/config/bfin-parse.h: ; @true
>  
This is same as my patch.

http://sourceware.org/ml/binutils/2009-09/msg00023.html

>  bfin-lex.c: $(srcdir)/config/bfin-lex.l
>  	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
> -bfin-lex.o: bfin-lex.c
> +bfin-lex.o: bfin-lex.c bfin-parse.h

I think $(srcdir)/config/bfin-defs.h is also needed as a prerequisite 
for bfin-lex.o. See the patch I attached.

>  if am__fastdepCC
>  	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
>  	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
> @@ -623,11 +623,14 @@ endif
>  	$(COMPILE) -c bfin-lex.c $(NO_WERROR)
>  endif
>  
> +bfin-lex.h: bfin-lex.c ; @true
> +$(srcdir)/config/bfin-lex.h: ; @true
> +

I don't think the above two lines are needed. No bfin-lex.h will be 
generated.

>  # The instruction table specification lexical analyzer and parser.
>  
>  # Disable -Werror, if it has been enabled, since old versions of bison/
>  # yacc will produce working code which contain compile time warnings.
> -itbl-lex.o: itbl-lex.c
> +itbl-lex.o: itbl-lex.c itbl-parse.h
>  if am__fastdepCC
>  	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
>  	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
> @@ -653,9 +656,11 @@ endif
>  	$(COMPILE) -c itbl-parse.c $(NO_WERROR)
>  endif
>  
> -itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
> +itbl-parse.c: $(srcdir)/itbl-parse.y
>  	$(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
>  
> +itbl-parse.h: itbl-parse.c ; @true
> +
>  # stand-alone itbl assembler & disassembler
>  
>  EXTRA_PROGRAMS = itbl-test
> 


Jie

[-- Attachment #2: gas-fix-bfin-parallel-build.diff --]
[-- Type: text/x-patch, Size: 785 bytes --]


	* Makefile.am (bfin-lex.o): Add bfin-parse.h and
	$(srcdir)/config/bfin-defs.h to the prerequisite.
	* Makefile.in: Regenerate.

Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.181
diff -u -r1.181 Makefile.am
--- Makefile.am	26 Aug 2009 18:27:36 -0000	1.181
+++ Makefile.am	1 Sep 2009 09:39:07 -0000
@@ -611,7 +611,7 @@
 
 bfin-lex.c: $(srcdir)/config/bfin-lex.l
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c
+bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 if am__fastdepCC
 	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
 	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po


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

end of thread, other threads:[~2009-09-02  6:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01  6:50 Parallel build error for Blackfin target Jie Zhang
2009-09-01  7:11 ` Dave Korn
2009-09-01  8:29   ` Jie Zhang
2009-09-01  8:41     ` Jie Zhang
2009-09-01  9:58       ` [PATCH] Fix parallel build error for Blackfin target (was Re: Parallel build error for Blackfin target) Jie Zhang
2009-09-01 21:14         ` Ralf Wildenhues
2009-09-02  6:24           ` Jie Zhang
2009-09-01 21:00   ` Parallel build error for Blackfin target Ralf Wildenhues

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 read-only IMAP folder(s) and NNTP newsgroup(s).