Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions page 28

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

22
-fuse-cxa-atexit
Register destructors for objects with static storage duration with the
rather than the
atexit
of static destructors, but will only work if your C library supports
-fvtable-gc
Emit special relocations for vtables and virtual function references so that the linker can iden-
tify unused virtual functions and zero out vtable slots that refer to them. This is most useful
with
-ffunction-sections
themselves.
This optimization requires GNU as and GNU ld. Not all systems support this option.
-Wl,-gc-sections
-fno-weak
Do not use weak symbol support, even if it is provided by the linker. By default, G++ will use
weak symbols if they are available. This option exists only for testing, and should not be used
by end-users; it will result in inferior code and has no benefits. This option may be removed in a
future release of G++.
-nostdinc++
Do not search for header files in the standard directories specific to C++, but do still search the
other standard directories. (This option is used when building the C++ library.)
In addition, these optimization, warning, and code generation options have meanings only for C++
programs:
-fno-default-inline
Do not assume
Control Optimization. Note that these functions will have linkage like inline functions; they just
won't be inlined by default.
-Wabi (C++ only)
Warn when G++ generates code that is probably not compatible with the vendor-neutral C++
ABI. Although an effort has been made to warn about all such cases, there are probably some
cases that are not warned about, even though G++ is generating incompatible code. There may
also be cases where warnings are emitted even though the code that is generated will be compat-
ible.
You should rewrite your code to avoid these warnings if you are concerned about the fact that
code generated by G++ may not be binary compatible with code generated by other compilers.
The known incompatibilities at this point include:
Incorrect handling of tail-padding for bit-fields. G++ may attempt to pack data into the same
byte as a base class. For example:
struct A { virtual void f(); int f1 : 1; };
struct B : public A { int f2 : 1; };
In this case, G++ will place
can avoid this problem by explicitly padding
your platform; that will cause G++ and other compilers to layout
Incorrect handling of tail-padding for virtual bases. G++ does not use tail padding when laying
out virtual bases. For example:
struct A { virtual void f(); char c1; };
struct B { B(); char c2; };
function. This option is required for fully standards-compliant handling
and
-Wl,-gc-sections
is ignored without
for functions defined inside a class scope. Section 4.10 Options That
inline
B::f2
Chapter 4. GCC Command Options
, in order to also discard the functions
.
-static
into the same byte as
so that its size is a multiple of the byte size on
A
__cxa_atexit
__cxa_atexit
; other compilers will not. You
A::f1
identically.
B
function
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 3

Table of Contents