Second autotools transition report: State of the disUnion

Phil Edwards phil@jaj.com
Mon Jul 21 21:57:00 GMT 2003


I'm finished with the first attempt at converting libstdc++-v3 to the
new tools.  The first attempt means:  the tools can successfully generate
new scripts, and that the scripts run with no errors, and that a resulting
build compiles.

Doing a by-hand comparison of the running output of 'configure' for both
versions, I've confirmed that there are no major differences in the results
of the tests, with one glaring exception.  Every single math function linkage
test fails, because of a decisions made about std::exit by AC_PROG_CXX.
It automatically tries to declare std::exit for every test program, but:

    configure:19620: error: `void std::exit(int)' should have been declared inside
       `std'
    configure:19620: error: `std::exit' has not been declared
    configure:19636: $? = 1
    configure: failed program was:
 [... accumulated #define's ...]
    |
    | #ifdef __cplusplus
    | extern "C" void std::exit (int) throw (); using std::exit;
    | #endif
    | /* end confdefs.h.  */
    | #include <math.h>
    |             #ifdef HAVE_IEEEFP_H
    |             #include <ieeefp.h>
    |             #endif
    |
    | int
    | main ()
    | {
    |  isinf(0);
    |   ;
    |   return 0;
    | }


Why did it choose that particular form of forward declaration?  Because
AC_PROG_CXX had looped through a list of possible std::exit declarations,
and that one passed through the compiler.

Why did it work inside AC_PROG_CXX, but not during the various linkage
AC_TRY_COMPILE tests?  Because the linkage tests are done with -fno-builtin.

As an experiment, removing -fno-builtin from CXXFLAGS in the math linkage
tests gets all the individual ones to pass again, under i686-linux.  (I.e.,
the std::exit declaration is accepted, and there's nothing else wrong.)
Of course, that gets us back into the tarpit we were in before.


(The very good news is that AC_PROG_CXX seems to work when building a cross
compiler, so we may be able to finally stop trying to provide our own,
if we can find some solution to the builtins/exit issue.)

And no, I've not yet tried running the testsuite.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



More information about the Libstdc++ mailing list