Differences between revisions 4 and 5
Revision 4 as of 2016-09-09 08:11:48
Size: 695
Editor: SamatJain
Comment:
Revision 5 as of 2016-09-12 02:56:45
Size: 1508
Editor: SamatJain
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
== Static compilation ==

[[http://insanecoding.blogspot.ie/2012/07/creating-portable-linux-binaries.html|Insane Coding: Creating portable Linux binaries]]. Use `-static-libgcc -static-libstdc++` to include compiler support libraries.

[[http://www.pixelbeat.org/programming/linux_binary_compatibility.html|Linux distribution binary compatibility]]. Discusses glibc symbol versioning, and using the `.symver` directive to select a version of a functionl.

[https://blogs.gnome.org/tvb/2013/12/14/application-bundles-revisited/ Application Bundles Revisited – Tristan's World]. Discusses a vala script that will create a header file targeting an older glibc.

https://github.com/probonopd/AppImageKit/tree/fc6b9c5e896e4408ffd52a41dcb7a0be3149f74e/LibcWrapGenerator. Above script w/ CMake integration.

Using profile-guided optimization (PGO)

gcc -O3 -march=native -pg -fprofile-generate ...
# Run a benchmark or program's typical load
gcc -O3 -march=native -fprofile-use ...

Check compiler preprocessor defines

# E.g. check for the version of OpenMP supported
echo | cpp -fopenmp -dM | grep -i open
#define _OPENMP 200805

Compiling gcc

Download gcc tarball, run contrib/download_prerequisites script to download external libraries to build as part of gcc.

./configure --prefix=/opt/gcc-custom --disable-multilib --disable-libada --enable-languages=c,c++

Static compilation

Insane Coding: Creating portable Linux binaries. Use -static-libgcc -static-libstdc++ to include compiler support libraries.

Linux distribution binary compatibility. Discusses glibc symbol versioning, and using the .symver directive to select a version of a functionl.

[https://blogs.gnome.org/tvb/2013/12/14/application-bundles-revisited/ Application Bundles Revisited – Tristan's World]. Discusses a vala script that will create a header file targeting an older glibc.

https://github.com/probonopd/AppImageKit/tree/fc6b9c5e896e4408ffd52a41dcb7a0be3149f74e/LibcWrapGenerator. Above script w/ CMake integration.


CategoryCheatSheet

SamatsWiki: CheatSheet/Gcc (last edited 2020-05-09 00:20:51 by SamatJain)