---
name: "lsbc++2"
section: "1"
platform: "linux"
package: "lsb-build-cc2"
version: "2.1.1-7"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/lsbc++2"
---

# lsbc++2(1)

compiler driver for building LSB conforming applications

## NAME

lsbcc, lsbc++ - compiler driver for building LSB conforming applications

## SYNOPSIS

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

## DESCRIPTION

This tool should be used in place of the *cc* (or *c++*) command 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-compliant system.  They must only use specified interfaces from LSB-required shared libraries. And LSB programs need to be linked with  a special program interpreter which identifies them as LSB conforming.

The LSB development environment provides a set of replacement 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 interfaces in those libraries will result in link failures.

*lsbcc* is designed to apply the LSB build rules with a minimum 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 specifically recognized
  0x0008   Display the arguments that are not recognized
  0x0010   Display changes made to the include arguments
  0x0020   Display changes made to the library arguments
  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 pattern 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 application, 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 libraries by silently supplying full pathnames instead of the  **-l***lib* 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 architecture

- /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 architecture

- /lib64/ld-lsb-s390x.so.2

  The LSB program interpreter for the S390X architecture

- /lib64/ld-lsb-x86-64.so.2

  The LSB program interpreter for the x86\_64 architecture

## 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++ compilation.

For commercial applications, developers need to be aware of the licenses of the libraries they link to. Since some licenses allow dynamic but not static linking to the library, and *lsbcc* may silently change (apparent) dynamic links to static, the **LSBCC\_WARN** envirnonment variable should be used to notify of such changes.

## COPYRIGHT

Copyright © 2002, 2003, 2004 Free Standards Group.

## SEE ALSO

Linux Standard Base specification and other documents at http://www.linuxbase.org/
