`checking size of mp_limb_t... 0` and `configure: error: Oops, mp_limb_t doesn't seem to work` when compiling the Microchip XC32 compiler from source
Gabriel Staples, ElectricRCAircraftGuy.com
ercaguy at gmail.com
Tue Nov 7 17:11:16 CET 2023
Marc, yes, I see that too now. For anyone wondering where that is, here it
is:
https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler/blob/main/xc32-v4.35-src/pic32m-source/gmp-6.1.0/acinclude.m4#L125-L140
What I'm calling, by the way, inside build-xc32-v4.35m.sh, is this:
https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler/blob/main/build-xc32-v4.35m.sh#L175
:
${gcc_srcdir}/configure \
...
So, if `gcc_srcdir` is a relative path, `#include "$srcdir/gmp-h.in"` works
in MSYS2 UCRT64 gcc on Windows. If `gcc_srcdir` is an absolute path, it
does not.
Here is a new summary I put into my answer halfway down:
https://stackoverflow.com/a/77435216/4561887:
Quick summary:
Calling the gcc configure script with a relative path causes that relative
path to get inserted into the main gcc Makefile, and then passed to the gmp
configure script, where it is injected into an autogenerated conftest.c C
file as an include statement. So, using an absolute path to call the gcc
configure script puts an absolute path in the #include inside conftest.c,
and using a relative path to call the gcc configure script puts a relative
path into that #include statement. In the MSYS2 UCRT64 gcc compiler,
however, only relative paths are allowed, due to path conversion issues of
the C:\ (in a Windows-style path) or /c/ (in a Unix-style path on Windows)
part which pertains to the beginning of absolute paths.
- Gabriel Staples
On Tue, Nov 7, 2023 at 2:17 AM Marc Glisse <marc.glisse at inria.fr> wrote:
> On Tue, 7 Nov 2023, Niels Möller wrote:
>
> > (2) It makes no sense for any C code, in conftest.c or otherwise, to
> > ever attempt to include gmp-h.in. That's not a valid C header file,
> > since it lacks the substitutions that turns it into a valid gmp.h
> > header file.
>
> From acinclude.m4:
>
>
> dnl GMP_INCLUDE_GMP_H
> dnl -----------------
> dnl Expand to the right way to #include gmp-h.in. This must be used
> dnl instead of gmp.h, since that file isn't generated until the end of
> the
> dnl configure.
> dnl
> dnl Dummy value for GMP_LIMB_BITS is enough
> dnl for all current configure-time uses of gmp.h.
>
> define(GMP_INCLUDE_GMP_H,
> [[#define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
> #define GMP_NAIL_BITS $GMP_NAIL_BITS
> #define GMP_LIMB_BITS 123
> $DEFN_LONG_LONG_LIMB
> #include "$srcdir/gmp-h.in"]
> ])
>
>
> --
> Marc Glisse
>
More information about the gmp-bugs
mailing list