Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ blinklink(5) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

make(1)

ld(1)

cc(1)

CC(1)

f77(1)

pc(1)

ar(1)

 

NAME

Blink Link − Programmer’s Toolset Incremental Linker

DESCRIPTION

Blink Link is a set of utilities that provide a form of incremental linking when used in conjunction with make(1). Blink Link alters compiler invocations performed by make(1) so that your program’s object files can be linked into a prelink module.

When you modify source files during your development cycle, recompiled object files are linked with the prelink module to create a new version of the program.  Because the prelink module has already been linked, only the recompiled object files are re-linked. 

The execution time for the link of the recompiled object files is proportional to the size of the recompiled object files rather than the total size of your program.  If you modify only small pieces of your program at a time, the speed of the link operation for large programs can be increased by an order of magnitude or more. 

The procedures for using Blink Link have been greatly simplified for this release.  Blink Link now requires little or no modification to existing makefiles. 

To use the old-style Blink Link interface put /opt/blinklink/obsolete/bin in your PATH before /bin, /usr/bin, and /opt/compiler/bin.  Also set the environment variable TOOLSET to /opt/blinklink/obsolete. 

For information on using the old-style Blink Link, refer to the man page for the old-style Blink Link.  To view the man page for the old-style Blink Link, you need to add /opt/blinklink/obsolete/share/man to your MANPATH. 

USAGE

To use Blink Link, put /opt/blinklink/bin in your PATH before /bin and /usr/bin.  Note that Blink Link sets the makefile macros CC, CXX, F77, and PC and will overide any definitions of these macros in your makefile. Additionally, if you use the macro LD for your makefile link rules, you need to set LD to either CC, CXX, F77, or PC to ensure that the blinklink utility gets invoked for each linker invocation. 

Blink Link utilities are invoked whenever you invoke make with the options −prelink or −blink. 

Performing a Prelink

Before Blink Link can perform incremental linking, it must create a prelink module called program_bld.sl, where program is the name of the executable you are building with make.  To create the prelink module, use the −prelink option to Blink Link’s make wrapper. For example,

    make -prelink args

where args represents any arguments you would normally supply to make. 

When you specify make -prelink Blink Link invokes the real make program as

    make CC="blinklink -prelink cc" CXX="blinklink -prelink CC" \
         F77="blinklink -prelink f77" PC="blinklink -prelink pc" \
         AR="blinklink -prelink ar" args

After prelinking, your program can be run normally.  The prelink module must be present in the directory in which the program was linked in order to run the program.  The name of this prelink module is given by the Blink Link lbd command.  If the program was linked against any shared libraries that were themselves linked using Blink Link, then the −R option to lbd will display the names of all such prelink modules needed to run the program. 

Performing an Incremental Link

After you have performed the prelink, whenever you make any change to your source and need to recompile and relink your program, you may do an incremental link. An incremental link links out-of-date objects with the prelink module. If only a few object files or libraries have been recompiled, then this incremental link can be orders of magnitude faster than a full link for large programs.  To perform incremental links, use the −blink option. For example,

    make -blink args

where args  represents any arguments you would normally supply to make. 

When you specify make −blink, Blink Link invokes the real make program as

    make CC="blinklink -blink cc" CXX="blinklink -blink CC" \
         F77="blinklink -blink f77" PC="blinklink -blink pc" \
         AR="blinklink -blink ar" args

Blink Link keeps a history of objects and modules within archives that have been modified and incrementally linked since the last prelink.  All such files must be linked again on every successive incremental link.  During the course of development, this list of modified files may gradually grow to be as long as the original list of files that comprise your program.  At some point, the incremental link will be no faster than a full link.  Another prelink can then be performed to bring the prelink module up to date.

Performing A Full Link

When your program is fully developed and debugged, you will need to rebuild your program without Blink Link in order to obtain a version that can be run without the prelink module.  To do this, you should force a recompile of all of your object files and archives without specifying the −blink or −prelink options to make.  (The code generated with these options is less optimal.) 

Using Multiple Source Directories

If your source code resides in more than one directory, you need to set the environment variable BLINKLINK_DATABASE. The BLINKLINK_DATABASE variable allows Blink Link to find its database, Blink.db, regardless of what directory source files are in.  If your source code resides in more than one directory, set the BLINKLINK_DATABASE environment variable to

    <path>/Blink.db

where <path> is the full path of the directory in which you want the Blink Link database stored. 

Tools And Options

Blink Link consists of a number of tools designed to work with and enhance native tools.  These tools, and the options they accept, are described below. 

/opt/blinklink/bin/make
The make driver for Blink Link accepts all standard make(1) arguments, plus the following additional options:

−prelink
Invoke make with the arguments

CC="blinklink -prelink cc" CXX="blinklink -prelink CC" \
F77="blinklink -prelink f77" PC="blinklink -prelink pc" args

where args represents any arguments you would normally supply to make. 

−blink
Invoke make with the arguments

CC="blinklink -blink cc" CXX="blinklink -blink CC" \
F77="blinklink -blink f77" PC="blinklink -blink pc" args

where args represents any arguments you would normally supply to make. 

/opt/blinklink/bin/blinklink
When invoked for a compile (for example, blinklink -prelink cc -c ...), blinklink simply adds the +Z compiler option before invoking the compiler. When invoked for linking, blinklink ascertains which object files are out-of-date and passes the appropriate options to the linker to link those out-of-date objects with the prelink module. 

The blinklink utility accepts all standard linker options, and expects those options to be preceeded by the name of the compiler that will invoke ld.  The blinklink program also accepts the following options:

−prelink
Create a new prelink module.

−blink  
Link only out-of-date objects with the prelink module.

/opt/blinklink/bin/lbd
The lbd utility takes one argument, the name of an executable program.  lbd lists the name of the prelink module associated with the executable if the program was linked with blinklink.  If the program was linked with any shared libraries that were themselves linked using blinklink, then the −R option to lbd will additionally display the names of all prelink modules associated with any shared libraries linked with the program. 

/opt/blinklink/bin/ldd
The ldd utility takes one argument, the name of an executable program.  ldd lists all shared libraries linked with the program. 

FILES

/opt/blinklink/bin/blinklink
Program that intercepts compiler and linker invocations in order to create a prelink module and in order to perform incremental linking.

/opt/blinklink/bin/make
Make driver program.

/opt/blinklink/bin/ldd
Command to list shared libraries associated with program.

/opt/blinklink/bin/lbd
Command to list prelink modules associated with program.

/opt/blinklink/lib/repatch
Utility to unpatch modules from a C++ shared library.

/opt/blinklink/lib/find_real
Utility to find native version of commands.

/opt/blinklink/lib/nop.o
Dummy object to replace static constructors in shared libraries.

WARNINGS

Programs compiled with the −blink or −prelink options may run slightly slower than they would normally. 

AUTHOR

 Blink Link was developed by the Hewlett−Packard Company. 

SEE ALSO

make(1), ld(1), cc(1), CC(1), f77(1), pc(1), ar(1)

  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026