Environment Variables Affecting Gcc - Red Hat ENTERPRISE LINUX 4 Manual

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

118
to marking things hidden when the default is public is to make the default hidden and mark
things public. This is the norm with DLL's on Windows and with
__attribute__ ((visibility("default")))
get almost identical semantics with identical syntax. This is a great boon to those working with
cross-platform projects.
For those adding visibility support to existing code, you may find
of use. This works by you enclosing the declarations you wish to set visibility for with (for ex-
ample)
#pragma GCC visibility push(hidden)
These can be nested up to sixteen times. Bear in mind that symbol visibility should be viewed
as part of the API interface contract and thus all new code should always specify visibility when
it is not the default ie; declarations only for use within the local DSO should always be marked
explicitly as hidden as so to avoid PLT indirection overheads - making this abundantly clear
also aids readability and self-documentation of the code. Note that due to ISO C++ specification
requirements, operator new and operator delete must always be of default visibility.
An overview of these techniques, their benefits and how to use them is at
http://www.nedprod.com/programs/gccvisibility.html.

4.19. Environment Variables Affecting GCC

This section describes several environment variables that affect how GCC operates. Some of them
work by specifying directories or prefixes to use when searching for various kinds of files. Some are
used to specify other aspects of the compilation environment.
Note that you can also specify places to search using options such as
tions for Directory Search). These take precedence over places specified using environment variables,
which in turn take precedence over those specified by the configuration of GCC. .
LANG
LC_CTYPE
LC_MESSAGES
LC_ALL
These environment variables control the way that GCC uses localization information that allow
GCC to work with different national conventions. GCC inspects the locale categories
and
LC_MESSAGES
value supported by your installation. A typical value is
Kingdom encoded in UTF-8.
The
LC_CTYPE
the character boundaries in a string; this is needed for some multibyte encodings that contain
quote and escape characters that would otherwise be interpreted as a string end or escape.
The
LC_MESSAGES
If the
LC_ALL
; otherwise,
LC_MESSAGES
environment variable. If none of these variables are set, GCC defaults to traditional C English
behavior.
TMPDIR
If
is set, it specifies the directory to use for temporary files. GCC uses temporary files
TMPDIR
to hold the output of one stage of compilation which is to be used as input to the next stage: for
example, the output of the preprocessor, which is the input to the compiler proper.
if it has been configured to do so. These locale categories can be set to any
environment variable specifies character classification. GCC uses it to determine
environment variable specifies the language to use in diagnostic messages.
environment variable is set, it overrides the value of
LC_CTYPE
Chapter 4. GCC Command Options
instead of
and
#pragma GCC visibility pop
en_GB.UTF-8
and
LC_MESSAGES
-fvisibility=hidden
__declspec(dllexport)
#pragma GCC visibility
,
and
(Section 4.14 Op-
-B
-I
-L
for English in the United
LC_CTYPE
default to the value of the
and
you
.
LC_CTYPE
and
LANG

Advertisement

Table of Contents
loading

Table of Contents