6.0.0 GMP_PROG_EXEEXT_FOR_BUILD + IBM xlc on z/OS

Daniel Richard G. skunk at iSKUNK.ORG
Fri Apr 17 21:29:37 UTC 2015


Hello,

I'm experimentally building GMP 6.0.0 in a z/OS environment
(i370-ibm-openedition) using the IBM XL C compiler. Normal build,
not a cross.

Configuration fails with this:

    [...]
    checking how to run the C preprocessor... /u/username/bin/xlc-wrap -E
    checking build system compiler /u/username/bin/xlc-wrap... yes
    checking for build system preprocessor... /u/username/bin/xlc-wrap -E
    checking for build system executable suffix... configure: error: Cannot determine executable suffix

(Note that xlc-wrap is a simple wrapper script around xlc that adds a
couple of arguments so that -I flags work correctly; it is not
germane here.)

The relevant bit from config.log:

    configure:9689: checking for build system executable suffix
    configure:9703: /u/username/bin/xlc-wrap conftest.c -o conftest.exe
    FSUM3008 Specify a file with the correct suffix (.c, .i, .s, .o, .x, .p, .I, or .a), or a corresponding data set name, instead of -o./conftest.exe.
    configure:9706: $? = 1
    configure:9703: /u/username/bin/xlc-wrap conftest.c -o conftest,ff8
    FSUM3008 Specify a file with the correct suffix (.c, .i, .s, .o, .x, .p, .I, or .a), or a corresponding data set name, instead of -o./conftest,ff8.
    configure:9706: $? = 1
    configure:9703: /u/username/bin/xlc-wrap conftest.c -o conftest
    FSUM3008 Specify a file with the correct suffix (.c, .i, .s, .o, .x, .p, .I, or .a), or a corresponding data set name, instead of -o./conftest.
    configure:9706: $? = 1
    configure:9716: error: Cannot determine executable suffix


What happens is that this compiler has the unusual restriction that the
-o option has to precede any non-option arguments (i.e. the .c source
file), otherwise it gets interpreted as a non-option argument. (This
does not happen for -l flags, inconsistently enough.)

Changing the order of arguments in the macro definition in acinclude.m4
fixes the problem, although I wonder, doesn't Autoconf already have
logic to determine EXEEXT even in cross-compiling situations?

One other note: The compiler invocation in this macro needs to be passed
$CFLAGS and $CPPFLAGS (or possibly $CFLAGS_FOR_BUILD and
$CPPFLAGS_FOR_BUILD). Unless you're running something like
"$CC --help", it's generally bad form to run the compiler without the
user flags, as those flags may contain something necessary for it to
work correctly.


--Daniel


-- 
Daniel Richard G. || skunk at iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.


More information about the gmp-bugs mailing list