diff mbox

[PPL] : Fix static PPL 0.11 case

Message ID b9abe19b51.Jo@hobbes.bass-software.com
State New
Headers show

Commit Message

John Tytgat Jan. 27, 2011, 12:14 a.m. UTC
After having switched from PPL 0.10.2 to 0.11 and CLooG 0.15.9 to
0.15.10 my build (cross-compile, target arm-unknown-eabi) breaks with:

--8<--
gcc   -O0 -g -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H  -o cc1 c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o arm-c.o \
	  cc1-checksum.o main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -Wl,-lstdc++ -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lcloog -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lppl_c -lppl -lgmpxx -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -Wl,-lstdc++ -L../zlib -lz
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `~Watchdog':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1451: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1452: undefined reference to `Parma_Watchdog_Library::Watchdog::remove_watchdog_event(Parma_Watchdog_Library::EList_Iterator<Parma_Watchdog_Library::Pending_Element<Parma_Watchdog_Library::Time> >)'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1453: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `Init':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `Watchdog<Parma_Polyhedra_Library::Throwable, Parma_Polyhedra_Library::Interfaces::C::timeout_exception>':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1432: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1433: undefined reference to `Parma_Watchdog_Library::Watchdog::new_watchdog_event(unsigned int, Parma_Watchdog_Library::Handler const&, bool&)'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1434: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `~Init':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1475: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1475: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1477: undefined reference to `Parma_Watchdog_Library::Watchdog::finalize()'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Polyhedron.o): In function `Init':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Octagonal_Shape_mpz_class.o): In function `Init':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Pointset_Powerset_C_Polyhedron.o): In function `Init':
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
collect2: ld returned 1 exit status
--8<--

The reason is that PPL (and other libs like CLooG, GMP) are configured
with --disable-shared and that we need libpwl.a in our link line.

Attached patch addresses this problem.  Please commit after review.

John Tytgat  <John.Tytgat@aaug.net>

	* configure.ac (ppllibs): Add -lpwl.



John.

Comments

Ryan Hill Jan. 27, 2011, 2:53 a.m. UTC | #1
On Thu, 27 Jan 2011 01:14:50 +0100
John Tytgat <John.Tytgat@aaug.net> wrote:

> After having switched from PPL 0.10.2 to 0.11 and CLooG 0.15.9 to
> 0.15.10 my build (cross-compile, target arm-unknown-eabi) breaks with:
> 
> --8<--
> gcc   -O0 -g -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H  -o cc1 c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o arm-c.o \
> 	  cc1-checksum.o main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -Wl,-lstdc++ -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lcloog -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lppl_c -lppl -lgmpxx -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -L/home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -Wl,-lstdc++ -L../zlib -lz
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `~Watchdog':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1451: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1452: undefined reference to `Parma_Watchdog_Library::Watchdog::remove_watchdog_event(Parma_Watchdog_Library::EList_Iterator<Parma_Watchdog_Library::Pending_Element<Parma_Watchdog_Library::Time> >)'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1453: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `Init':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `Watchdog<Parma_Polyhedra_Library::Throwable, Parma_Polyhedra_Library::Interfaces::C::timeout_exception>':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1432: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1433: undefined reference to `Parma_Watchdog_Library::Watchdog::new_watchdog_event(unsigned int, Parma_Watchdog_Library::Handler const&, bool&)'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1434: undefined reference to `Parma_Watchdog_Library::Watchdog::in_critical_section'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_implementation_common.o): In function `~Init':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1475: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1475: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1477: undefined reference to `Parma_Watchdog_Library::Watchdog::finalize()'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Polyhedron.o): In function `Init':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Octagonal_Shape_mpz_class.o): In function `Init':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/installed-libs-for-cross-gcc/lib/libppl_c.a(ppl_c_Pointset_Powerset_C_Polyhedron.o): In function `Init':
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1466: undefined reference to `Parma_Watchdog_Library::Init::count'
> /home/joty/projects/gccsdk/gccsdk_svn7/gcc4/builddir/cross-ppl/interfaces/C/../../Watchdog/src/pwl.hh:1468: undefined reference to `Parma_Watchdog_Library::Watchdog::initialize()'
> collect2: ld returned 1 exit status
> --8<--
> 
> The reason is that PPL (and other libs like CLooG, GMP) are configured
> with --disable-shared and that we need libpwl.a in our link line.
> 
> Attached patch addresses this problem.  Please commit after review.
> 
> John Tytgat  <John.Tytgat@aaug.net>
> 
> 	* configure.ac (ppllibs): Add -lpwl.
> 
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 169306)
> +++ configure.ac	(working copy)
> @@ -1621,7 +1621,7 @@
>  AC_SUBST(poststage1_ldflags)
>  
>  # Check for PPL
> -ppllibs=" -lppl_c -lppl -lgmpxx"
> +ppllibs=" -lppl_c -lppl -lpwl -lgmpxx"
>  pplinc=
>  
>  AC_ARG_WITH(ppl,
> @@ -1643,7 +1643,7 @@
>    "" | yes)
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac
> @@ -1651,10 +1651,10 @@
>    pplinc="-I$with_ppl_include $pplinc"
>  fi
>  if test "x$with_ppl_lib" != x; then
> -  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
> +  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lpwl -lgmpxx"
>  fi
>  if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
> -  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx '
> +  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lpwl -lgmpxx '
>    pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
>    enable_ppl_version_check=no
>  fi
> 
> 
> John.

