qld(1)
NAME
qld - QOF link editor
SYNOPSIS
qld [-cCdDEghkNqrRsSvwx] [ -o output ] [ -llibrary ]
[ -L library-directory ] [ -a quintus-product ]
[ -f path-name:path-spec ]
[ -F path-name:path-spec ]
[ -p path-name ]
[ -P path-name ]
filename ... [ -LD ld-options ]
DESCRIPTION
qld links the specified QOF files together with the Kernel QOF file. This results in a single QOF file which is then consolidated into a machine object (".o") file. Finally, cc(1) is invoked to link this object file with the Kernel object file and produce an executable image called a.out. The default Kernel QOF file is <runtime directory>/qprte.qof and the default Kernel object file is <runtime directory>/qprte.o (see qsetpath(1) and qgetpath(1)).
If any of the specified files depends on a foreign file, then that file will be included in the call to cc(1) if the ’-d’ options is specified. A QOF file depends on a foreign file if its source contains an embedded load_foreign_files/2 or load_foreign_executable/1 command for that file (the -D option of qnm(1) shows the dependencies of a QOF file, see qnm(1)).
A file name in the command line could be either a QOF file with ".qof" suffix or a machine object file with ".o", ".so", or ".a" suffix. If the file name specified is a machine object file, it will be passed as an argument to cc(1). If the command line file does not exist, the same file with a ".qof" suffix is tried.
File names may be specified either as regular paths (eg. file.qof, ~/home/file.o) or as Prolog file search paths, such as "library(file)", "home(system(file.o))", etc. Note that the file search path specifications need to be quoted to escape the shell’s interpretation of the parentheses.
The intermediate QOF and object files are deleted when qld exits (unless the -k options is specified, see below). By default, these files are stored in the directory /tmp. The environment variable TMPDIR may be set to specify another directory to be used instead for temporary files. If TMPDIR is set to a non-existent directory or to a directory to which the user does not have read and write permissions then the default value of TMPDIR is used for temporary files.
OPTIONS
-a quintus-product
Specifies that the libraries for a particular Quintus product which is sold separately are to be used. These Quintus products are normally installed in the ’quintus-directory’. List this directory to find the valid directory names for these products. This option is equivalent to one or more -L switches. Note that the libraries shipped with Quintus Prolog (qui, proxt, and proxl) are automatically available in the system, and, therefore, require no -a flag.
-cIf this option is specified, qld terminates after producing a machine object (".o") file. It does not call cc(1) to produce an executable image. If an output file name is not specified with the -o option, the file is named a.o. No foreign files, eg. foreign dependencies, are included in the output file. The resulting object file may be passed to qld again on a different command (with -N), or it may be passed directory to cc(1) or ld(1).
-dThis flag is always used when qpc(1) calls qld. It causes all QOF files on which any of the specified files depends to be linked in as well, and any machine object files on which any of the linked QOF files depends to be passed to cc(1). A QOF file depends on another QOF file if the source for the first contains an embedded command to load the source of the second. A QOF file depends on an object file if its source contains an embedded load_foreign_files/2 or load_foreign_executable/1 command of the object file.
-f path-name:path-spec
Similar to the -L option, but path-name:path-spec defines a general file search path which instructs qld to look for a file in directory path-spec whenever a file specification of the form path-name(file-spec) is encountered in QOF file dependencies or on the command line. The path-name and the directory, path-spec, are separated by a colon (’:’), and, therefore, path-name cannot contain a colon. If path-spec is given in the file search path form (as in "library:mylib(library)"), then the argument must be quoted to escape the shell’s interpretation of the parentheses. path-spec may be ’.’ or null, in which case ’.’ is assumed.
There may be a list of path definitions (ie. -f or -F options) for the same path-name. Qld searches the list, just like prolog and qpc, whenever it needs to expand a file search path specification. The -f options appends (like assertz in prolog and qpc) the new path to the end of the list of paths for path-name, while -F prepends (like asserta in prolog and qpc).
-gThis option is not used by qld, but is intended for cc(1). If some of the specified object files or object dependency files are compiled with -g flag, this option should be specified to reserve the debugging information in the executable.
-hHides or "locks" the predicates in the file so that they are not visible to the debugger. Such predicates will have predicate_property "locked" when they are linked or loaded into a Prolog system.
-kWith this option, the intermediate files are not deleted.
-llibrary
This option is not used by qld, but is intended for ld(1), which is called by cc(1) to link with the specified library to product the executable.
-o output
The default output file names may be overridden using this option. For executable files, the default name is a.out. With the -r or -R options, the default name is a.qof. With the -c or -C options, the default name is a.o.
-p path-name
The files search path definitions for path-name are printed. If path-name is ∗ then all file search path definitions are printed.
-qLike the -r option but also adds a Kernel QOF file qprte.qof or qprel.qof. This option should very rarely be necessary.
-rIf this option is specified, qld terminates after linking together all the specified QOF files to make a new QOF file. No Kernel QOF file is not linked in. If an output file name is not specified with the -o option, the file is named a.qof.
If -d is not used in conjunction with this option, then it is recommended that the output file, as specified by the -o option, be in the current working directory. This way, any dependencies of the output QOF file on other files will be correct. Otherwise, the dependencies would only be correct when absolute, as opposed to relative, paths had been specified in the sources. This matters only if this file is to be used in a future call to qld with the -d option specified.
-sThis option is not used by qld, but is intended for ld(1), which is called by cc(1) to actually generate the executable. The -s option instructs ld(1) to strip the executable. NOTE: that once the executable is stripped then the dynamic foreign interface including the Prolog builtins load_foreign_files/2 and load_foreign_executables/1 cannot work.
-vWhen this option is specified, qld echoes its activities, including calls to subcomponents and cc(1).
-wThis option suppresses warnings regarding undefined procedures.
-xWhen this option is specified, qld gives warnings about the predicates which are not called, as well as those which are undefined. Also, a warning message will be printed if either of the user-definable predicates (portray/1 and user_error_handler/4) is undefined. (Such warnings are normally suppressed for these predicates.) The -x option overrides the -w option.
-CSame as -c, except that the object dependencies of qof files are also linked into the created object file. The object file so produced can be directly passed to cc(1), ld(1), or qld (with the -N option) to generate the executable.
-DIf this option is used, qld links the specified files with the Quintus Kernel rather than the Quintus Runtime Kernel. The Development Kernel QOF file, <runtime directory> /qprel.qof, is linked with the specified QOF file, and the Development Kernel object file, <runtime directory>/qprel.o, is passed to cc(1). The -D option may not be used in conjunction with the -E option.
-EThis option tells qld to link the specified files with the Quintus Extended Runtime Kernel rather than the Quintus Runtime Kernel. The Extended Runtime Kernel is an add-on product available separately from Quintus that allows the Quintus Prolog compiler and dynamic foreign interface to be used in runtime systems. The Extended Runtime Kernel QOF file, <runtime directory>/qprex.qof, is linked with the specified QOF file, and the default Kernel object file, <runtime directory/qprte.o, is passed to cc(1). The -E option may not be used in conjuction with the -D option.
-F path-name:path-spec
Similar to -f, but the path is added at the front of the list of paths for path-name. Note that ’-F library:library-directory’ is identical to ’-L library-directory’.
-L library-directory
File specifications of the form library(Filespec) are searched for in the library search paths when that file is linked. The initial search paths are the same as in the Development System (see prolog(1)). Additional directories may be prepended to the list of library search paths with this option. Note that the command line is parsed from left to right. Also note that the -L must be followed by a space; otherwise, qld assumes that the option specifies a library directory for ld(1).
Library directories may also be specified with the -f and -F options. Note that library-directory may be a path to a directory (eg. dir, ~/dir) or a file search path specification of the form "mylib(library)". In the latter case, the path-name "mylib" must be defined by a -f or -F option.
-Ldirectory
Same as the -L option of cc(1) and ld(1), and specifies a directory in which ld looks for library files. This option is simply passed to cc.
-LDAll remaining options are simply passed to ld(1).
-NDon’t link in any Kernel files (qprel.qof/qprel.o, qprex.qof/qprte.o or qprte.qof/qprte.o) from the runtime directory. This option is only useful for producing an executable image from a machine object (".o") file that was created from QOF files using qld (see -C).
-P path-name
Similar to -p, but the absolutized versions of the file search paths are also printed.
-RSimilar to -r, but it does not include the resulting dependencies. This flag is mainly useful for clearing the dependencies from the QOF file (for example, when they get absolutized by save_program/[1,2] or save_modules/ 2).
-SUse static object files instead of shared object files. Where a qof file contains a dependency on a shared object file with a .so extension, if an archive file exists with the same name but with a .a extension, then this is substituted for the shared object file in the call to ld(1).
Note that if the shared object file that is being substituted contains dependencies to other shared libraries then these have to be included in the qld command line. Running ldd(1) on a shared object file will indicate whether it has such dependencies.
ENVIRONMENT
TMPDIR
Directory for creating temporary files. The default is /usr/tmp.
FILES
file.qof
Quintus Object File (QOF) files
$TMPDIR/qp∗.{qof,o}
intermediate QOF and object files
<runtime directory>/qcon
the QOF consolidator
<runtime directory>/qprel.o
Development Kernel object code
<runtime directory>/qprte.o
Runtime Kernel object code
<runtime directory>/qprel.qof
Development Kernel QOF code
<runtime directory>/qprte.qof
Runtime Kernel QOF code
<runtime directory>/qprex.qof
Extended Runtime Kernel QOF code
/bin/cc
SEE ALSO
cc(1), ld(1), qcon(1), qgetpath(1), qnm(1), qpc(1), qsetpath(1)
Quintus Prolog 3.1 — Last change: August 1994