diff mbox

PPC: Fail configure when libfdt is not available

Message ID 1318897082-27413-1-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Oct. 18, 2011, 12:18 a.m. UTC
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(-)

Comments

Paolo Bonzini Oct. 18, 2011, 6:45 a.m. UTC | #1
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
Andreas Färber Oct. 18, 2011, 8:55 a.m. UTC | #2
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
Alexander Graf Oct. 18, 2011, 9:02 a.m. UTC | #3
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

>
Peter Maydell Oct. 18, 2011, 9:47 a.m. UTC | #4
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
David Gibson Oct. 18, 2011, 11:37 a.m. UTC | #5
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.
Blue Swirl Oct. 18, 2011, 6:30 p.m. UTC | #6
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.
Richard Henderson Oct. 18, 2011, 7:26 p.m. UTC | #7
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~
Alexander Graf Oct. 19, 2011, 2:08 a.m. UTC | #8
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
Paolo Bonzini Oct. 19, 2011, 6:09 a.m. UTC | #9
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
Gerd Hoffmann Oct. 20, 2011, 6:35 p.m. UTC | #10
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
David Gibson Oct. 21, 2011, 3:34 a.m. UTC | #11
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
Gerd Hoffmann Oct. 21, 2011, 7:11 a.m. UTC | #12
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
diff mbox

Patch

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