Next: , Previous: , Up: Options for linking   [Contents][Index]


9.22.3 Options for linking just C code


-o filename
--output-file filename

Specify the name of the final executable. (The default executable name is the same as the name of the first module on the command line.) This option is ignored by mmc --make.


--link-object filename
–no-link-object

Link with the specified object file, or archive of object files.


--ld-flags options
–no-ld-flags

Specify options to be passed to the linker command that will create an executable. These options will not be quoted when passed to the shell. Use mmc --output-link-command to find out what the linker command is.


--ld-flag option

Specify a single word option to be passed to the linker command that will create an executable. The word will be quoted when passed to the shell. Use mmc --output-link-command to find out what the linker command is.


--ld-libflags options
–no-ld-libflags

Specify options to be passed to the linker command that will create a shared library. These options will not be quoted when passed to the shell. Use mmc --output-shared-lib-link-command to find out what the linker command is.


--ld-libflag option

Specify a single word option to be passed to the linker command that will create a shared library. The word will be quoted when passed to the shell. Use mmc --output-shared-lib-link-command to find out what the linker command is.


-R directory
-R-
--runtime-library-directory directory
–no-runtime-library-directory

Append directory to the list of directories in which to search for shared libraries at runtime.


--no-default-runtime-library-directory

Do not add any directories to the runtime search path automatically.


--init-file-directory directory
–no-init-file-directory

Append directory to the list of directories to be searched for .init files by c2init.


--init-file init-file
–no-init-file

Append init-file to the list of .init files to be passed to c2init.


--trace-init-file init-file
–no-trace-init-file

Append init-file to the list of .init files to be passed to c2init when tracing is enabled.


--linkage {shared, static}

Specify whether to use shared or static linking for executables. Shared libraries are always linked with ‘--linkage shared’.


--mercury-linkage {shared, static}

Specify whether to use shared or static linking when linking an executable with Mercury libraries. Shared libraries are always linked with ‘--mercury-linkage shared’.


--no-demangle

Do not pipe the output of the linker through the Mercury demangler. The demangler usually makes it easier to understand the diagnostics for any link errors that involve code generated by the Mercury compiler.


--no-strip

Do not invoke the strip command on executables. Stripping minimizes executables’ sizes, but also makes debugging them much harder.


--no-main

Do not generate a C main() function. With ‘--no-main’, the user’s own code must provide a main() function.


--no-allow-undefined

Do not allow undefined symbols in shared libraries.


--no-use-readline

Disable use of the readline library in the debugger.


--runtime-flags flags
–no-runtime-flags

Specify flags to pass to the Mercury runtime.


--extra-initialization-functions
--extra-inits

Search .c files for extra initialization functions. (This may be necessary if the C files contain hand-written C code with INIT comments, rather than containing only C code that was automatically generated by the Mercury compiler.)


--framework framework
–no-framework

Build and link against the specified framework. (Mac OS X only.)


-F directory
-F-
--framework-directory directory
–no-framework-directory

Append the specified directory to the framework search path. (Mac OS X only.)


--cstack-reserve-size size

Set the total size of the C stack in virtual memory for executables. The stack size is given in bytes. This option is only supported (and indeed only necessary) on systems running Microsoft Windows.)


--link-executable-command command

Specify the command used to invoke the linker when linking an executable.


--link-shared-lib-command command

Specify the command used to invoke the linker when linking a shared library.


--shlib-linker-install-name-path directory

Specify the path where a shared library will be installed. This option is useful on systems where the runtime search path is obtained from the shared library and not via the ‘-R’ option above (such as Mac OS X).


--strip-executable-command command

Specify the command used to strip executables if no linker flag to do so is available. This option has no effect on ml.


--strip-executable-shared-flags options

Specify options to pass to the strip executable command when linking against Mercury shared libraries.


--strip-executable-static-flags options

Specify options to pass to the strip executable command when linking against Mercury static libraries.


Next: , Previous: , Up: Options for linking   [Contents][Index]