mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 19:03:45 +00:00
Estimated hours taken: 6 Branches: main In trailing grades, pass flags to the C compiler that force it to align functions on word boundaries. For some architectures, and for some C compiler optimisation settings, function addresses are not aligned and this breaks function trailing when using tagged trail entries. XXX this diff only fixes the problem for gcc, it's not clear what, if anything, needs to be done for other C compilers. configure.in: s/COMPILER/C_COMPILER_TYPE/. The former is ambiguous as Mercury uses compilers for several languages. Instantiate the value of C_COMPILER_TYPE in files generated by the configure script. Add an XXX comment about how the type of the C compiler is determined. Clean up a few things. compiler/globals.m: Define a type, c_compiler_type/0, that represents the type of C compiler we are using. (This type replaces the old compiler_type/0 type from compile_target_code.m). Add a new field to the globals structure that stores the C compiler type. Add access and utility procedures for the new field. Delete some business with unique modes that used to be required when the I/O globals field was unique. compiler/options.m: Simplify the implementation of `--c-compiler-type'. Most of it is now handled by the globals module. scripts/Mercury.config.in: Define a new variable MERCURY_C_COMPILER_TYPE, whose value is set by the configuration script. Pass the C compiler type to the Mercury compiler. compiler/compile_target_code.m: scripts/mgnuc.in: When in a trailing grade and using gcc as a C compiler align functions on word boundaries in order to avoid problems with function trailing. Delete the unused type compiler_type/0. tests/trailing/Mercury.options: Remove a workaround for the function alignment problem.
6 lines
174 B
Plaintext
6 lines
174 B
Plaintext
# Turn on trail usage optimization for these tests since that is
|
|
# what they are testing.
|
|
#
|
|
MCFLAGS-tu_test1 = --analyse-trail-usage
|
|
MCFLAGS-tu_test2 = --analyse-trail-usage
|