<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Preparing_GCC_Build</id>
	<title>Preparing GCC Build - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Preparing_GCC_Build"/>
	<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;action=history"/>
	<updated>2026-04-05T12:58:16Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=450&amp;oldid=prev</id>
		<title>2022年2月14日 (一) 12:43 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=450&amp;oldid=prev"/>
		<updated>2022-02-14T12:43:56Z</updated>

		<summary type="html">&lt;p&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;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年2月14日 (一) 12:43的版本&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-l136&quot;&gt;第136行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第136行：&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;例如，你可以通过运行shell命令在Debian上安装 '''&amp;lt;tt&amp;gt;libgmp3-dev&amp;lt;/tt&amp;gt;''': '''&amp;lt;tt&amp;gt;sudo apt install libgmp3-dev&amp;lt;/tt&amp;gt;'''&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;例如，你可以通过运行shell命令在Debian上安装 '''&amp;lt;tt&amp;gt;libgmp3-dev&amp;lt;/tt&amp;gt;''': '''&amp;lt;tt&amp;gt;sudo apt install libgmp3-dev&amp;lt;/tt&amp;gt;'''&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;br/&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;br/&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;'''注意:'''第5版。已知Texinfo的x（或更高版本）与当前的Binutils 2.23.2版本（及更早版本）不兼容。 你可以使用&amp;lt;TT&amp;gt;makeinfo--version&amp;lt;/TT&amp;gt;检查当前版本。 如果你的版本太新，并且在构建过程中遇到问题，则需要使用Binutils 2.24版本 (或更新版本) 或安装旧版本的Texinfo -  也许是通过从源代码上构建 -  &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;并将其添加到&lt;/del&gt;&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;之前和Binutils构建期间。&lt;/del&gt;&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;'''注意:'''第5版。已知Texinfo的x（或更高版本）与当前的Binutils 2.23.2版本（及更早版本）不兼容。 你可以使用&amp;lt;TT&amp;gt;makeinfo--version&amp;lt;/TT&amp;gt;检查当前版本。 如果你的版本太新，并且在构建过程中遇到问题，则需要使用Binutils 2.24版本 (或更新版本) 或安装旧版本的Texinfo -  也许是通过从源代码上构建 -  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;并在Binutils构建前后将其添加到&lt;/ins&gt;&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;。&lt;/ins&gt;&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;br/&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;br/&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;''' 注意: ''' ISL的版本0.13 (或更高版本) 与当前的CLooG 0.18.1版本 (及更早版本) 不兼容。  使用ISL的0.12.2版本，否则生成'''肯定会'''失败。&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;''' 注意: ''' ISL的版本0.13 (或更高版本) 与当前的CLooG 0.18.1版本 (及更早版本) 不兼容。  使用ISL的0.12.2版本，否则生成'''肯定会'''失败。&lt;/div&gt;&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-l161&quot;&gt;第161行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第161行：&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;     PORTDIR_OVERLAY=&amp;quot;/usr/local/crossdev&amp;quot; crossdev --stage1 --binutils &amp;lt;binutils-version&amp;gt; --gcc &amp;lt;gcc-version&amp;gt; --target &amp;lt;target&amp;gt;&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;     PORTDIR_OVERLAY=&amp;quot;/usr/local/crossdev&amp;quot; crossdev --stage1 --binutils &amp;lt;binutils-version&amp;gt; --gcc &amp;lt;gcc-version&amp;gt; --target &amp;lt;target&amp;gt;&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;br/&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;br/&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;这将把GCC交叉编译器安装到一个&amp;quot;slot&amp;quot;中，即与现有的编译器版本一起安装。 你可以通过这种方式安装多个交叉编译器，只需更改目标名称即可。 它的缺点是，它还将引入gentoo补丁，并传递与官方[[GCC Cross Compiler]]设置不同的额外配置选项，它们的行为可能会有所不同。&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;这将把GCC交叉编译器安装到一个&amp;quot;slot&amp;quot;中，即与现有的编译器版本一起安装。 你可以通过这种方式安装多个交叉编译器，只需更改目标名称即可。 它的缺点是，它还将引入gentoo补丁，并传递与官方[[GCC Cross&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-&lt;/ins&gt;Compiler]]设置不同的额外配置选项，它们的行为可能会有所不同。&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;br/&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;br/&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;编译成功后，可以通过&amp;lt;target&amp;gt;-GCC调用你的交叉编译器。 如果需要，你还可以使用gcc-config在编译器版本之间切换。 不要用交叉编译器替换系统编译器。 包管理器还会在更新可用时立即提出建议。  &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;编译成功后，可以通过&amp;lt;target&amp;gt;-GCC调用你的交叉编译器。 如果需要，你还可以使用gcc-config在编译器版本之间切换。 不要用交叉编译器替换系统编译器。 包管理器还会在更新可用时立即提出建议。  &lt;/div&gt;&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-l176&quot;&gt;第176行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第176行：&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;安装新版本(自己编译或使用MacPorts)并添加 &amp;lt;tt&amp;gt;--with-libiconv-prefix=/opt/local&amp;lt;/tt&amp;gt; (如果你自己编译，则为 &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;) 到GCC的 &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; 行。 或者，你可以将libiconv源代码放置到GCC-x.y.z/libiconv，它将作为GCC编译过程的一部分进行编译。 (此技巧也适用于MPFR，GMP和MPC)。&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;安装新版本(自己编译或使用MacPorts)并添加 &amp;lt;tt&amp;gt;--with-libiconv-prefix=/opt/local&amp;lt;/tt&amp;gt; (如果你自己编译，则为 &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;) 到GCC的 &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; 行。 或者，你可以将libiconv源代码放置到GCC-x.y.z/libiconv，它将作为GCC编译过程的一部分进行编译。 (此技巧也适用于MPFR，GMP和MPC)。&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;br/&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;br/&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;Binutils和GCC的makefile使用&amp;lt;source lang=&amp;quot;make&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;$(CC)&amp;lt;/source&amp;gt;变量来调用编译器。 在OS X上，默认解析为&amp;lt;source lang=&amp;quot;text&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;gcc&amp;lt;/source&amp;gt;，实际是 &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;clang&amp;lt;/source&amp;gt;. 在OSX10.8之前，Xcode的命令行工具包附带的Clang无法构建一个正常工作的GCC。 运行OS X 10.7或以下版本的用户可能需要从 [https://brew.sh &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;自制程序&lt;/del&gt;] 或从Apple网站上的某个地方查找并安装GCC。 你可以尝试使用预装在某些macOS版本上的旧GCC。&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;Binutils和GCC的makefile使用&amp;lt;source lang=&amp;quot;make&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;$(CC)&amp;lt;/source&amp;gt;变量来调用编译器。 在OS X上，默认解析为&amp;lt;source lang=&amp;quot;text&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;gcc&amp;lt;/source&amp;gt;，实际是 &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;clang&amp;lt;/source&amp;gt;. 在OSX10.8之前，Xcode的命令行工具包附带的Clang无法构建一个正常工作的GCC。 运行OS X 10.7或以下版本的用户可能需要从 [https://brew.sh &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Homebrew&lt;/ins&gt;] 或从Apple网站上的某个地方查找并安装GCC。 你可以尝试使用预装在某些macOS版本上的旧GCC。&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;br/&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;br/&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;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&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;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&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-l216&quot;&gt;第216行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第216行：&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;与Windows 10周年更新一起发布的“Windows Linux子系统（Beta版）”也是使用交叉编译器的一个选项。（使用GCC 6.1.0和Binutils 2.27于2016年8月8日进行测试）尽管处于测试状态，该交叉编译器运行速度相当快，但可能不是理想的永久性开发平台。&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;与Windows 10周年更新一起发布的“Windows Linux子系统（Beta版）”也是使用交叉编译器的一个选项。（使用GCC 6.1.0和Binutils 2.27于2016年8月8日进行测试）尽管处于测试状态，该交叉编译器运行速度相当快，但可能不是理想的永久性开发平台。&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;br/&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;br/&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;'''Cygwin注意：''' Cygwin在其bash &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中包含你的Windows &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt; 如果你以前使用过DJGPP，这可能会导致混淆，例如在Cygwin bash命令行上调用&amp;lt;tt&amp;gt;GCC&amp;lt;/tt&amp;gt;仍会调用DJGPP编译器。 卸载DJGPP后，应删除DJGPP环境变量，并从 &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中清除&amp;lt;tt&amp;gt;C:\djgpp&amp;lt;/tt&amp;gt;条目(或其安装位置)。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;同样，在系统路径变量中混合构建环境可能是一个坏主意。&lt;/del&gt;&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;'''Cygwin注意：''' Cygwin在其bash &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中包含你的Windows &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt; 如果你以前使用过DJGPP，这可能会导致混淆，例如在Cygwin bash命令行上调用&amp;lt;tt&amp;gt;GCC&amp;lt;/tt&amp;gt;仍会调用DJGPP编译器。 卸载DJGPP后，应删除DJGPP环境变量，并从 &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中清除&amp;lt;tt&amp;gt;C:\djgpp&amp;lt;/tt&amp;gt;条目(或其安装位置)。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;同样，在系统路径变量中混淆构建环境可能是一个坏主意。&lt;/ins&gt;&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;br/&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;br/&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;'''MinGW 注意:''' 有关构建跨工具链的一些特定于MinGW的信息可以在MinGW主页上的[http://www.mingw.org/wiki/HostedCrossCompilerHOWTO 托管的交叉编译器操作页面上找到]。&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;'''MinGW 注意:''' 有关构建跨工具链的一些特定于MinGW的信息可以在MinGW主页上的[http://www.mingw.org/wiki/HostedCrossCompilerHOWTO 托管的交叉编译器操作页面上找到]。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=448&amp;oldid=prev</id>
		<title>2022年2月14日 (一) 07:35 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=448&amp;oldid=prev"/>
		<updated>2022-02-14T07:35:37Z</updated>

		<summary type="html">&lt;p&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;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年2月14日 (一) 07:35的版本&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-l140&quot;&gt;第140行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第140行：&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;''' 注意: ''' ISL的版本0.13 (或更高版本) 与当前的CLooG 0.18.1版本 (及更早版本) 不兼容。  使用ISL的0.12.2版本，否则生成'''肯定会'''失败。&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;''' 注意: ''' ISL的版本0.13 (或更高版本) 与当前的CLooG 0.18.1版本 (及更早版本) 不兼容。  使用ISL的0.12.2版本，否则生成'''肯定会'''失败。&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;br/&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;br/&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;=下载源代码=&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&lt;/ins&gt;= 下载源代码&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&lt;/ins&gt;=&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;br/&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;br/&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;将所需的源代码下载到合适的目录中，例如 &amp;lt;tt&amp;gt;$HOME/src&amp;lt;/tt&amp;gt;:&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;将所需的源代码下载到合适的目录中，例如 &amp;lt;tt&amp;gt;$HOME/src&amp;lt;/tt&amp;gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=447&amp;oldid=prev</id>
		<title>Zhang3：创建页面，内容为“{{Rating|1}}  &lt;noinclude&gt;'''请注意，本文旨在包含于GCC Cross-Compiler和Building GCC中，因为它们共享此公共部分。'''&lt;/noinclude&gt;  GNU编译器集合是一个具有依赖关系的高级软件。 为了构建GCC，你需要以下内容：  * 类Unix的环境(Windows用户可以使用Linux或Cygwin的Windows子系统) * 足够的内存和硬盘空间 (视情况而定，256 MiB不够)。 * GCC（有的待替换发行版）或其他sys…”</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Preparing_GCC_Build&amp;diff=447&amp;oldid=prev"/>
		<updated>2022-02-14T07:31:47Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“{{Rating|1}}  &amp;lt;noinclude&amp;gt;&amp;#039;&amp;#039;&amp;#039;请注意，本文旨在包含于&lt;a href=&quot;/index.php?title=GCC_Cross-Compiler&quot; title=&quot;GCC Cross-Compiler&quot;&gt;GCC Cross-Compiler&lt;/a&gt;和&lt;a href=&quot;/index.php?title=Building_GCC&quot; title=&quot;Building GCC&quot;&gt;Building GCC&lt;/a&gt;中，因为它们共享此公共部分。&amp;#039;&amp;#039;&amp;#039;&amp;lt;/noinclude&amp;gt;  GNU编译器集合是一个具有依赖关系的高级软件。 为了构建GCC，你需要以下内容：  * 类Unix的环境(Windows用户可以使用Linux或Cygwin的Windows子系统) * 足够的内存和硬盘空间 (视情况而定，256 MiB不够)。 * GCC（有的待替换发行版）或其他sys…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Rating|1}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;'''请注意，本文旨在包含于[[GCC Cross-Compiler]]和[[Building GCC]]中，因为它们共享此公共部分。'''&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GNU编译器集合是一个具有依赖关系的高级软件。 为了构建GCC，你需要以下内容：&lt;br /&gt;
&lt;br /&gt;
* 类Unix的环境(Windows用户可以使用Linux或Cygwin的Windows子系统)&lt;br /&gt;
* 足够的内存和硬盘空间 (视情况而定，256 MiB不够)。&lt;br /&gt;
* GCC（有的待替换发行版）或其他system C编译器&lt;br /&gt;
* G++(如果构建GCC的版本&amp;gt;=4.8.0)，或其他system C++编译器&lt;br /&gt;
* Make&lt;br /&gt;
* Bison&lt;br /&gt;
* Flex&lt;br /&gt;
* GMP&lt;br /&gt;
* MPFR&lt;br /&gt;
* MPC&lt;br /&gt;
* Texinfo&lt;br /&gt;
* ISL (optional)&lt;br /&gt;
* CLooG (optional)&lt;br /&gt;
&lt;br /&gt;
=== 安装依赖项 ===&lt;br /&gt;
&lt;br /&gt;
{| {{wikitable}}&lt;br /&gt;
|-&lt;br /&gt;
! &amp;amp;darr; Dependency / OS &amp;amp;rarr;&lt;br /&gt;
| 源代码&lt;br /&gt;
| Debian (Ubuntu, Mint, WSL, ...)&lt;br /&gt;
| Gentoo&lt;br /&gt;
| Fedora&lt;br /&gt;
| Cygwin&lt;br /&gt;
| OpenBSD&lt;br /&gt;
| Arch&lt;br /&gt;
|-&lt;br /&gt;
|如何安装&lt;br /&gt;
|Normally&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sudo apt install&amp;lt;/tt&amp;gt; ''foo'''''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sudo emerge --ask&amp;lt;/tt&amp;gt; ''foo'''''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sudo dnf install&amp;lt;/tt&amp;gt; ''foo'''''&lt;br /&gt;
|Cygwin GUI setup&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;doas pkg_add&amp;lt;/tt&amp;gt; ''foo'''''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;pacman -Syu&amp;lt;/tt&amp;gt; ''foo'''''&lt;br /&gt;
|-&lt;br /&gt;
|Compiler&lt;br /&gt;
|N/A&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;build-essential&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sys-devel/gcc&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;gcc gcc-c++&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;mingw64-x86_64-gcc-g++&amp;lt;/tt&amp;gt;''' / '''&amp;lt;tt&amp;gt;mingw64-i686-gcc-g++&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|Preinstalled&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;base-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|Make&lt;br /&gt;
|N/A&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;build-essential&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sys-devel/make&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|Preinstalled&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;base-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gnu.org/software/bison/ Bison]&lt;br /&gt;
|[https://ftp.gnu.org/gnu/bison/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;bison&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sys-devel/bison&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;bison&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;bison&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|?&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;base-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/westes/flex Flex]&lt;br /&gt;
|[https://github.com/westes/flex/releases]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;flex&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sys-devel/flex&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;flex&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;flex&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|?&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;base-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://gmplib.org/ GMP]&lt;br /&gt;
|[https://ftp.gnu.org/gnu/gmp/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libgmp3-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;dev-libs/gmp&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;gmp-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libgmp-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;gmp&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;gmp&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|MPC&lt;br /&gt;
|[https://ftp.gnu.org/gnu/mpc/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpc-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;dev-libs/mpc&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpc-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpc-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpc&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpc&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mpfr.org/ MPFR]&lt;br /&gt;
|[https://ftp.gnu.org/gnu/mpfr/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpfr-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;dev-libs/mpfr&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;mpfr-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libmpfr-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;mpfr&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;mpfr&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gnu.org/software/texinfo/ Texinfo]&lt;br /&gt;
|[https://ftp.gnu.org/gnu/texinfo/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;texinfo&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;sys-apps/texinfo&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;texinfo&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;texinfo&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;texinfo&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;base-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.cloog.org/ CLooG] (Optional)&lt;br /&gt;
|[https://www.cloog.org/ CLooG]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libcloog-isl-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;dev-libs/cloog&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;cloog-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libcloog-isl-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|[http://isl.gforge.inria.fr/ ISL] (Optional)&lt;br /&gt;
|[http://isl.gforge.inria.fr/]&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libisl-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;dev-libs/isl&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;isl-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|'''&amp;lt;tt&amp;gt;libisl-devel&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
|N/A&lt;br /&gt;
|N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
你需要安装Texinfo来构建Binutils。 你需要安装GMP、MPC和MPFR来构建GCC。 GCC可以选择使用ClooG和isl库。&lt;br /&gt;
&lt;br /&gt;
例如，你可以通过运行shell命令在Debian上安装 '''&amp;lt;tt&amp;gt;libgmp3-dev&amp;lt;/tt&amp;gt;''': '''&amp;lt;tt&amp;gt;sudo apt install libgmp3-dev&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''注意:'''第5版。已知Texinfo的x（或更高版本）与当前的Binutils 2.23.2版本（及更早版本）不兼容。 你可以使用&amp;lt;TT&amp;gt;makeinfo--version&amp;lt;/TT&amp;gt;检查当前版本。 如果你的版本太新，并且在构建过程中遇到问题，则需要使用Binutils 2.24版本 (或更新版本) 或安装旧版本的Texinfo -  也许是通过从源代码上构建 -  并将其添加到&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;之前和Binutils构建期间。&lt;br /&gt;
&lt;br /&gt;
''' 注意: ''' ISL的版本0.13 (或更高版本) 与当前的CLooG 0.18.1版本 (及更早版本) 不兼容。  使用ISL的0.12.2版本，否则生成'''肯定会'''失败。&lt;br /&gt;
&lt;br /&gt;
=下载源代码=&lt;br /&gt;
&lt;br /&gt;
将所需的源代码下载到合适的目录中，例如 &amp;lt;tt&amp;gt;$HOME/src&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* 你可以通过访问[https://gnu.org/software/binutils/ Binutils网站]或直接访问[https://ftp.gnu.org/gnu/binutils/ GNU主镜像站点]。&lt;br /&gt;
&lt;br /&gt;
* 你可以通过访问[https://gnu.org/software/gcc/ GCC网站]或直接访问[https://ftp.gnu.org/gnu/gcc/GCC 主镜像站点]下载所需的GCC版本。&lt;br /&gt;
&lt;br /&gt;
''' 注意: ''' 使用的版本控制方案是每个句点分开一个完整的数字，即 Binutils 2.20.0比2.9.0更新。 如果查看按字母数字排序的tarball列表时，可能没有用此版本控制方案(相当常见的)，这可能会让你感到困惑： 有时列表底部的文件不是最新版本! 获取最新版本的一个简单方法是按上次修改的日期排序并滚动到底部。&lt;br /&gt;
&lt;br /&gt;
===Linux用户构建系统编译器===&lt;br /&gt;
你的发行版可能会发布自己补丁包的GCC和Binutils，这些修补的GCC和Binutils才可以在你的特定Linux发行版上工作。 你应该能够使用上述源代码构建一个工作的交叉编译器，但是你可能无法用源代码为当前的Linux发行版构建一个新的系统编译器。 在这种情况下，请尝试较新的GCC版本或获取打了补丁的源代码。&lt;br /&gt;
&lt;br /&gt;
=== Gentoo用户 ===&lt;br /&gt;
&lt;br /&gt;
Gentoo提供[https://wiki.gentoo.org/wiki/Crossdev crossdev]来建立交叉开发工具链：&lt;br /&gt;
&lt;br /&gt;
    emerge -av crossdev&lt;br /&gt;
    crossdev --help&lt;br /&gt;
    PORTDIR_OVERLAY=&amp;quot;/usr/local/crossdev&amp;quot; crossdev --stage1 --binutils &amp;lt;binutils-version&amp;gt; --gcc &amp;lt;gcc-version&amp;gt; --target &amp;lt;target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
这将把GCC交叉编译器安装到一个&amp;quot;slot&amp;quot;中，即与现有的编译器版本一起安装。 你可以通过这种方式安装多个交叉编译器，只需更改目标名称即可。 它的缺点是，它还将引入gentoo补丁，并传递与官方[[GCC Cross Compiler]]设置不同的额外配置选项，它们的行为可能会有所不同。&lt;br /&gt;
&lt;br /&gt;
编译成功后，可以通过&amp;lt;target&amp;gt;-GCC调用你的交叉编译器。 如果需要，你还可以使用gcc-config在编译器版本之间切换。 不要用交叉编译器替换系统编译器。 包管理器还会在更新可用时立即提出建议。 &lt;br /&gt;
&lt;br /&gt;
你可以通过调用 “crossdev --clean &amp;lt;target&amp;gt;” 来卸载交叉编译器。 阅读[https://wiki.gentoo.org/wiki/Cross_build_environment 交叉开发]文档以获取更多信息。&lt;br /&gt;
&lt;br /&gt;
请注意，binutils和GCC的版本号是''Gentoo package versions''， 即 &amp;quot;官方&amp;quot; (GNU) 版本可能有一个后缀，用于解决Gentoo维护者提供的其他补丁集。 （例如，''--binutils 2.24-r3--gcc 4.8.3''是撰写本文时最新的稳定包对。） 你可以省略版本号以使用可用的最新软件包。&lt;br /&gt;
&lt;br /&gt;
Portage使用Overlay来存储不属于原始软件包管理的软件包。 Crossdev需要一个Overlay，在构建它们之前可以在其中存储其binutils和gcc包。 你可以正确配置一个，也可以使用PORTDIR_OVERLAY指向它应该保存其包管理器文件的位置。 使用PORTDIR_OVERLAY现有的overlay不是一个好主意，但是到那时你应该知道你是曾经是如何亲自设置它们的，以及如何正确地进行设置。 参考 [https://wiki.gentoo.org/wiki/Custom_repository#Crossdev].&lt;br /&gt;
&lt;br /&gt;
===MacOS用户===&lt;br /&gt;
macOS用户需要替换libiconv，因为系统libiconv已经严重过时。 macOS用户可以通过访问[https://gnu.org/software/libiconv/libiconv 网站]或直接访问[https://ftp.gnu.org/gnu/libiconv/GNU 主FTP镜像]。 否则，在OS X 10.4和10.5上编译GCC 4.3或更高版本时，可能会出现与libiconv相关的未解决符号错误。&lt;br /&gt;
&lt;br /&gt;
安装新版本(自己编译或使用MacPorts)并添加 &amp;lt;tt&amp;gt;--with-libiconv-prefix=/opt/local&amp;lt;/tt&amp;gt; (如果你自己编译，则为 &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;) 到GCC的 &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt; 行。 或者，你可以将libiconv源代码放置到GCC-x.y.z/libiconv，它将作为GCC编译过程的一部分进行编译。 (此技巧也适用于MPFR，GMP和MPC)。&lt;br /&gt;
&lt;br /&gt;
Binutils和GCC的makefile使用&amp;lt;source lang=&amp;quot;make&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;$(CC)&amp;lt;/source&amp;gt;变量来调用编译器。 在OS X上，默认解析为&amp;lt;source lang=&amp;quot;text&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;gcc&amp;lt;/source&amp;gt;，实际是 &amp;lt;source lang=&amp;quot;bash&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;clang&amp;lt;/source&amp;gt;. 在OSX10.8之前，Xcode的命令行工具包附带的Clang无法构建一个正常工作的GCC。 运行OS X 10.7或以下版本的用户可能需要从 [https://brew.sh 自制程序] 或从Apple网站上的某个地方查找并安装GCC。 你可以尝试使用预装在某些macOS版本上的旧GCC。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is only necessary for OS X users running 10.7 or below.&lt;br /&gt;
export CC=/usr/bin/gcc-4.2&lt;br /&gt;
export CXX=/usr/bin/g++-4.2&lt;br /&gt;
export CPP=/usr/bin/cpp-4.2&lt;br /&gt;
export LD=/usr/bin/gcc-4.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
一旦编译并安装了交叉编译器，你就需要取消设置这些导出。&lt;br /&gt;
&lt;br /&gt;
''' Lion用户注意: ''' 如果你在Lion（或更高版本）上，很可能你没有“真正的”GCC，因为苹果从Xcode软件包中删除了它，但你仍然可以安装它。 你可以通过Homebrew或通过从源代码编译来实现，[https://apple.stackexchange.com/a/38247 a StackExchange Answer]对这两种方法都有很好的描述。&lt;br /&gt;
&lt;br /&gt;
''' Maverick用户注意: ''' 可以使用Xcode 5.1.1构建binutils-2.24和gcc-4.8.3（可能的其他版本）。 请注意，使用LLVM构建GCC不是官方支持的，可能会导致有趣的错误，如果你愿意冒这个风险并想节省时间构建出host-gcc只是为了编译一个cross-gcc，请遵循以下内容。&lt;br /&gt;
用 [https://www.macports.org/ MacPorts] 安装GMP、MPFR、Mpc。&lt;br /&gt;
&lt;br /&gt;
 sudo port install gmp mpfr libmpc&lt;br /&gt;
&lt;br /&gt;
 ../binutils-2.24/configure --prefix=$PREFIX \&lt;br /&gt;
 --target=$TARGET \&lt;br /&gt;
 --enable-interwork --enable-multilib \&lt;br /&gt;
 --disable-nls --disable-werror&lt;br /&gt;
&lt;br /&gt;
 ../gcc-4.8.3/configure --prefix=$PREFIX \&lt;br /&gt;
 --target=$TARGET \&lt;br /&gt;
 --disable-nls \&lt;br /&gt;
 --enable-languages=c,c++ --without-headers \&lt;br /&gt;
 --enable-interwork --enable-multilib \&lt;br /&gt;
 --with-gmp=/usr --with-mpc=/opt/local --with-mpfr=/opt/local&lt;br /&gt;
&lt;br /&gt;
'''注意：''' port的GMP存在问题，因此使用来自/usr的OS X版本。&lt;br /&gt;
&lt;br /&gt;
===Windows用户===&lt;br /&gt;
Windows用户需要设置类Unix的环境，如[[MinGW]]或[[Cygwin]]。 也许值得先研究研究Linux等系统，看看它们是否符合你的需求，因为你通常在操作系统开发中使用许多类Unix的工具，而从类Unix的操作系统来看，这要容易得多。 '''如果你刚刚安装了基本的[[Cygwin]]软件包，你必须再次执行setup.exe并安装以下软件包：''' GCC, G++, Make, Flex, Bison, Diffutils, libintl-devel, libgmp-devel, libmpfr-devel, libmpc-devel, Texinfo&lt;br /&gt;
&lt;br /&gt;
MinGW MSYS是一种选择，由于它解决了本机Windows API而不是POSIX仿真层，因此工具链速度稍快。 一些软件包无法在MSYS下正确构建，因为它们不是为Windows设计的。 就本教程而言，除非另有说明，否则适用于Cygwin的所有内容也适用于MSYS。 确保安装C和C++编译器以及MSYS基本系统。&lt;br /&gt;
&lt;br /&gt;
与Windows 10周年更新一起发布的“Windows Linux子系统（Beta版）”也是使用交叉编译器的一个选项。（使用GCC 6.1.0和Binutils 2.27于2016年8月8日进行测试）尽管处于测试状态，该交叉编译器运行速度相当快，但可能不是理想的永久性开发平台。&lt;br /&gt;
&lt;br /&gt;
'''Cygwin注意：''' Cygwin在其bash &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中包含你的Windows &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt; 如果你以前使用过DJGPP，这可能会导致混淆，例如在Cygwin bash命令行上调用&amp;lt;tt&amp;gt;GCC&amp;lt;/tt&amp;gt;仍会调用DJGPP编译器。 卸载DJGPP后，应删除DJGPP环境变量，并从 &amp;lt;tt&amp;gt;%PATH%&amp;lt;/tt&amp;gt;中清除&amp;lt;tt&amp;gt;C:\djgpp&amp;lt;/tt&amp;gt;条目(或其安装位置)。 同样，在系统路径变量中混合构建环境可能是一个坏主意。&lt;br /&gt;
&lt;br /&gt;
'''MinGW 注意:''' 有关构建跨工具链的一些特定于MinGW的信息可以在MinGW主页上的[http://www.mingw.org/wiki/HostedCrossCompilerHOWTO 托管的交叉编译器操作页面上找到]。&lt;br /&gt;
&lt;br /&gt;
'''Windows Subsystem for Linux (Beta) 注意:''' 你不能让交叉编译器位于/mnt/c/（或/mnt/“x”）区域，因为尝试在那里编译交叉编译器会产生错误，而构建到$HOME/opt/cross则可以完美地工作。 此问题已使用Windows Update KB3176929修复&lt;br /&gt;
&lt;br /&gt;
=== OpenBSD用户 ===&lt;br /&gt;
OpenBSD用户可能需要从port安装“gcc”包，因为基本系统的gcc非常过时。 如果你想构建GCC，请尝试使用port对应的版本，而不是最新可用的版本，并将所有来自port的补丁应用到你的版本中。 另外，如果在编译LT0插件期间构建失败，则临时解决方案是在构建GCC的配置阶段通过添加 &amp;lt;tt&amp;gt;--disable-lto &amp;lt;/tt&amp;gt; 来完全禁用LTO&lt;/div&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
</feed>