If PPL is configured with --disable-watchdog, then libpwl doesn't exist.  If
GCC doesn't require it then it shouldn't be linked in.
Ryan Hill Jan. 27, 2011, 3 a.m. UTC | #2
On Thu, 27 Jan 2011 01:14:50 +0100
John Tytgat <John.Tytgat@aaug.net> wrote:

> @@ -1643,7 +1643,7 @@
>    "" | yes)
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac

I was wondering where those -Lyes/lib -Iyes/include were coming from...
John Tytgat Jan. 27, 2011, 11 p.m. UTC | #3
In message <20110126210028.740be681@gentoo.org>
          Ryan Hill <dirtyepic@gentoo.org> wrote:

> On Thu, 27 Jan 2011 01:14:50 +0100
> John Tytgat <John.Tytgat@aaug.net> wrote:
> 
> > @@ -1643,7 +1643,7 @@
> >    "" | yes)
> >      ;;
> >    *)
> > -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> > +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
> >      pplinc="-I$with_ppl/include $pplinc"
> >      ;;
> >  esac
> 
> I was wondering where those -Lyes/lib -Iyes/include were coming from...

I'm wondering how you can have such an output when the "yes" case has
been catched a couple of lines above.

John.
John Tytgat Jan. 27, 2011, 11:02 p.m. UTC | #4
In message <20110126205355.5193d953@gentoo.org>
          Ryan Hill <dirtyepic@gentoo.org> wrote:

> If PPL is configured with --disable-watchdog, then libpwl doesn't exist.  If
> GCC doesn't require it then it shouldn't be linked in.

Even if libpwl does not exist, it doesn't do any harm by having it
specified in the GCC link line.  This patch avoids a link breakage
for those who already have a PPL built with watchdog support and want to
use static libraries.

John.
Ryan Hill Jan. 28, 2011, 12:39 a.m. UTC | #5
On Fri, 28 Jan 2011 00:00:42 +0100
John Tytgat <John.Tytgat@aaug.net> wrote:

> In message <20110126210028.740be681@gentoo.org>
>           Ryan Hill <dirtyepic@gentoo.org> wrote:
> 
> > On Thu, 27 Jan 2011 01:14:50 +0100
> > John Tytgat <John.Tytgat@aaug.net> wrote:
> > 
> > > @@ -1643,7 +1643,7 @@
> > >    "" | yes)
> > >      ;;
> > >    *)
> > > -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> > > +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
> > >      pplinc="-I$with_ppl/include $pplinc"
> > >      ;;
> > >  esac
> > 
> > I was wondering where those -Lyes/lib -Iyes/include were coming from...
> 
> I'm wondering how you can have such an output when the "yes" case has
> been catched a couple of lines above.

You're right, I was seeing them with 4.4 which doesn't have that case.

In any case, it's a typo.
Ryan Hill Jan. 28, 2011, 12:49 a.m. UTC | #6
On Fri, 28 Jan 2011 00:02:24 +0100
John Tytgat <John.Tytgat@aaug.net> wrote:

> In message <20110126205355.5193d953@gentoo.org>
>           Ryan Hill <dirtyepic@gentoo.org> wrote:
> 
> > If PPL is configured with --disable-watchdog, then libpwl doesn't exist.  If
> > GCC doesn't require it then it shouldn't be linked in.
> 
> Even if libpwl does not exist, it doesn't do any harm by having it
> specified in the GCC link line.

Yeah, it does:

checking for installed CLooG PPL Legacy... no
configure: error: Unable to find a usable CLooG.  See config.log for details.

configure:5863: checking for installed CLooG PPL Legacy                                                                                     
configure:5882: x86_64-unknown-linux-gnu-gcc -o conftest -O2 -pipe -march=core2 -mtune=generic -I/usr/include/cloog-ppl    -DCLOOG_INT_GMP -DCLOOG_ORG -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed   -lppl_c -lppl -lpwl -lgmpxx conftest.c -lcloog  >&5                               
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lpwl                                  
collect2: ld returned 1 exit status                                                                                                         
configure:5882: $? = 1                                                                                                                      
configure: failed program was:                                                                                                              
| /* confdefs.h */                                                                                                                          
| #define PACKAGE_NAME ""                                                                                                                   
| #define PACKAGE_TARNAME ""                                                                                                                
| #define PACKAGE_VERSION ""                                                                                                                
| #define PACKAGE_STRING ""                                                                                                                 
| #define PACKAGE_BUGREPORT ""                                                                                                              
| #define PACKAGE_URL ""                                                                                                                    
| #define LT_OBJDIR ".libs/"                                                                                                                
| /* end confdefs.h.  */                                                                                                                    
| #include "cloog/cloog.h"                                                                                                                  
| int                                                                                                                                       
| main ()                                                                                                                                   
| {                                                                                                                                         
| #ifndef CLOOG_PPL_BACKEND                                                                                                                 
|     choke me                                                                                                                              
|    #endif
|   ;                                                                                                                                       
|   return 0;                                                                                                                               
| }                                                                                                                                         
configure:5890: result: no                                                                                                                  
configure:6112: error: Unable to find a usable CLooG.  See config.log for details.
Ryan Hill Jan. 28, 2011, 12:55 a.m. UTC | #7
On Thu, 27 Jan 2011 18:49:17 -0600
Ryan Hill <dirtyepic@gentoo.org> wrote:

> On Fri, 28 Jan 2011 00:02:24 +0100
> John Tytgat <John.Tytgat@aaug.net> wrote:
> 
> > In message <20110126205355.5193d953@gentoo.org>
> >           Ryan Hill <dirtyepic@gentoo.org> wrote:
> > 
> > > If PPL is configured with --disable-watchdog, then libpwl doesn't exist.  If
> > > GCC doesn't require it then it shouldn't be linked in.
> > 
> > Even if libpwl does not exist, it doesn't do any harm by having it
> > specified in the GCC link line.
> 
> Yeah, it does:

Sorry, that wrapped badly.

> checking for installed CLooG PPL Legacy... no
> configure: error: Unable to find a usable CLooG.  See config.log for details.
> 
> configure:5863: checking for installed CLooG PPL Legacy
> configure:5882: x86_64-unknown-linux-gnu-gcc -o conftest -O2 -pipe -march=core2 -mtune=generic -I/usr/include/cloog-ppl  -DCLOOG_INT_GMP -DCLOOG_ORG -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed  -lppl_c -lppl -lpwl -lgmpxx conftest.c -lcloog  >&5
> /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lpwl
> collect2: ld returned 1 exit status
> configure:5882: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME ""
> | #define PACKAGE_TARNAME ""
> | #define PACKAGE_VERSION ""
> | #define PACKAGE_STRING ""
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL ""
> | #define LT_OBJDIR ".libs/"
> | /* end confdefs.h.  */
> | #include "cloog/cloog.h"
> | int
> | main ()
> | {
> | #ifndef CLOOG_PPL_BACKEND
> |     choke me
> |    #endif
> |   ;
> |   return 0;
> | }
> configure:5890: result: no
> configure:6112: error: Unable to find a usable CLooG.  See config.log for details.
John Tytgat Jan. 28, 2011, 1:19 a.m. UTC | #8
In message <20110127183918.397ec01e@gentoo.org>
          Ryan Hill <dirtyepic@gentoo.org> wrote:

> On Fri, 28 Jan 2011 00:00:42 +0100
> John Tytgat <John.Tytgat@aaug.net> wrote:
> 
> > In message <20110126210028.740be681@gentoo.org>
> >           Ryan Hill <dirtyepic@gentoo.org> wrote:
> > 
> > > On Thu, 27 Jan 2011 01:14:50 +0100
> > > John Tytgat <John.Tytgat@aaug.net> wrote:
> > > 
> > > > @@ -1643,7 +1643,7 @@
> > > >    "" | yes)
> > > >      ;;
> > > >    *)
> > > > -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> > > > +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
> > > >      pplinc="-I$with_ppl/include $pplinc"
> > > >      ;;
> > > >  esac
> > > 
> > > I was wondering where those -Lyes/lib -Iyes/include were coming from...
> > 
> > I'm wondering how you can have such an output when the "yes" case has
> > been catched a couple of lines above.
> 
> You're right, I was seeing them with 4.4 which doesn't have that case.
> 
> In any case, it's a typo.

I fail to see the typo.  $with_ppl is the argument for --with-ppl with
description "specify prefix directory for the installed PPL package".
When it's empty or "yes" ppllibs remains "-lppl_c" -lppl -lgmpxx".
When it's "no", ppllibs is empty and any other value will make
ppllibs "-L$with_ppl/lib -lppl_c -lppl -lgmpxx".

John.
Ryan Hill Jan. 28, 2011, 1:26 a.m. UTC | #9
On Fri, 28 Jan 2011 02:19:42 +0100
John Tytgat <John.Tytgat@aaug.net> wrote:

> In message <20110127183918.397ec01e@gentoo.org>
>           Ryan Hill <dirtyepic@gentoo.org> wrote:
> 
> > On Fri, 28 Jan 2011 00:00:42 +0100
> > John Tytgat <John.Tytgat@aaug.net> wrote:
> > 
> > > In message <20110126210028.740be681@gentoo.org>
> > >           Ryan Hill <dirtyepic@gentoo.org> wrote:
> > > 
> > > > On Thu, 27 Jan 2011 01:14:50 +0100
> > > > John Tytgat <John.Tytgat@aaug.net> wrote:
> > > > 
> > > > > @@ -1643,7 +1643,7 @@
> > > > >    "" | yes)
> > > > >      ;;
> > > > >    *)
> > > > > -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> > > > > +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
> > > > >      pplinc="-I$with_ppl/include $pplinc"
> > > > >      ;;
> > > > >  esac
> > > > 
> > > > I was wondering where those -Lyes/lib -Iyes/include were coming from...
> > > 
> > > I'm wondering how you can have such an output when the "yes" case has
> > > been catched a couple of lines above.
> > 
> > You're right, I was seeing them with 4.4 which doesn't have that case.
> > 
> > In any case, it's a typo.
> 
> I fail to see the typo.  $with_ppl is the argument for --with-ppl with
> description "specify prefix directory for the installed PPL package".
> When it's empty or "yes" ppllibs remains "-lppl_c" -lppl -lgmpxx".
> When it's "no", ppllibs is empty and any other value will make
> ppllibs "-L$with_ppl/lib -lppl_c -lppl -lgmpxx".

Now I see it, thanks.
Rainer Orth Jan. 28, 2011, 9:16 a.m. UTC | #10
John Tytgat <John.Tytgat@aaug.net> writes:

> The reason is that PPL (and other libs like CLooG, GMP) are configured
> with --disable-shared and that we need libpwl.a in our link line.
>
> Attached patch addresses this problem.  Please commit after review.
>
> John Tytgat  <John.Tytgat@aaug.net>
>
> 	* configure.ac (ppllibs): Add -lpwl.
>
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 169306)
> +++ configure.ac	(working copy)
> @@ -1621,7 +1621,7 @@
>  AC_SUBST(poststage1_ldflags)
>  
>  # Check for PPL
> -ppllibs=" -lppl_c -lppl -lgmpxx"
> +ppllibs=" -lppl_c -lppl -lpwl -lgmpxx"
>  pplinc=
>  
>  AC_ARG_WITH(ppl,
> @@ -1643,7 +1643,7 @@
>    "" | yes)
>      ;;
>    *)
> -    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
> +    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
>      pplinc="-I$with_ppl/include $pplinc"
>      ;;
>  esac
> @@ -1651,10 +1651,10 @@
>    pplinc="-I$with_ppl_include $pplinc"
>  fi
>  if test "x$with_ppl_lib" != x; then
> -  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
> +  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lpwl -lgmpxx"
>  fi
>  if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
> -  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx '
> +  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lpwl -lgmpxx '
>    pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
>    enable_ppl_version_check=no
>  fi

I had the same issue on Solaris recently (apart from others; this stuff
is a nightmare).  Unfortunately, your patch is incomplete: libppl.a uses
sqrt, which only lives in libm on some (most?) platforms.  While I've
simply been adding -lm above, a correct version needs to check if libm
is needed for sqrt and only add it if necessary.

Apart from that (and not your fault): please avoid duplicating the list
of libraries 4 times!  This is guaranteed to get inconsistent.

	Rainer
diff mbox

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 169306)
+++ configure.ac	(working copy)
@@ -1621,7 +1621,7 @@ 
 AC_SUBST(poststage1_ldflags)
 
 # Check for PPL
-ppllibs=" -lppl_c -lppl -lgmpxx"
+ppllibs=" -lppl_c -lppl -lpwl -lgmpxx"
 pplinc=
 
 AC_ARG_WITH(ppl,
@@ -1643,7 +1643,7 @@ 
   "" | yes)
     ;;
   *)
-    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
+    ppllibs="-L$with_ppl/lib -lppl_c -lppl -lpwl -lgmpxx"
     pplinc="-I$with_ppl/include $pplinc"
     ;;
 esac
@@ -1651,10 +1651,10 @@ 
   pplinc="-I$with_ppl_include $pplinc"
 fi
 if test "x$with_ppl_lib" != x; then
-  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
+  ppllibs="-L$with_ppl_lib -lppl_c -lppl -lpwl -lgmpxx"
 fi
 if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
-  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lgmpxx '
+  ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"' -lppl_c -lppl -lpwl -lgmpxx '
   pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
   enable_ppl_version_check=no
 fi