PreviousUpNext

15.4.693  src/lib/compiler/toplevel/compiler/mythryl-compiler-for-intel32-posix.pkg

## mythryl-compiler-for-intel32-posix.pkg

# Compiled by:
#     src/lib/compiler/mythryl-compiler-support-for-intel32.lib



# This file defines the compiler backend
# used on intel32-posix and related platforms.
# Alternate versions are:
#
#     src/lib/compiler/toplevel/compiler/mythryl-compiler-for-intel32-win32.pkg
#     src/lib/compiler/toplevel/compiler/mythryl-compiler-for-sparc32.pkg
#     src/lib/compiler/toplevel/compiler/mythryl-compiler-for-pwrpc32.pkg
#
# The standard compiler references us via
#
#     src/lib/core/compiler/set-mythryl_compiler-to-mythryl_compiler_for_intel32_posix.pkg
#
# while the bootstrap compiler references us via the
#
#     mythryl_compiler_compiler_for_intel32_posix
#         =
#         mythryl_compiler_compiler_g(
#             #
#             package mythryl_compiler = mythryl_compiler_for_intel32_posix,
#              ...
#         )
#
# definition in
#
#     src/lib/core/mythryl-compiler-compiler/mythryl-compiler-compiler-for-intel32-posix.pkg



stipulate

    #  Turn on "fast-fp"... 
                                                                        my _ = 
    lowhalf_control::bool  "fast_floating_point"                        # lowhalf_control       is from   src/lib/compiler/back/low/control/lowhalf-control.pkg
        :=
        TRUE;

    # The following is a GROSS HACK!   XXX BUGGO FIXME
    #
    # Eventually we need to generate separate binaries for the
    # IntelMac platform.  This code figures out dynamically
    # whether it is running Darwin (i.e., Mac OS X on an Intel),
    # but this does not work correctly when cross-compiling.
    # In particular, once the compiler or any of the libraries
    # that get compiled by the cross-compiler starts using NLFFI,
    # then things will start to break.                                  XXX BUGGO FIXME
    #
    # Also, the cross-compiler will not set the ABI_Darwin symbol
    # correctly for makelib's conditional compilation mechanism,
    # so the compiler sources cannot rely on it!
    #
    my (frame_alignment, return_small_structs_in_registers, abi_variant)
        =
        case (platform_properties::get_os_name ())
            #
            #             Frame alignment  Return small structs in registers (i.e., eax/edx)  Abi variant
            #             ===============  =================================================  ============
            "Darwin" =>  (16,              TRUE,                                              THE "Darwin");
            _        =>  (4,               FALSE,                                             NULL        );            # 64-bit issue XXX BUGGO FIXME
        esac;
herein

    package mythryl_compiler_for_intel32_posix
        =
        mythryl_compiler_g (                                    # mythryl_compiler_g    is from   src/lib/compiler/toplevel/compiler/mythryl-compiler-g.pkg
            #
            package bak                                         # "bak" == "backend".
                =
                backend_intel32_g (                             # backend_intel32_g     is from   src/lib/compiler/back/low/main/intel32/backend-intel32-g.pkg
                    #
                    package cp {                                # "cp" == "ccall_parameters".
                        #
                        frame_alignment =  frame_alignment;     # 16 on OSX, 4 elsewhere (e.g., Linux).
                        #
                        return_small_structs_in_registers       # TRUE on OSX, FALSE elsewhere.  Returned in eax/edx.
                            =
                            return_small_structs_in_registers;  
                    };
                    #
                    abi_variant = abi_variant;                  # THE "Darwin" on OSX, NULL elsewhere.
                );
            #
            ansi_c_prototype_convention
                =
                "unix_convention";        #  vs "windows_convention".
        );
end;


## (C) 2001 Lucent Technologies, Bell Labs


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext