Skip to content

Should we remove -DNO_ASM from GMP/MPFR for native builds? #45

@mikrosk

Description

@mikrosk

Makefile.def / Makefile.in explicitly disable compiling in any assembly notifications:

host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
// Work around in-tree gmp configure bug with missing flex.
extra_configure_flags='--disable-shared LEX="touch lex.yy.c" @host_libs_picflag@';
extra_make_flags='AM_CFLAGS="-DNO_ASM"';
no_install= true;
// none-*-* disables asm optimizations, bootstrap-testing
// the compiler more thoroughly.
host="none-${host_vendor}-${host_os}";
// gmp's configure will complain if given anything
// different from host for target.
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= mpfr; lib_path=src/.libs; bootstrap=true;
extra_configure_flags='--disable-shared @extra_mpfr_configure_flags@ @host_libs_picflag@';
extra_make_flags='AM_CFLAGS="-DNO_ASM"';
no_install= true; };

Both mpfr and gmp have a few bits of m68k asm code available (gmp even specifically for 020+ CPUs).

I'm torn on this one. On one hand, native m68k executables can use every spare CPU cycle available, on othe ther hand there may be a risk that something goes wrong as those are disabled by default and therefore not that much tested.

Also, there's a bit of work required as our config.sub handling doesn't differentiate between 68000, 68020+ and m5475 CPUs (it's always just "m68k").

There is even a bug in gcc7: passing "none-atari-mint" from gcc to gmp (gcc's way to tell gmp to disable CPU optimisations) doesn't work as expected (it is still evaluated as "m68k-atari-mint"), therefore the CPU is detected as "m68k" and therefore it adds -m68000 to the command line even when compiling ColdFire, silently producing a wrong library. Fortunately our official gcc-7.5.0 release (and executables) doesn't suffer from it, I had --disable-assembly patched in explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions