lsbcc(1)

NAME

lsbcc, lsbc++ - compiler driver for building LSB conform
ing applications

SYNOPSIS

lsbcc [compiler-options]
lsbc++ [compiler-options]

DESCRIPTION

This tool should be used in place of the cc (or c++) com
mand when building an LSB-conforming program.
LSB-conforming programs must link dynamically only with
LSB-required and application-supplied shared libraries, as no
other libraries can be guaranteed to be present on an LSB-compli
ant system. They must only use specified interfaces from LSB-re
quired shared libraries. And LSB programs need to be linked with
a special program interpreter which identifies them as LSB con
forming.
The LSB development environment provides a set of replace
ment system headers and stub dynamic libraries. These headers
and libraries have been carefully built so that they contain only
the interfaces specified in the LSB. When the stub libraries are
used for link-time symbol resolution, the use of unspecified in
terfaces in those libraries will result in link failures.
lsbcc is designed to apply the LSB build rules with a min
imum of changes to existing build setups. When invoked as the
compiler, it first modifies the command line to follow the LSB
build rules, then passes the resulting command line on to the
regular compiler.
lsbcc takes no options; behavior other than the default is
controlled by a set of environment variables.

ENVIRONMENT

The following environment variables affect the behavior of
lsbcc
LSBCC_DEBUG
A numeric value which represents a bit pattern
specifying what kinds of debugging output to produce. The bits in
this pattern are
0x0001 Display enviromental overrides
0x0002 Display the arguments passed in
0x0004 Display the arguments that are specifical
ly recognized
0x0008 Display the arguments that are not recog
nized
0x0010 Display changes made to the include argu
ments
0x0020 Display changes made to the library argu
ments
0x0040 Display the modified argument list
LSBCC_WARN
A numeric value which represents a bit pattern
specifying what kinds of warnings to emit. The bits in this pat
tern are
0x0001 Warn about libraries being changed to
static linking
LSBCC Specifies the name of the C compiler to invoke with
the modifed argument set. If this environment variable is not
found, the default cc will be used.
LSBCXX Specifies the name of the C++ compiler to invoke
with the modifed argument set. If this environment variable is
not found, the default c++ will be used.
LSBCC_LIBS
Specifies the location of the LSB stub libraries
that will be linked against. If this environment variable is not
found, the default /opt/lsbdev-base/lib will be used.
LSBCC_INCLUDES
Specifies the location of the LSB header files that
will be linked against. If this environment variable is not
found, the default /opt/lsbdev-base/include will be used.
LSBCXX_INCLUDES
Specifies the location of the LSB C++ header files
that will be linked against. If this environment variable is not
found, the default /opt/lsbdev-base/include/c++ will be used.
LSBCC_SHAREDLIBS
A library name or colon-separated list of library
names to add to the default list. The name should be the base
part of the library only, for example to add libfoo.so use the
name foo.
Normally, only LSB-defined libraries should be
linked as shared libraries, all others must be linked statically.
However, if an application provides its own shared library which
has been carefully checked for LSB conformance, this method can
be used to selectively overrride lsbcc's rule of forcing static
linking. The application may not depend on such a library being
present on a system, so it must either be shipped with the appli
cation, or with another LSB conforming application on which this
application depends.

EXAMPLES

lsbcc hello.c -o hello

CC=lsbcc CXX=lsbc++ ./configure; make

LSBCC_SHAREDLIBS=tcl:tk CC=lsbcc make

AUTHORS

Stuart Anderson <anderson@freestandards.org>

REPORTING BUGS

Report bugs to <lsb-build@linuxbase.org>.

BUGS

It is possible to confuse lsbcc's (and lsbc++) automatic
library processing. In particular, build systems that include
"clever" tools to manage which libraries to use, such as GNU
libtool and pkgconfig, may defeat the checks for non-LSB li
braries by silently supplying full pathnames instead of the -llib
form.
Long options which take an argument need special handling.
lsbcc is not guaranteed to keep the option and argument together,
which leads to incorrect results. Handling for a few key options
of this form is built in to lsbcc (-include, -rpath,
-rpath-link); the remainder can be worked around by using the
-Wx,option syntax (where x is l for linker or p for preprocessor)
as this form combines the option and argument into a single word
and avoids the issue.

FILES

/opt/lsbdev-base/include
the LSB header files
/opt/lsbdev-base/lib
the LSB stub libraries
/lib/ld-lsb.so.2
The LSB program interpreter (dynamic linker) for
the IA32 architecture
/lib/ld-lsb-ia64.so.2
The LSB program interpreter for the Itanium archi
tecture
/lib/ld-lsb-ppc32.so.2
The LSB program interpreter for the PowerPC 32-bit
architecture
/lib64/ld-lsb-ppc64.so.2
The LSB program interpreter for the PowerPC 64-bit
architecture
/lib/ld-lsb-s390.so.2
The LSB program interpreter for the S390 architec
ture
/lib64/ld-lsb-s390x.so.2
The LSB program interpreter for the S390X architec
ture
/lib64/ld-lsb-x86-64.so.2
The LSB program interpreter for the x86_64 archi
tecture

SEE ALSO

lsbappchk

NOTES

lsbcc is commonly delivered as a package named
lsb-build-cc. If this package is used, the support package
lsb-build-base must also be installed.
lsb-build-c++ supplies necessary header files for C++ com
pilation.
For commercial applications, developers need to be aware
of the licenses of the libraries they link to. Since some licens
es allow dynamic but not static linking to the library, and lsbcc
may silently change (apparent) dynamic links to static, the

LSBCC_WARN

changes.

COPYRIGHT

Copyright © 2002, 2003, 2004 Free Standards Group.

SEE ALSO

Linux Standard Base specification and other documents at
http://www.linuxbase.org/
lsbcc (LSB)
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout