Skip to content
Search

GCC

lastmod 2025-02-27created 2014-01-05130 edits

The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages.

Categories

How to install

To install GCC 4.8.2 on CentOS 6:

## Install pre-requirements:
$ yum install gmp-devel mpfr-devel libmpc-devel

## Download and extract gcc 4.8.2 source tar ball:
$ curl -O ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz; tar zxf gcc-4.8.2.tar.gz
$ cd gcc-4.8.2; ./configure --enable-languages=c,c++ --disable-multilib

## Build and install:
$ make; make install

Debian:

$ sudo apt-get install gcc
$ sudo apt-get install g++

RedHat:

$ sudo yum install gcc
$ sudo yum install gcc-c++

in Ubuntu

To install GCC 4.9 on Ubuntu, do the following.

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test 
$ sudo apt-get update
$ sudo apt-get install gcc-4.9

If you want to replace the default gcc command with gcc-4.9, use the alternatives command.

Basic usage

Examples of using GCC.

Compiling. (Outputs an object file.)

gcc -c [SOURCE_PATH]

Building an executable. (Object files must be given as input.)

gcc -o [OUTPUT_PATH] [SOURCE_PATH] [SOURCE_PATH] [SOURCE_PATH] ...

Compiling Objective-C source code.

gcc -lobjc -o source.m

MinGW Static and Dynamic Libraries

Compiling the Static Library

Building the Library.

gcc -c add.c -o add.o
ar rcs libadd.a add.o

Referencing the Library.

gcc -c main.c -o main.o
gcc -c main.exe main.o -L. -ladd
main.exe

Compiling the Dynamic Library

Referencing the Library.

gcc -c add.c -o add.o
gcc -shared -o libadd.so add.o
gcc -o main.exe main.c libadd.so

Environment Variables

For reference, LD_DEBUG is covered on the GNU C page.

LD_LIBRARY_PATH
A collection of directory paths containing linker libraries used by ld.

Library dependency

Libraries have dependency issues. This affects the order of command-line arguments when compiling with gcc.

## main.cpp 파일에서 liba.a의 함수를 사용할 경우 아래와 같은 순서로 적용해야 한다.
g++ -c main.cpp
g++ main.o -la

If the link order gets tangled, do the following.

## -Wl 대신 -Xlinker를 사용해도 된다
g++ main.o -Wl,--start-group {라이브러리 목록} -Wl,--end-group

## 또는 편법적인 방법이지만 두 번 작성해도 된다.
g++ main.o -lcommon -lutil -lmisc -lcommon -lutil -lmisc

Precompiled Headers

Precompiled headers can shorten compile times. To create a PCH file, compile the header file as follows.

$ g++ -c stdafx.h

Note that if you use the -g flag, you must also use the -g flag when compiling the other source files; likewise, if you don't use it, you must not use it there either.

A filename.h.gch file is then created; add the header file at the top of the source files where you want to apply the PCH. See https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html for details.

Command-line options

A summary of important Command line options available in GCC.

Common options

-c
Compiles only, without the link step.
Outputs an object file.
-o<OUTPUT_PATH>
Specifies the output file.
-I<INCLUDE_DIR>
An uppercase i; specifies the path of #include headers. There is no space between -I and <INCLUDE_DIR>, and it can be used multiple times.
-l<LIBRARY_NAME>
A lowercase L; specifies a library to Link.
Write the library name without the lib prefix and the .a (or *.so) suffix.
There is no space between -l and <INCLUDE_DIR>, and it can be used multiple times. (e.g. to link libmylib.a, write -lmylib.)
To enter the full path of a library, enter it without -l, just like Object(*.o) files.
-L<LIBRARY_DIR>
Specifies a path containing libraries.
There is no space between -L and <LIBRARY_DIR>, and it can be used multiple times. (e.g. -L. means the current directory.)
-p
Links the program so it can be profiled with prof.
-w
Suppresses all warning messages.
-W
Prints additional warning messages for code that is legal but somewhat ambiguous.
-Wall
Prints much more detailed warning messages for ambiguous code.
-Werror
Treats all Warnings as Errors. In other words, compilation stops even on a single warning.
-Wtraditional
Prints a warning if the source code could produce different results between ANSI C and K&R C.
-Wno-psabi
Used to suppress messages such as note: the mangling of 'va_list' has changed in GCC 4.4.
NOTE: the exact option details need to be looked up.
-Wno-wchar-size-warning
Used to suppress messages such as ld.exe: warning: ~.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail.
NOTE: the exact option details need to be looked up.
-static
Compiles as a static library.
-shared
Links with shared libraries where possible, and with static libraries when no shared library is available.
-Wl,--subsystem,windows
MINGW: the command-line window and the GUI window do not appear at the same time.
-mwindows
Sets MINGW's WinMain as the entry point. Set it as a Linker flag.
See also: http://blog.jidolstar.com/677|http://blog.jidolstar.com/677
-M
Prints a dependency (defendency) list for makefile to stdout.
Usually redirected into a *.d file and used in a makefile. See Generating Dependencies Automatically for details.
-MM
Same as -M, but omits dependencies on system header files.
-H
Prints the full list of header files in use in a Stack format.
-std=c++11
https://gcc.gnu.org/onlinedocs/gcc/Standards.html
https://gcc.gnu.org/projects/cxx0x.html
Applies the revised C++ 11 standard (ISO/IEC 14882:2011).
--diag_suppress
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348bk/CHDHFIAG.html
This option disables diagnostic messages with the specified tags.
The --diag_suppress option behaves like --diag_errors, except that instead of setting diagnostic messages with the specified tags to error severity, the compiler displays those messages.
-save-temps
Store the normally temporary intermediate files(*.s, *.i, *.o) permanently.

Code Generation Conventions

These machine-independent options control the interface conventions used in code generation.

Most of them have both positive and negative forms; the negative form of -ffoo is -fno-foo. In the table below, only one of the forms is listed—the one that is not the default. You can figure out the other form by either removing no- or adding it.

-fstack-reuse=reuse-level
This option controls stack space reuse for user declared local/auto variables and compiler generated temporaries.
-fdiagnostics-color=auto
How to get color output from GCC
Applies colors to terminal output.
-fpermissive
Downgrade some diagnostics about nonconformant code from errors to warnings. Thus, using -fpermissive will allow some nonconforming code to compile. 3
This problem arises because gcc has tried to follow the standard more strictly since version 4.1, and it is fair to regard it as a kind of bug. :Use the problematic variable explicitly, as in this->, or include the appropriate header files so the standard headers are found first. (Reportedly, when compiling templates, local lookup happens first.) Use this if you want to solve it with a compiler option.
See also: http://wanochoi.com/?tag=fpermissive
-fPIC
Generates large, slow code. Platform-independent. Can be used regardless of CPU. There is no size limit, but in exchange the slowdown in symbol access through the Global Offset Table(GOT) is large. (On i386, though, -fPIC and -fpic are about the same)
See also: Shared Library
See also: Basic questions about shared libraries
See also: http://lists.freebsd.org/pipermail/cvs-ports/2004-March/030214.html
-fpic
Generates small, fast code. Depending on the CPU, there is a limit on the size of the GOT(Glocal Offset Table) that -fpic can generate. Symbols are accessed through the Global Offset Table(GOT), and since there is a machine-specific limit, it may fail in some cases. But when it succeeds, the slowdown is smaller than with -fPIC.
See also: Shared Library
See also: Creating GCC dynamic libraries (.so) and the difference between -fPIC and -fpic
-fvisibility=hidden
glibc - ELF symbol visibility
See #Symbol Visibility.
Changes the ELF symbol visibility attribute.
-finput-charset=
Character sets - The C Preprocessor
Stackoverflow - How should I use g++'s -finput-charset compiler option correctly in order to compile a non-UTF-8 source file?
Specifies the character set of the INPUT source code. To specify utf8, use -finput-charset=UTF-8.
-fmessage-length=n
Sets the number of characters per line to n when printing messages. Setting it to 0 prints the whole message. (Try to format error messages so that they fit on lines of about n characters. default is 72)
-fwhole-program
Stackoverflow - gcc:how to remove undefined symbol that is not used?
-fdata-sections, -ffunction-sections
Stackoverflow - How to remove unused C/C++ symbols with GCC and ld?

GCC Optimization

If you don't know which CPU you have or which setting to choose, you can probably just use the -march=native setting. With this flag, GCC detects the processor and sets suitable flags automatically.

WARNING

Do not use the -march=native flag if you are compiling packages to be used on a different CPU.

CPU-specific flags

Additional --extra-cflags flags per CPU.

ARM v6
-marm -march=armv6
ARM v7vfpv3
-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a
ARM v7vfp
-mfloat-abi=softfp -mfpu=vfp -marm -march=armv7-a
ARM v7n
-mfloat-abi=softfp -mfpu=neon -marm -march=armv7-a -mtune=cortex-a8
ARM v6+vfp
-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=armv6

Position Independent Code

Include directory list

You can check the list of INCLUDE directories as follows.

# C
$ echo | gcc -Wp,-v -x c - -fsyntax-only 2>&1

# C++
$ echo | gcc -Wp,-v -x c++ - -fsyntax-only 2>&1

# more information
$ echo | gcc -E -v -x c++ -
# /dev/null use version:
$ g++ -E -x c++ - -v < /dev/null
# Or in Windows Command Prompt:
$ g++ -E -x c++ - -v < nul
# Clang version:
$ clang++ -E -x c++ - -v < /dev/null

For reference, the default directory list is as follows.

  • /usr/local/include
  • libdir/gcc/target/version/include
  • /usr/target/include
  • /usr/include

Include file list

When checking the dependency list with the -M option or similar, you can print the list with the following command.

cat ffserver.d | sed 's/[ ]/\n/g' | grep '\.h' | sed 's/ *//g' | sort | uniq

Include order

First, the ways to specify header folders are as follows.

  • -I dir
  • -iquote dir
  • -isystem dir
  • -idirafter dir

You can specify any number or combination of these options on the command line to search for header files in several directories. The lookup order is as follows:

  1. For the quote form of the include directive, the directory of the current file is searched first.
  2. For the quote form of the include directive, the directories specified by -iquote options are searched in left-to-right order, as they appear on the command line.
  3. Directories specified with -I options are scanned in left-to-right order.
  4. Directories specified with -isystem options are scanned in left-to-right order.
  5. Standard system directories are scanned.
  6. Directories specified with -idirafter options are scanned in left-to-right order.

Dump preprocessor defines

Yes, use -E -dM options instead of -c. Example (outputs them to stdout):

gcc -dM -E - < /dev/null

For C++

g++ -dM -E -x c++ - < /dev/null

From the gcc manual:

