All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
@ 2011-10-18  0:18 Alexander Graf
  2011-10-18  6:45 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Alexander Graf @ 2011-10-18  0:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc

We have several targets in the PPC tree now that basically require libfdt
to function properly, namely the pseries and the e500 targets. This dependency
will rather increase than decrease in the future, so I want to make sure
that people building shiny new 1.0 actually have libfdt installed to get
rid of a few ifdefs in the code.

Warning: This patch will likely make configure fail for people who don't
select their own --target-list, but don't have libfdt development packages
installed. However, we really need this new dependency to move on.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 configure |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 3bdb556..ae0a872 100755
--- a/configure
+++ b/configure
@@ -3389,6 +3389,15 @@ case "$target_arch2" in
       fi
     fi
 esac
+if test "$fdt" != "yes" -a \( "$target_arch2" = "ppc" -o \
+        "$target_arch2" = "ppc64" -o "$target_arch2" = "ppcemb" \); then
+  echo
+  echo "Error: libfdt missing"
+  echo "The PowerPC target requires libfdt to work properly."
+  echo "Please make sure to have it and its development packages installed"
+  echo
+  exit 1
+fi
 if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
   echo "CONFIG_PSERIES=y" >> $config_target_mak
 fi
-- 
1.6.0.2

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  0:18 [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available Alexander Graf
@ 2011-10-18  6:45 ` Paolo Bonzini
  2011-10-18 19:26   ` Richard Henderson
  2011-10-18  8:55 ` Andreas Färber
  2011-10-18  9:47 ` [Qemu-devel] " Peter Maydell
  2 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2011-10-18  6:45 UTC (permalink / raw)
  To: qemu-devel

On 10/18/2011 02:18 AM, Alexander Graf wrote:
> We have several targets in the PPC tree now that basically require libfdt
> to function properly, namely the pseries and the e500 targets. This dependency
> will rather increase than decrease in the future, so I want to make sure
> that people building shiny new 1.0 actually have libfdt installed to get
> rid of a few ifdefs in the code.
>
> Warning: This patch will likely make configure fail for people who don't
> select their own --target-list, but don't have libfdt development packages
> installed. However, we really need this new dependency to move on.
>
> Signed-off-by: Alexander Graf<agraf@suse.de>

F15 has them, and they install also on older Fedoras if you pick them 
from Koji.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  0:18 [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available Alexander Graf
  2011-10-18  6:45 ` Paolo Bonzini
@ 2011-10-18  8:55 ` Andreas Färber
  2011-10-18  9:02   ` Alexander Graf
  2011-10-18 11:37   ` [Qemu-devel] [Qemu-ppc] " David Gibson
  2011-10-18  9:47 ` [Qemu-devel] " Peter Maydell
  2 siblings, 2 replies; 15+ messages in thread
From: Andreas Färber @ 2011-10-18  8:55 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-ppc, qemu-devel, david

Am 18.10.2011 02:18, schrieb Alexander Graf:
> We have several targets in the PPC tree now that basically require libfdt
> to function properly, namely the pseries and the e500 targets. This dependency
> will rather increase than decrease in the future, so I want to make sure
> that people building shiny new 1.0 actually have libfdt installed to get
> rid of a few ifdefs in the code.
> 
> Warning: This patch will likely make configure fail for people who don't
> select their own --target-list, but don't have libfdt development packages
> installed. However, we really need this new dependency to move on.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

openSUSE 12.1 has libfdt1-devel, but you should set up a submodule and
working build rules for Darwin, Haiku, etc. `make` doesn't fully work so
I used custom scripts to build the right parts and to manually "install"
the resulting binary and headers.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746, AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  8:55 ` Andreas Färber
@ 2011-10-18  9:02   ` Alexander Graf
  2011-10-18 18:30     ` Blue Swirl
  2011-10-18 11:37   ` [Qemu-devel] [Qemu-ppc] " David Gibson
  1 sibling, 1 reply; 15+ messages in thread
From: Alexander Graf @ 2011-10-18  9:02 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-ppc, qemu-devel, david


Am 18.10.2011 um 10:55 schrieb Andreas Färber <afaerber@suse.de>:

> Am 18.10.2011 02:18, schrieb Alexander Graf:
>> We have several targets in the PPC tree now that basically require libfdt
>> to function properly, namely the pseries and the e500 targets. This dependency
>> will rather increase than decrease in the future, so I want to make sure
>> that people building shiny new 1.0 actually have libfdt installed to get
>> rid of a few ifdefs in the code.
>> 
>> Warning: This patch will likely make configure fail for people who don't
>> select their own --target-list, but don't have libfdt development packages
>> installed. However, we really need this new dependency to move on.
>> 
>> Signed-off-by: Alexander Graf <agraf@suse.de>
> 
> openSUSE 12.1 has libfdt1-devel, but you should set up a submodule and
> working build rules for Darwin, Haiku, etc. `make` doesn't fully work so
> I used custom scripts to build the right parts and to manually "install"
> the resulting binary and headers.

I don't fully understand. It's a build dependency, so whoever maintains libfdt / is interested in running ppc targets on those OSs needs to fix libfdt to build there.

It's really the same as a dependency on glib or sdl or ... :). It's just less well known (and less active as a project).


Alex

> 

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  0:18 [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available Alexander Graf
  2011-10-18  6:45 ` Paolo Bonzini
  2011-10-18  8:55 ` Andreas Färber
@ 2011-10-18  9:47 ` Peter Maydell
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2011-10-18  9:47 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-ppc, qemu-devel

On 18 October 2011 01:18, Alexander Graf <agraf@suse.de> wrote:
> +if test "$fdt" != "yes" -a \( "$target_arch2" = "ppc" -o \
> +        "$target_arch2" = "ppc64" -o "$target_arch2" = "ppcemb" \); then
> +  echo
> +  echo "Error: libfdt missing"
> +  echo "The PowerPC target requires libfdt to work properly."
> +  echo "Please make sure to have it and its development packages installed"
> +  echo
> +  exit 1
> +fi
>  if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
>   echo "CONFIG_PSERIES=y" >> $config_target_mak
>  fi

The test -a, -o, ( and ) operators are deprecated (see the 'application
usage section' of the POSIX 'test' documentation:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
) -- better not to use them in new code.

Since target_arch2 == ppc64 and fdt != yes is now an impossible
combination, you could remove the fdt check from the condition
below which sets CONFIG_PSERIES.

Also, missing '.' after 'installed'.

-- PMM

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  8:55 ` Andreas Färber
  2011-10-18  9:02   ` Alexander Graf
@ 2011-10-18 11:37   ` David Gibson
  2011-10-20 18:35     ` Gerd Hoffmann
  1 sibling, 1 reply; 15+ messages in thread
From: David Gibson @ 2011-10-18 11:37 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-ppc, Alexander Graf, qemu-devel

On Tue, Oct 18, 2011 at 10:55:01AM +0200, Andreas Färber wrote:
> Am 18.10.2011 02:18, schrieb Alexander Graf:
> > We have several targets in the PPC tree now that basically require libfdt
> > to function properly, namely the pseries and the e500 targets. This dependency
> > will rather increase than decrease in the future, so I want to make sure
> > that people building shiny new 1.0 actually have libfdt installed to get
> > rid of a few ifdefs in the code.
> > 
> > Warning: This patch will likely make configure fail for people who don't
> > select their own --target-list, but don't have libfdt development packages
> > installed. However, we really need this new dependency to move on.
> > 
> > Signed-off-by: Alexander Graf <agraf@suse.de>
> 
> openSUSE 12.1 has libfdt1-devel, but you should set up a submodule and
> working build rules for Darwin, Haiku, etc. `make` doesn't fully work so
> I used custom scripts to build the right parts and to manually "install"
> the resulting binary and headers.

If there are build problems with libfdt on any platform let me know
about them.  I would like it to build clean as widely as possible, but
I don't have that great a diversity of build environments, so I have
to reply on bug reports.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  9:02   ` Alexander Graf
@ 2011-10-18 18:30     ` Blue Swirl
  2011-10-19  2:08       ` Alexander Graf
  0 siblings, 1 reply; 15+ messages in thread
From: Blue Swirl @ 2011-10-18 18:30 UTC (permalink / raw)
  To: Alexander Graf; +Cc: david, qemu-ppc, Andreas Färber, qemu-devel

On Tue, Oct 18, 2011 at 9:02 AM, Alexander Graf <agraf@suse.de> wrote:
>
> Am 18.10.2011 um 10:55 schrieb Andreas Färber <afaerber@suse.de>:
>
>> Am 18.10.2011 02:18, schrieb Alexander Graf:
>>> We have several targets in the PPC tree now that basically require libfdt
>>> to function properly, namely the pseries and the e500 targets. This dependency
>>> will rather increase than decrease in the future, so I want to make sure
>>> that people building shiny new 1.0 actually have libfdt installed to get
>>> rid of a few ifdefs in the code.
>>>
>>> Warning: This patch will likely make configure fail for people who don't
>>> select their own --target-list, but don't have libfdt development packages
>>> installed. However, we really need this new dependency to move on.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>
>> openSUSE 12.1 has libfdt1-devel, but you should set up a submodule and
>> working build rules for Darwin, Haiku, etc. `make` doesn't fully work so
>> I used custom scripts to build the right parts and to manually "install"
>> the resulting binary and headers.
>
> I don't fully understand. It's a build dependency, so whoever maintains libfdt / is interested in running ppc targets on those OSs needs to fix libfdt to build there.
>
> It's really the same as a dependency on glib or sdl or ... :). It's just less well known (and less active as a project).

It's not available on Ubuntu or Debian and I doubt that compiled
packages are available for OSX or Windows. OpenBSD does not have it in
the ports. So I'd use submodule approach.

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18  6:45 ` Paolo Bonzini
@ 2011-10-18 19:26   ` Richard Henderson
  2011-10-19  6:09     ` Paolo Bonzini
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2011-10-18 19:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 10/17/2011 11:45 PM, Paolo Bonzini wrote:
> On 10/18/2011 02:18 AM, Alexander Graf wrote:
>> We have several targets in the PPC tree now that basically require libfdt
>> to function properly, namely the pseries and the e500 targets. This dependency
>> will rather increase than decrease in the future, so I want to make sure
>> that people building shiny new 1.0 actually have libfdt installed to get
>> rid of a few ifdefs in the code.
>>
>> Warning: This patch will likely make configure fail for people who don't
>> select their own --target-list, but don't have libfdt development packages
>> installed. However, we really need this new dependency to move on.
>>
>> Signed-off-by: Alexander Graf<agraf@suse.de>
> 
> F15 has them, and they install also on older Fedoras if you pick them from Koji.
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Really?  Under what name?


$ cat /etc/fedora-release 
Fedora release 15 (Lovelock)
$ sudo yum search libfdt
Loaded plugins: langpacks, presto, refresh-packagekit
Warning: No matches found for: libfdt
No Matches found
$ sudo yum search fdt
Loaded plugins: langpacks, presto, refresh-packagekit
================================= Matched: fdt =================================
eclipse-photran-intel.noarch : Intel Fortran compiler support for Photran


I actually spent several hours looking for libfdt a weekend or
two ago without success and eventually gave up.  Perhaps I simply
have no idea what I'm looking for, but that said, I suspect many
others won't know either.

Please also add some INSTALL and/or wiki documentation about how
to find sources and/or pre-built packages for common distros.


r~

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18 18:30     ` Blue Swirl
@ 2011-10-19  2:08       ` Alexander Graf
  0 siblings, 0 replies; 15+ messages in thread
From: Alexander Graf @ 2011-10-19  2:08 UTC (permalink / raw)
  To: Blue Swirl; +Cc: david, qemu-ppc, Andreas Färber, qemu-devel


On 18.10.2011, at 11:30, Blue Swirl wrote:

> On Tue, Oct 18, 2011 at 9:02 AM, Alexander Graf <agraf@suse.de> wrote:
>> 
>> Am 18.10.2011 um 10:55 schrieb Andreas Färber <afaerber@suse.de>:
>> 
>>> Am 18.10.2011 02:18, schrieb Alexander Graf:
>>>> We have several targets in the PPC tree now that basically require libfdt
>>>> to function properly, namely the pseries and the e500 targets. This dependency
>>>> will rather increase than decrease in the future, so I want to make sure
>>>> that people building shiny new 1.0 actually have libfdt installed to get
>>>> rid of a few ifdefs in the code.
>>>> 
>>>> Warning: This patch will likely make configure fail for people who don't
>>>> select their own --target-list, but don't have libfdt development packages
>>>> installed. However, we really need this new dependency to move on.
>>>> 
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> 
>>> openSUSE 12.1 has libfdt1-devel, but you should set up a submodule and
>>> working build rules for Darwin, Haiku, etc. `make` doesn't fully work so
>>> I used custom scripts to build the right parts and to manually "install"
>>> the resulting binary and headers.
>> 
>> I don't fully understand. It's a build dependency, so whoever maintains libfdt / is interested in running ppc targets on those OSs needs to fix libfdt to build there.
>> 
>> It's really the same as a dependency on glib or sdl or ... :). It's just less well known (and less active as a project).
> 
> It's not available on Ubuntu or Debian and I doubt that compiled
> packages are available for OSX or Windows. OpenBSD does not have it in
> the ports. So I'd use submodule approach.

If we do a submodule, it will never get packaged. And then we'll practically have yet another fork of it :(. The submodule approach is reasonable for our binary blobs, sure. But this is a library and IMHO should be treated as such.


Alex

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

* Re: [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18 19:26   ` Richard Henderson
@ 2011-10-19  6:09     ` Paolo Bonzini
  0 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2011-10-19  6:09 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

On 10/18/2011 09:26 PM, Richard Henderson wrote:
>> >
>> >  F15 has them, and they install also on older Fedoras if you pick them from Koji.
>> >
>> >  Acked-by: Paolo Bonzini<pbonzini@redhat.com>
> Really?  Under what name?

Uhm, _F16_ has them, and they install also on older Fedoras if you pick 
them from Koji.

Paolo

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-18 11:37   ` [Qemu-devel] [Qemu-ppc] " David Gibson
@ 2011-10-20 18:35     ` Gerd Hoffmann
  2011-10-21  3:34       ` David Gibson
  2011-10-21  7:34       ` Paolo Bonzini
  0 siblings, 2 replies; 15+ messages in thread
From: Gerd Hoffmann @ 2011-10-20 18:35 UTC (permalink / raw)
  To: Andreas Färber, Alexander Graf, qemu-ppc, qemu-devel

  Hi,

> If there are build problems with libfdt on any platform let me know
> about them.  I would like it to build clean as widely as possible, but
> I don't have that great a diversity of build environments, so I have
> to reply on bug reports.

Fails to build on RHEL-5:

         CC convert-dtsv0-lexer.lex.o
cc1: warnings being treated as errors
convert-dtsv0-lexer.lex.c:693: warning: no previous prototype for ‘yylex’
make: *** [convert-dtsv0-lexer.lex.o] Error 1

Removing -Werror from the Makefile gets me a bit further:

         CC dtc-lexer.lex.o
dtc-lexer.lex.c:683: warning: no previous prototype for ‘yylex’
dtc-lexer.l: In function ‘push_input_file’:
dtc-lexer.l:192: warning: implicit declaration of function
‘yypush_buffer_state’
dtc-lexer.l:192: warning: nested extern declaration of ‘yypush_buffer_state’
dtc-lexer.l: In function ‘pop_input_file’:
dtc-lexer.l:201: warning: implicit declaration of function
‘yypop_buffer_state’
dtc-lexer.l:201: warning: nested extern declaration of ‘yypop_buffer_state’
         CC dtc-parser.tab.o
         LD dtc
dtc-lexer.lex.o: In function `push_input_file':
/home/buildbot/git/dtc/dtc-lexer.l:192: undefined reference to
`yypush_buffer_state'
dtc-lexer.lex.o: In function `pop_input_file':
/home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
`yypop_buffer_state'
collect2: ld returned 1 exit status
make: *** [dtc] Error 1

I guess the flex version shipped with RHEL-5 is too old.

$ rpm -qf $(which lex)
flex-2.5.4a-41.fc6

cheers,
  Gerd

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-20 18:35     ` Gerd Hoffmann
@ 2011-10-21  3:34       ` David Gibson
  2011-10-21  7:11         ` Gerd Hoffmann
  2011-10-21  7:34       ` Paolo Bonzini
  1 sibling, 1 reply; 15+ messages in thread
From: David Gibson @ 2011-10-21  3:34 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel, qemu-ppc, Andreas Färber, Alexander Graf

On Thu, Oct 20, 2011 at 08:35:45PM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > If there are build problems with libfdt on any platform let me know
> > about them.  I would like it to build clean as widely as possible, but
> > I don't have that great a diversity of build environments, so I have
> > to reply on bug reports.
> 
> Fails to build on RHEL-5:
> 
>          CC convert-dtsv0-lexer.lex.o
> cc1: warnings being treated as errors
> convert-dtsv0-lexer.lex.c:693: warning: no previous prototype for ‘yylex’
> make: *** [convert-dtsv0-lexer.lex.o] Error 1

This one I can work around, but there's probably not much point because...

> Removing -Werror from the Makefile gets me a bit further:
> 
>          CC dtc-lexer.lex.o
> dtc-lexer.lex.c:683: warning: no previous prototype for ‘yylex’
> dtc-lexer.l: In function ‘push_input_file’:
> dtc-lexer.l:192: warning: implicit declaration of function
> ‘yypush_buffer_state’
> dtc-lexer.l:192: warning: nested extern declaration of ‘yypush_buffer_state’
> dtc-lexer.l: In function ‘pop_input_file’:
> dtc-lexer.l:201: warning: implicit declaration of function
> ‘yypop_buffer_state’
> dtc-lexer.l:201: warning: nested extern declaration of ‘yypop_buffer_state’
>          CC dtc-parser.tab.o
>          LD dtc
> dtc-lexer.lex.o: In function `push_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:192: undefined reference to
> `yypush_buffer_state'
> dtc-lexer.lex.o: In function `pop_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
> `yypop_buffer_state'
> collect2: ld returned 1 exit status
> make: *** [dtc] Error 1

...this is harder.  I do rely fairly heavily on the lex multiple input
buffer support for processing includes.  I'm not sure when that went
in, but obviously after flex 2.5.4.

I could rewrite to not rely on the flex stuff and do it myself, but it
would be non-trivial, so I'm afraid that fix won't happen particularly
soon.

> I guess the flex version shipped with RHEL-5 is too old.
> 
> $ rpm -qf $(which lex)
> flex-2.5.4a-41.fc6

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-21  3:34       ` David Gibson
@ 2011-10-21  7:11         ` Gerd Hoffmann
  0 siblings, 0 replies; 15+ messages in thread
From: Gerd Hoffmann @ 2011-10-21  7:11 UTC (permalink / raw)
  To: Andreas Färber, Alexander Graf, qemu-ppc, qemu-devel

  Hi,

>> dtc-lexer.lex.o: In function `pop_input_file':
>> /home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
>> `yypop_buffer_state'
>> collect2: ld returned 1 exit status
>> make: *** [dtc] Error 1
> 
> ...this is harder.  I do rely fairly heavily on the lex multiple input
> buffer support for processing includes.  I'm not sure when that went
> in, but obviously after flex 2.5.4.

> I could rewrite to not rely on the flex stuff and do it myself, but it
> would be non-trivial, so I'm afraid that fix won't happen particularly
> soon.

For the record: Updating flex to 2.5.35 made dtc build fine on RHEL-5.

cheers,
  Gerd

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-20 18:35     ` Gerd Hoffmann
  2011-10-21  3:34       ` David Gibson
@ 2011-10-21  7:34       ` Paolo Bonzini
  2011-10-24  2:22         ` David Gibson
  1 sibling, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2011-10-21  7:34 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: Gerd Hoffmann, David Gibson

On 10/20/2011 08:35 PM, Gerd Hoffmann wrote:
>    Hi,
> 
>> If there are build problems with libfdt on any platform let me know
>> about them.  I would like it to build clean as widely as possible, but
>> I don't have that great a diversity of build environments, so I have
>> to reply on bug reports.
> 
> Fails to build on RHEL-5:
> 
>           CC convert-dtsv0-lexer.lex.o
> cc1: warnings being treated as errors
> convert-dtsv0-lexer.lex.c:693: warning: no previous prototype for 'yylex'
> make: *** [convert-dtsv0-lexer.lex.o] Error 1
> 
> Removing -Werror from the Makefile gets me a bit further:
> 
>           CC dtc-lexer.lex.o
> dtc-lexer.lex.c:683: warning: no previous prototype for 'yylex'
> dtc-lexer.l: In function 'push_input_file':
> dtc-lexer.l:192: warning: implicit declaration of function 'yypush_buffer_state'
> dtc-lexer.l:192: warning: nested extern declaration of 'yypush_buffer_state'
> dtc-lexer.l: In function 'pop_input_file':
> dtc-lexer.l:201: warning: implicit declaration of function 'yypop_buffer_state'
> dtc-lexer.l:201: warning: nested extern declaration of 'yypop_buffer_state'
>           CC dtc-parser.tab.o
>           LD dtc
> dtc-lexer.lex.o: In function `push_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:192: undefined reference to
> `yypush_buffer_state'
> dtc-lexer.lex.o: In function `pop_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
> `yypop_buffer_state'
> collect2: ld returned 1 exit status
> make: *** [dtc] Error 1
> 
> I guess the flex version shipped with RHEL-5 is too old.
> 
> $ rpm -qf $(which lex)
> flex-2.5.4a-41.fc6

flex is only used by dtc, not libfdt, so you can probably patch it out.
However, the usual convention is that lex- and yacc-generated files
are shipped in the tarball, with a "make dist" that wraps tar and/or
git-archive.  See the following patch.

Paolo

------------------ 8< -------------------------

>From f91c3f5f165df8c8331c0c33374f55f5cf157ba6 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 21 Oct 2011 08:59:43 +0200
Subject: [PATCH] build: add make dist

The usual convention is that lex- and yacc-generated files are shipped in
the tarball.  Another usual convention, originating in Automake, is that
"make dist" wraps tar and/or git-archive and generates a self-contained
archive.  dtc does not use Automake, so add this target.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile     |   23 +++++++++++++++++++++++
 Makefile.dtc |    4 ++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b32409b..edfdb9c 100644
--- a/Makefile
+++ b/Makefile
@@ -246,4 +246,27 @@ $(LIBFDT_lib):
 	@$(VECHO) BISON $@
 	$(BISON) -d $<
 
+.PHONY: distdir dist-gz dist-xz dist
+
+distdir = dtc-$(dtc_version)/
+distdir: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS)
+	mkdir $(distdir)
+	@$(VECHO) DISTDIR $@
+	git archive --format=tar HEAD --prefix=$(distdir) | tar -xf -
+	@for i in $^; do \
+		$(if $(V),echo cp $$i $(distdir),:); \
+		cp $$i $(distdir); \
+	done
+	chmod -R ug+w $(distdir)
+
+dist-gz: distdir
+	@$(VECHO) TAR dtc-$(dtc_version).tar.gz
+	tar -chozf dtc-$(dtc_version).tar.gz $(distdir)
+dist-xz: distdir
+	@$(VECHO) TAR dtc-$(dtc_version).tar.xz
+	tar -Ixz -chof dtc-$(dtc_version).tar.xz $(distdir)
+
+dist: dist-gz dist-xz
+	rm -rf $(distdir)
+
 FORCE:
diff --git a/Makefile.dtc b/Makefile.dtc
index bece49b..0b2c869 100644
--- a/Makefile.dtc
+++ b/Makefile.dtc
@@ -14,5 +14,5 @@ DTC_SRCS = \
 	treesource.c \
 	util.c
 
-DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
-DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
+DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
+DTC_OBJS = $(patsubst %.c,%.o,$(DTC_SRCS) $(filter %.c, $(DTC_GEN_SRCS)))
-- 
1.7.6

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
  2011-10-21  7:34       ` Paolo Bonzini
@ 2011-10-24  2:22         ` David Gibson
  0 siblings, 0 replies; 15+ messages in thread
From: David Gibson @ 2011-10-24  2:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-ppc, qemu-devel, Gerd Hoffmann

On Fri, Oct 21, 2011 at 09:34:22AM +0200, Paolo Bonzini wrote:
> On 10/20/2011 08:35 PM, Gerd Hoffmann wrote:
> >    Hi,
> > 
> >> If there are build problems with libfdt on any platform let me know
> >> about them.  I would like it to build clean as widely as possible, but
> >> I don't have that great a diversity of build environments, so I have
> >> to reply on bug reports.
> > 
> > Fails to build on RHEL-5:
> > 
> >           CC convert-dtsv0-lexer.lex.o
> > cc1: warnings being treated as errors
> > convert-dtsv0-lexer.lex.c:693: warning: no previous prototype for 'yylex'
> > make: *** [convert-dtsv0-lexer.lex.o] Error 1
> > 
> > Removing -Werror from the Makefile gets me a bit further:
> > 
> >           CC dtc-lexer.lex.o
> > dtc-lexer.lex.c:683: warning: no previous prototype for 'yylex'
> > dtc-lexer.l: In function 'push_input_file':
> > dtc-lexer.l:192: warning: implicit declaration of function 'yypush_buffer_state'
> > dtc-lexer.l:192: warning: nested extern declaration of 'yypush_buffer_state'
> > dtc-lexer.l: In function 'pop_input_file':
> > dtc-lexer.l:201: warning: implicit declaration of function 'yypop_buffer_state'
> > dtc-lexer.l:201: warning: nested extern declaration of 'yypop_buffer_state'
> >           CC dtc-parser.tab.o
> >           LD dtc
> > dtc-lexer.lex.o: In function `push_input_file':
> > /home/buildbot/git/dtc/dtc-lexer.l:192: undefined reference to
> > `yypush_buffer_state'
> > dtc-lexer.lex.o: In function `pop_input_file':
> > /home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
> > `yypop_buffer_state'
> > collect2: ld returned 1 exit status
> > make: *** [dtc] Error 1
> > 
> > I guess the flex version shipped with RHEL-5 is too old.
> > 
> > $ rpm -qf $(which lex)
> > flex-2.5.4a-41.fc6
> 
> flex is only used by dtc, not libfdt, so you can probably patch it
> out.

Well, you can just "make libfdt" instead of "make all".

> However, the usual convention is that lex- and yacc-generated files
> are shipped in the tarball, with a "make dist" that wraps tar and/or
> git-archive.  See the following patch.

Well, it's _a_ convention that's used sometimes.  Particularly for
projects where the lex/yacc based parser is some little side thing,
rather than the core component.  That said, a "make dist" target for
dtc is probably not a bad idea.  Even though we don't really build
tarballs with the frequency we probably should.

[snip]
> diff --git a/Makefile b/Makefile
> index b32409b..edfdb9c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -246,4 +246,27 @@ $(LIBFDT_lib):
>  	@$(VECHO) BISON $@
>  	$(BISON) -d $<
>  
> +.PHONY: distdir dist-gz dist-xz dist
> +
> +distdir = dtc-$(dtc_version)/
> +distdir: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS)
> +	mkdir $(distdir)
> +	@$(VECHO) DISTDIR $@
> +	git archive --format=tar HEAD --prefix=$(distdir) | tar -xf -

I'm a little uncomfortable with this, since it means you can only make
dist from a git tree; you can't make dist to recreate a tarball from
itself.

> +	@for i in $^; do \
> +		$(if $(V),echo cp $$i $(distdir),:); \
> +		cp $$i $(distdir); \
> +	done
> +	chmod -R ug+w $(distdir)
> +
> +dist-gz: distdir
> +	@$(VECHO) TAR dtc-$(dtc_version).tar.gz
> +	tar -chozf dtc-$(dtc_version).tar.gz $(distdir)
> +dist-xz: distdir
> +	@$(VECHO) TAR dtc-$(dtc_version).tar.xz
> +	tar -Ixz -chof dtc-$(dtc_version).tar.xz $(distdir)
> +
> +dist: dist-gz dist-xz
> +	rm -rf $(distdir)
> +
>  FORCE:
> diff --git a/Makefile.dtc b/Makefile.dtc
> index bece49b..0b2c869 100644
> --- a/Makefile.dtc
> +++ b/Makefile.dtc
> @@ -14,5 +14,5 @@ DTC_SRCS = \
>  	treesource.c \
>  	util.c
>  
> -DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
> -DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
> +DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
> +DTC_OBJS = $(patsubst %.c,%.o,$(DTC_SRCS) $(filter %.c, $(DTC_GEN_SRCS)))

This is wrong though.  The Makefile.* fragments are designed to be
usable from other make systems, when libfdt or whatever is embedded in
other projects.  Therefore, I don't want to change the semantics of
this variable from the present meaning of "generated files which need
to be compiled with a C compiler and linked into the dtc binary".
Instead you should create a new variable to cover other generated
files which you can also use from the make dist target.

With that fixed, you can send this to jdl@jdl.com (dtc maintainer) and
devicetree-discuss@lists.ozlabs.org which is the usual forum for
dtc patches.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

end of thread, other threads:[~2011-10-24  2:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18  0:18 [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available Alexander Graf
2011-10-18  6:45 ` Paolo Bonzini
2011-10-18 19:26   ` Richard Henderson
2011-10-19  6:09     ` Paolo Bonzini
2011-10-18  8:55 ` Andreas Färber
2011-10-18  9:02   ` Alexander Graf
2011-10-18 18:30     ` Blue Swirl
2011-10-19  2:08       ` Alexander Graf
2011-10-18 11:37   ` [Qemu-devel] [Qemu-ppc] " David Gibson
2011-10-20 18:35     ` Gerd Hoffmann
2011-10-21  3:34       ` David Gibson
2011-10-21  7:11         ` Gerd Hoffmann
2011-10-21  7:34       ` Paolo Bonzini
2011-10-24  2:22         ` David Gibson
2011-10-18  9:47 ` [Qemu-devel] " Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.