<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.umiacs.umd.edu/cbcb/index.php?action=history&amp;feed=atom&amp;title=Gpertea_gcc</id>
	<title>Gpertea gcc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.umiacs.umd.edu/cbcb/index.php?action=history&amp;feed=atom&amp;title=Gpertea_gcc"/>
	<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/cbcb/index.php?title=Gpertea_gcc&amp;action=history"/>
	<updated>2026-04-13T07:29:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://wiki.umiacs.umd.edu/cbcb/index.php?title=Gpertea_gcc&amp;diff=8167&amp;oldid=prev</id>
		<title>Gpertea: /* Compiling gcc/g++ 4.5.x */</title>
		<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/cbcb/index.php?title=Gpertea_gcc&amp;diff=8167&amp;oldid=prev"/>
		<updated>2011-01-10T17:26:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling gcc/g++ 4.5.x&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:26, 10 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When statically linking with g++, the linker expects  -l arguments (libraries) to come after the files containing references to them, so &amp;#039;&amp;#039;&amp;#039;the .o and .a files must appear before the -l flags&amp;#039;&amp;#039;&amp;#039; in the g++ command line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When statically linking with g++, the linker expects  -l arguments (libraries) to come after the files containing references to them, so &amp;#039;&amp;#039;&amp;#039;the .o and .a files must appear before the -l flags&amp;#039;&amp;#039;&amp;#039; in the g++ command line.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Compiling gcc/g++ 4.5.x ===  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Compiling gcc/g++ 4.5.x ===  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I prefer to prepare the GCC compiler such that it will statically link the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;core system and &lt;/del&gt;C++ runtime libraries &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/del&gt;the executables generated by the compiler. This way the portability of the precompiled binaries is maximized.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I prefer to prepare the GCC compiler such that it will statically link the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;C/&lt;/ins&gt;C++ runtime libraries &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;into &lt;/ins&gt;the executables generated by the compiler. This way the portability of the precompiled binaries is maximized.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In order to compile GCC/G++ this way:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In order to compile GCC/G++ this way:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Make sure gmp, mpfr and mpc source trees are under the main  gcc-*/ source dir&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Make sure gmp, mpfr and mpc source trees are under the main  gcc-*/ source dir&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gpertea</name></author>
	</entry>
	<entry>
		<id>https://wiki.umiacs.umd.edu/cbcb/index.php?title=Gpertea_gcc&amp;diff=8166&amp;oldid=prev</id>
		<title>Gpertea at 16:33, 10 January 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/cbcb/index.php?title=Gpertea_gcc&amp;diff=8166&amp;oldid=prev"/>
		<updated>2011-01-10T16:33:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=GCC/G++ notes=&lt;br /&gt;
=== Linking tips ===&lt;br /&gt;
When statically linking with g++, the linker expects  -l arguments (libraries) to come after the files containing references to them, so &amp;#039;&amp;#039;&amp;#039;the .o and .a files must appear before the -l flags&amp;#039;&amp;#039;&amp;#039; in the g++ command line.&lt;br /&gt;
=== Compiling gcc/g++ 4.5.x === &lt;br /&gt;
I prefer to prepare the GCC compiler such that it will statically link the core system and C++ runtime libraries in the executables generated by the compiler. This way the portability of the precompiled binaries is maximized.&lt;br /&gt;
In order to compile GCC/G++ this way:&lt;br /&gt;
*Make sure gmp, mpfr and mpc source trees are under the main  gcc-*/ source dir&lt;br /&gt;
For some mpfr versions, the configure script may need to be patched:&lt;br /&gt;
&amp;lt;pre&amp;gt;extra_mpfr_configure_flags=&amp;#039;--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp&amp;#039; &amp;lt;/pre&amp;gt;&lt;br /&gt;
.. replace the above line with:&lt;br /&gt;
&amp;lt;pre&amp;gt;extra_mpfr_configure_flags=&amp;#039;--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/&amp;#039;&amp;quot;$lt_cv_objdir&amp;quot; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming tcsh, and that the gcc and g++ source were unpacked under the gcc-4.5.1 subdirectory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ..&lt;br /&gt;
mkdir gcc45obj&lt;br /&gt;
setenv CFLAGS &amp;#039;-O2&amp;#039;&lt;br /&gt;
setenv CXXFLAGS &amp;#039;-O2 -fno-implicit-templates&amp;#039;&lt;br /&gt;
&lt;br /&gt;
../gcc-4.5.1/configure --prefix=/fs/sz-user-supported/Linux-x86_64/packages/gcc-4.5.1 \&lt;br /&gt;
 --enable-threads=posix --disable-shared --disable-multilib --enable-__cxa_atexit \&lt;br /&gt;
 --disable-libunwind-exceptions --disable-checking --build=x86_64-redhat-linux --disable-dssi \&lt;br /&gt;
 --enable-plugin --disable-nls --with-cpu=generic --enable-languages=c,c++&lt;br /&gt;
&lt;br /&gt;
make CFLAGS=&amp;#039;-O2&amp;#039; BOOT_CFLAGS=&amp;#039;-O2&amp;#039; BOOT_FLAGS=&amp;#039;-O2&amp;#039; STAGE1_CFLAGS=&amp;#039;-O2&amp;#039; LIBCFLAGS=&amp;#039;-O2&amp;#039; \&lt;br /&gt;
LIBCXXFLAGS=&amp;#039;-O2 -fno-implicit-templates&amp;#039; CXXFLAGS=&amp;#039;-O2&amp;#039; bootstrap-lean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Building may take a long time. After it is done, installing it is simply a matter of running &amp;lt;pre&amp;gt;make install&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gpertea</name></author>
	</entry>
</feed>