Instead of the normal output, generate a list of `#define' directives for all the macros defined during the execution of the preprocessor, including predefined macros. This gives you a way of finding out what is predefined in your version of the preprocessor. Assuming you have no file foo.h, the command

touch foo.h; cpp -dM foo.h

will show all the predefined macros.

If you use -dM without the -E option, -dM is interpreted as a synonym for -fdump-rtl-mach.

sysroot isysroot isystem

-sysroot is used to change the location of the standard C library's header files and libraries. It is usually used for cross-compiling.

With -sysroot=/mips-root, header files and libraries are looked up in /mips-root/usr/include and /mips-root/usr/lib.

-isysroot is used when you want to specify header files separately from libraries. Without this option, -sysroot is followed.

Besides the standard C library header files, /usr/include contains header files for many other libraries. When cross-compiling, it is convenient to gather the related library header files in one place; you could add them to the mips-root/usr/include above, but if you don't want them mixed, use the -isystem option to specify another directory in addition.

The priority for finding header files is as follows.

  1. -I
  2. -isystem
  3. -sysroot or -isysroot

Disable GCC warnings for a few lines of code

To suppress GCC Warnings in code:

#if defined(__GNUC__) && defined(__cplusplus)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Winline"
#endif

#include <boost/log/trivial.hpp>

#if defined(__GNUC__) && defined(__cplusplus)
# pragma GCC diagnostic pop
#endif

Symbol Visibility

The GCC Symbol Visibility Patch, included since GCC 4.0, makes the GCC compiler a bit more useful. The benefits of this feature mentioned on its home page are:

  • Dramatically improves the time it takes to load a DSO (Dynamic Shared Object) such as a shared library.
  • Lets the compiler optimiser produce better code.
  • Reduces DSO size by about 5–20%.
  • Lowers the chance of symbol collisions.

The visibility attribute can be set to one of the following four values.

  • default: the default. Ignores visibility and uses only whether the symbol (its binding) is global or static (local).
  • hidden: the commonly used attribute. Keeps the symbol from being exposed externally.
  • protected: rarely used. The symbol is exposed but cannot be overridden by other modules.
  • internal: rarely used. The symbol is not exposed, and the effect may differ slightly per architecture.

Exclude unused symbols

For GCC, this is accomplished in two stages:

First compile the data but tell the compiler to separate the code into separate sections within the translation unit. This will be done for functions, classes, and external variables by using the following two compiler flags:

-fdata-sections -ffunction-sections

Link the translation units together using the linker optimization flag (this causes the linker to discard unreferenced sections):

-Wl,--gc-sections

So if you had one file called test.cpp that had two functions declared in it, but one of them was unused, you could omit the unused one with the following command to gcc(g++):

gcc -Os -fdata-sections -ffunction-sections test.cpp -o test -Wl,--gc-sections

(Note that -Os is an additional compiler flag that tells GCC to optimize for size)

Tip

With mingw this does not work when linking statically statically libstdc++ and libgcc with the flag -static. The linker option -strip-all helps quite a bit, but still the generated executable (or dll) is about 4 way bigger than what Visual Studio would generate. Point is, I have no control on how libstdc++ was compiled. There should be a ld only option.

Exclude Functions

See the -finstrument-functions-exclude-file-list=file,file,... option or the -finstrument-functions-exclude-function-list=sym,sym,... option.

... In the end, I used strip:

strip --strip-symbol=main -o libdwm.a libdwm-nomain.a

Whole archive

  • MSVC: use link.exe with something like /WHOLEARCHIVE:libA.
  • Clang: use -Wl,-force_load,libfoobar.a or -Wl,-all_load.
  • GCC: add the libraries between the -Wl,--whole-archive and -Wl,--no-whole-archive flags.

Compilation process

GCC is not actually the compiler itself; it invokes the various tools needed in the compilation process. So gcc can compile not only C but other languages as well, since it only needs to invoke whatever compiles the other language as part of the process.

Compilation process summary

  1. Preprocessing
  2. Compilation into an assembly source file
  3. Instruction code generation
  4. Linking

Preprocessing ( ccp0 )

Loads the files included in the source file (#include) and copies and pastes them into the file currently being compiled. (Output: test.i)

Compiling to assembly code (cc1)

This can be called the actual compiler. It goes through lexical analysis -> parsing -> semantic analysis -> intermediate language generation -> code optimization -> object code generation.

  • Lexical analysis: splits the test.i file generated by preprocessing into the smallest units with syntactic meaning (tokens).
  • Parsing: checks for syntax errors and then builds a parse tree.
  • Semantic analysis: checks for semantic rather than syntactic problems, i.e. use of undeclared variables, type mismatches, the number of function arguments, and so on.
  • Intermediate language generation: before producing assembly code, generates code in RTL (Register Transfer Language), a language similar to lips, for optimization. (Output: test.rtl)
  • Code optimization: optimizes to reduce code size and increase speed. It takes most of gcc's compile time and goes through the two stages below.
    • Intermediate code optimization
      • Local optimization: optimizations such as strength reduction and constant computation
      • Global optimization: removal of unused code
      • Loop optimization: removal of unused loops, loop fusion
    • Object code optimization
      • Uses registers rather than memory as much as possible and optimizes memory access by choosing efficient instructions.
  • Object code generation: converts the optimized rtl code into assembly code. Assembly code maps 1:1 to the instructions (machine code) defined for each CPU. (Output: test.s)

Machine code generation (as)

Converts the .s assembly code into a .o object file. The generated object file follows the ELF(Executable and Linking) binary file structure convention, because linking multiple object files would be impossible if their structures differed. Binary formats such as a.out / ELF / COFF have been used on Unix systems, and today ELF is mostly used. Windows systems use COFF and PE.

  • The ELF file structure consists of, from the top, the ELF file header, the program header Table, sections 1 ~ n, and the section header table.
  • Everything except the ELF file header may differ per compiled file, and it records instructions, data, the GCC compiler version, and so on.

Linking (collect2)

The process of linking multiple object files into one; this is mainly where libraries get linked.

  • Static library: the library is included in the executable at link time. So if other programs use the same library, it is duplicated and takes up a lot of space, but it is fast since linking is already complete.
  • Dynamic library (shared library): at link time, only whether the library is included is recorded, and the library is loaded into memory and used at run time. If other programs use the same library, they use the copy already loaded in memory, which is why it is also called a shared library. So as long as even one program uses the library, it stays resident in memory, and when no program uses it, it is removed from memory. Since it is loaded at run time it may be somewhat slower, but memory use is efficient because it is not loaded more than once. (Output: executable).

Common compiler misconceptions

See Compiler#Common compiler misconceptions.

Debugging symbols

Using -g on the command line adds debugging symbols. You can check the sections with objdump.

You can check as follows.

$ objdump -x main-g.o | grep debug

It includes content like the following.

 25 .debug_aranges 00000030  0000000000000000  0000000000000000  00003042  2**0
 26 .debug_info   000000c4  0000000000000000  0000000000000000  00003072  2**0
 27 .debug_abbrev 00000071  0000000000000000  0000000000000000  00003136  2**0
 28 .debug_line   0000004c  0000000000000000  0000000000000000  000031a7  2**0
 29 .debug_str    0000009f  0000000000000000  0000000000000000  000031f3  2**0
0000000000000000 l    d  .debug_aranges 0000000000000000              .debug_aranges
0000000000000000 l    d  .debug_info    0000000000000000              .debug_info
0000000000000000 l    d  .debug_abbrev  0000000000000000              .debug_abbrev
0000000000000000 l    d  .debug_line    0000000000000000              .debug_line
0000000000000000 l    d  .debug_str 0000000000000000              .debug_str
  • -g0 adds no debugging symbols. It is the same as not adding -g to the command line.
  • If you use the -g0 and -g options together, the option entered last on the command line takes effect.

Separating debug symbols from the target

You need to use objcopy to separate the debug information:

objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}"
strip --strip-debug --strip-unneeded "${tostripfile}"
objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}"

I use the bash script below to separate the debug information into files with a .debug extension in a .debug directory. This way I can tar the libraries and executables in one tar file and the .debug directories in another. If I want to add the debug info later on I simply extract the debug tar file and voila I have symbolic debug information.

This is the bash script:

#!/bin/bash

scriptdir=`dirname ${0}`
scriptdir=`(cd ${scriptdir}; pwd)`
scriptname=`basename ${0}`

set -e

function errorexit()
{
  errorcode=${1}
  shift
  echo $@
  exit ${errorcode}
}

function usage()
{
  echo "USAGE ${scriptname} <tostrip>"
}

tostripdir=`dirname "$1"`
tostripfile=`basename "$1"`


if [ -z ${tostripfile} ] ; then
  usage
  errorexit 0 "tostrip must be specified"
fi

cd "${tostripdir}"

debugdir=.debug
debugfile="${tostripfile}.debug"

if [ ! -d "${debugdir}" ] ; then
  echo "creating dir ${tostripdir}/${debugdir}"
  mkdir -p "${debugdir}"
fi
echo "stripping ${tostripfile}, putting debug info into ${debugfile}"
objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}"
strip --strip-debug --strip-unneeded "${tostripfile}"
objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}"
chmod -x "${debugdir}/${debugfile}"

License

GCC Runtime Library Exception

What libraries does the GCC Runtime Library Exception cover?
The GCC Runtime Library Exception covers any file that has a notice in its license headers stating that the exception applies. This includes libgcc, libstdc++, libfortran, libgomp, libdecnumber, libgcov, and other libraries distributed with GCC.

Troubleshooting

A collection of problems related to using GCC.

ISO C90 forbids mixed declarations and code

If you get the warning above, try moving the variable declarations to the start of the function.

STD C++11 error

When using thread and the like, compilation may fail outright with an error like the following.

In file included from test.cpp:1:0:
C:/root/msys/tdmgcc/lib/gcc/mingw32/4.9.2/include/c++/thread: In function 'bool std::operator<(std::thread::id, std::thread::id)':
C:/root/msys/tdmgcc/lib/gcc/mingw32/4.9.2/include/c++/thread:88:30: error: no match for 'operator<' (operand types are 'std::thread::native_handle_type {aka ptw32_handle_t}' and 'std::thread::native_handle_type {aka ptw32_handle_t}')
       { return __x._M_thread < __y._M_thread; }

In this case, check the CPLUS_INCLUDE_PATH environment variable and remove it if it is set. 910

In the end it was not an INCLUDE PATH problem; it was a conflict between pthread.h from pthread win32 and mingw/include/pathread.h, which c++11's thread uses internally.

_stricmp c++11 not existent

In c++11, symbols such as _stricmp, _strdup, and _fileno cannot be found. The answer is as follows.

The -std=c++0x option causes g++ to go into 'strict ANSI' mode so it doesn't declare non-standard functions (and _stricmp() is non-standard - it's just a version of strcmp() that's case-insensitive).
Use -std=gnu++0x instead.

LIBRARY_PATH variable error

When installing GCC yourself from source code, the following error may occur at the make step.

checking LIBRARY_PATH variable... contains current directory
configure: error: 
*** LIBRARY_PATH shouldn't contain the current directory when
*** building gcc. Please change the environment variable
*** and run configure again.

Apparently, your LIBRARY_PATH ends in a colon:

/usr/lib/x86_64-linux-gnu/:
#  -----------------------^

Get rid of that:

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/

cannot open shared object file

GLIBCXX not found

After compiling, running the executable may print an error message like the following.

/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

In this case, using -static-libstdc++ in the Linker options may solve it.

If that doesn't fix it, check the LD_LIBRARY_PATH environment variable. On 64bit, a path such as /usr/local/lib64 is sometimes not added.

Undefined reference to ~

If linking a library fails with a message like undefined reference to ~, moving the command-line position of the libraries starting with the -l option may solve it. For example, if you compile with g++ -L. -ltest main.o, changing it to g++ -L. main.o -ltest may make it compile correctly.

DSO missing from command line

DSO here means Dynamic Shared Object; since the error message says it's missing from the command line, I guess you have to add it to the command line.

virtual-move-assign

See C++:Inheritance#virtual-move-assign.

warning: direct access in function

You may get a warning like the following.

ld: warning: direct access in function 'std::__1::basic_filebuf<char, std::__1::char_traits<char> >::open(char const*, unsigned int)' from file '/Path/To/Derived/Data/Xcode/DerivedData/myapp/Build/Intermediates/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_lto.o' to global weak symbol 'std::__1::basic_filebuf<char, std::__1::char_traits<char> >::open(char const*, unsigned int)' from file '/Path/To/Derived/Data/Xcode/DerivedData/myapp/Build/Intermediates/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_lto.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

Use -fvisibility=hidden when compiling.

See also

Favorite site

GCC Online documentation

References


  1. MinGW_Static_and_Dynamic_Libraries_-_CodeProject.pdf ↩

  2. GCC_-Multiple_precompiled_headers_and_specific_paths-_Stack_Overflow.pdf ↩

  3. http://stackoverflow.com/questions/8843818/what-does-the-fpermissive-flag-do ↩

  4. GCC_optimization_-_Gentoo_Wiki.pdf ↩

  5. Gcc-march_options.pdf ↩

  6. Position_Independent_Code_-PIC-in_shared_libraries-_Eli_Benderskys_website.pdf ↩

  7. Pic_option_for_shared_library.pdf ↩

  8. GCC_Warning_Error_List-kor.pdf ↩

  9. Q1: https://kldp.org/node/151389 ↩

  10. Q2: http://sourceforge.net/p/tdm-gcc/bugs/256/ ↩

  11. Linux_-_No_such_so_file.pdf ↩

  12. Cannot_open_shared_object_file_-_Litcoder.pdf ↩

  13. Naver_blog_GCC_Compile_process_and_commandline_options.pdf ↩

  14. GCC_Options_and_how_to_create_library.pdf ↩

  15. Shows the GCC compilation process and the files it generates. ↩

  16. GCC_and_Make_-_A_Tutorial_on_how_to_compile,_link_and_build_C_C++_applications.pdf ↩

  17. Create_so_file.pdf ↩

  18. Gcc_options.pdf ↩

  19. Gcc.4.7.2.zip ↩

author Zer0 sitemap