mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-06 16:08:32 +00:00
In configure, we try detect the non-working combination of gcc 5+,
targeting x86, PIC, and non-local gotos. We assumed that PIC is only
generated when creating shared libraries, but gcc may have been
configured to generate PIC by default. This is very common on more
recent Linux distributions.
configure.ac:
Extend the test mentioned above: if shared libraries are disabled,
check whether gcc generates PIC anyway.
Clean up the code a little.
m4/mercury.m4:
Add helper macros MERCURY_CC_TARGETS_X86 and
MERCURY_CC_GENERATES_PIC.
README.x86:
Update this document.
25 lines
1.0 KiB
Plaintext
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)
|
|
- 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 (which may be the default), *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>
|