Files
mercury/README.x86
Peter Wang 6a18491e03 Further prevent use of non-local gotos with PIC on x86 with GCC 5+.
configure.ac:
    Run the C compiler to check if it actually targets x86-64.
    Previously we assumed if $host is x86_64 then the C compiler will be
    targeting x86-64, but that is not true if gcc -m32 or gcc -mx32 is
    used.

    Then, as before, if the C compiler targets x86 and dynamic linking
    is enabled (except on Windows) and GCC is version 5+ then disable
    selection of any grades that use gcc labels.

runtime/mercury_goto.h:
    Report an error if the user tries to use non-local gotos with PIC
    on x86 with GCC 5+.

README.x86:
    Document the issue.

README.md:
    Add reference to README.x86.
2021-05-10 15:21:04 +10:00

25 lines
1.0 KiB
Plaintext

Due to improvements in GCC, the following combination is not supported:
- GCC version 5 and above
- x86
- PIC (position-independent code), i.e. dynamic linking
- low-level C grades using non-local gotos, i.e. asm_fast.*
The configure script will not select asm_fast grades when the above combination
is detected. If you try to use that combination by selecting an asm_fast grade
manually, you will encounter compilation errors.
We recommend using high-level C grades (hlc.*) on x86. If you require a
low-level C grade, e.g. for debugging, then you can use a reg.* grade.
If you must use an asm_fast grade, you will need to tell the C compiler not to
generate position-independent code, and disable building of shared libraries.
Alternatively, you could downgrade to gcc 4.9.
Note that Windows is unaffected by this issue as Windows does not use PIC,
and we do not yet support shared libraries (DLLs) on Windows anyway.
Also note x86-64 is not affected by this issue, only x86.
<https://bugs.mercurylang.org/view.php?id=453>