This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [CFT] in-tree GMP/MPFR, one more round


On Mon, 8 Jan 2007, Paolo Bonzini wrote:

> Paolo Bonzini wrote:
> > This patch is the final set of changes needed for in-tree GMP/MPFR.
> > Changes from the last iteration are that GMP and MPFR are only built
> > statically, and they are not installed.
>
> And here's the patch.
> Paolo

Hi Paolo - I tried the patch out on solaris2.10 and I ran into several
problems.  I assume you tested your patch and since it "worked" for you I
believe it's because you have a gmp/mpfr installed in /usr that gcc can
find which masks these problems, there's no way it could work otherwise
AFAICT.  Since you bypass the version checks you won't see anyting
unusual.  On my solaris2 box where there is no "system" gmp/mpfr it
doesn't work.

+host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
+		extra_configure_args='--disable-shared';
+		no_install= true;
+	        host="none-${host_vendor}-${host_os}";
+		target="none-${host_vendor}-${host_os}"; };
+host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
+		extra_configure_args='--disable-shared --with-gmp-build=../gmp';
+		no_install= true;
+	        host="none-${host_vendor}-${host_os}";
+		target="none-${host_vendor}-${host_os}"; };

First problem is the above hunk where you set extra_configure_args.
There is no such variable AFAICT.  It should be extra_configure_flags.
(i.e. "flags" not "args".)  There is another (mistaken?) instance of the
_args variant in fixincludes module, I'm not sure what problems that
causes.  Anyway, because this variable isn't set correctly, the shared
libaries get built, and mpfr configure can't find gmp.h so it bombs.  You
won't notice this if the header is also in a system area.


+if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d
${srcdir}/gmp; then
+  gmplibs="-L ../gmp/.libs -L ../${build_subdir}/gmp/_libs $gmplibs"
+  gmpinc="-I ../gmp -I${srcdir}/../gmp"

Second problem in gmpinc above.  When building gcc, there is no -I flag
telling gcc where to find mpfr.h.  Also, srcdir should be resolved in the
gcc/Makefile, not at the top level Makefile especially so that relative
paths work.  I.e. GMPINC should reference $(srcdir) in gcc/Makefile.in,
and not have the paths resolved already.  I couldn't figure out the
shell/Makefile quoting magic to get that working though. Again you won't
notice this if the mpfr.h header is also in a system area and maybe if in
addition you use hard paths.

The third problem below.

+gmplibs="-lgmp -lmpfr"

This link order won't work for static libs (at least on solaris2.)  I
think I mentioned this last time.  I get an error linking cc1 because of
missing gmp functions.  You need to put -lmpfr first so any gmp functions
used in libmpfr.a are pulled in from a following library.  This might have
worked for you because it built the shared libs from problem #1 and that
masked the problem.  I believe in the shared case, it doesn't error.


Anyway, by fixing all three problems I was able to build a c-only
--disable-bootstrap mainline using in-tree gmp/mpfr and a parallel build.
I haven't figured out how to fix #2 for real though, I had to hand massage
the GMPINC def in gcc/Makefile to get it going.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]