<?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=GCC_Cross-Compiler</id>
	<title>GCC Cross-Compiler - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=GCC_Cross-Compiler"/>
	<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;action=history"/>
	<updated>2026-04-06T23:31:09Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=449&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=GCC_Cross-Compiler&amp;diff=449&amp;oldid=prev"/>
		<updated>2022-02-14T12:43:30Z</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-l5&quot;&gt;第5行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第5行：&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;==导言==&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;==导言==&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;简单来说，交叉编译器是指在平台A('''Host主机''')上运行，但为平台B('''&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Traget目标&lt;/del&gt;''')生成可执行文件的编译器。 这两个平台可能 (但不一定) 在CPU、操作系统以及[[:Category:Executable Formats|可执行格式]]方面有所不同。 在我们的例子中，主机平台是你当前的操作系统，目标平台是你即将制作的操作系统。 重要的是要认识到，这两个平台是不同的；你正在开发的操作系统总是不同于你当前使用的操作系统。 这就是为什么我们需要首先构建一个交叉编译器，否则你肯定会遇到麻烦。&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;简单来说，交叉编译器是指在平台A('''Host主机''')上运行，但为平台B('''&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Target目标&lt;/ins&gt;''')生成可执行文件的编译器。 这两个平台可能 (但不一定) 在CPU、操作系统以及[[:Category:Executable Formats|可执行格式]]方面有所不同。 在我们的例子中，主机平台是你当前的操作系统，目标平台是你即将制作的操作系统。 重要的是要认识到，这两个平台是不同的；你正在开发的操作系统总是不同于你当前使用的操作系统。 这就是为什么我们需要首先构建一个交叉编译器，否则你肯定会遇到麻烦。&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;===为什么需要交叉编译器===&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;===为什么需要交叉编译器===&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-l13&quot;&gt;第13行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第13行：&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;===选择哪个编译器版本===&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;===选择哪个编译器版本===&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;{{Main|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;构建GCC&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;{{Main|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Building GCC&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;推荐使用最新的[[GCC]]，因为它是最新和最好的版本。（译者注：这里指的是用什么编译器和源代码编译出新的‘交叉编译器’） 例如，使用GCC 4.6.3构建GCC 4.8.0交叉编译器可能会遇到麻烦。 如果你的系统编译器没有使用最新的主要GCC版本，我们建议你 [[Building GCC| 构建最新的GCC作为你的系统编译器]]。&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;推荐使用最新的[[GCC]]，因为它是最新和最好的版本。（译者注：这里指的是用什么编译器和源代码编译出新的‘交叉编译器’） 例如，使用GCC 4.6.3构建GCC 4.8.0交叉编译器可能会遇到麻烦。 如果你的系统编译器没有使用最新的主要GCC版本，我们建议你 [[Building GCC| 构建最新的GCC作为你的系统编译器]]。&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-l49&quot;&gt;第49行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第49行：&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/opt/cross&amp;lt;/tt&amp;gt; 中。 如果你想在全局安装它，则最好通常将其安装到&amp;lt;tt&amp;gt;/usr/local/cross&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/opt/cross&amp;lt;/tt&amp;gt; 中。 如果你想在全局安装它，则最好通常将其安装到&amp;lt;tt&amp;gt;/usr/local/cross&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;请注意，我们最好在源代码目录树之外构建所有内容。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;有些软件包仅支持外部构建，有些仅支持内部建筑，有些则两者兼而有之 &lt;/del&gt;(但可能无法对构建过程进行广泛的检查)。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在源目录树中构建GCC会失败得很惨，至少对于旧版本来说是如此。&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;请注意，我们最好在源代码目录树之外构建所有内容。 &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;在源代码目录树中构建GCC会失败得很惨，至少对于旧版本来说是如此。&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;===准备===&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;===准备===&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-l83&quot;&gt;第83行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第83行：&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;这将编译binutils (汇编程序，反汇编程序和其他各种有用的东西)，它们可在你的系统上运行，但以$TARGET指定的格式处理代码。&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;这将编译binutils (汇编程序，反汇编程序和其他各种有用的东西)，它们可在你的系统上运行，但以$TARGET指定的格式处理代码。&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;'''--disable-nls'''告诉binutils不要包含本机语言支持。 这基本上是可选的，但可以减少依赖性和编译时间。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这也会影响诊断结果的英文，当你提出问题时，&lt;/del&gt;[http://forum.osdev.org/ 论坛] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;上的人们会理解。&lt;/del&gt;;-) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;（译者注：没有作者Get意思）&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;'''--disable-nls'''告诉binutils不要包含本机语言支持。 这基本上是可选的，但可以减少依赖性和编译时间。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这也会影响诊断结果的英文文本，当你提出问题时，&lt;/ins&gt;[http://forum.osdev.org/ 论坛] &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;（译者注：没有Get作者意思）&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;'''--with-sysroot'''告诉binutils在交叉编译器中启用sysroot支持，方法是将其指向默认的空目录。 默认情况下，因为没有很好的技术原因，链接器拒绝使用sysroot，而GCC能够在运行时处理这两种情况。 这将在以后有用。&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;'''--with-sysroot'''告诉binutils在交叉编译器中启用sysroot支持，方法是将其指向默认的空目录。 默认情况下，因为没有很好的技术原因，链接器拒绝使用sysroot，而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;===GCC===&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;===GCC===&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;：&lt;/del&gt;''另请参阅[http://gcc.gnu.org/install/configure.html 配置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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;''另请参阅[http://gcc.gnu.org/install/configure.html 配置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;现在，你可以开始构建 [[GCC]]了。&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;现在，你可以开始构建 [[GCC]]了。&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-l118&quot;&gt;第118行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第118行：&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&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&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;我们构建[[libgcc]]，这是一个低级支持库，编译器希望它在编译时可用。 针对[[libgcc]]的链接提供整数、浮点、小数、堆栈展开(用于异常处理)和其他支持功能。 请注意，我们这里''没有''简单地运行 &amp;lt;tt&amp;gt;make &amp;amp;&amp;amp; make install&amp;lt;/tt&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;，因为这会构建太多的方式，并不是gcc的所有组件都针对你未完成的操作系统已准备好。&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;我们构建[[libgcc]]，这是一个低级支持库，编译器希望它在编译时可用。 针对[[libgcc]]的链接提供整数、浮点、小数、堆栈展开(用于异常处理)和其他支持功能。 请注意，我们这里''没有''简单地运行 &amp;lt;tt&amp;gt;make &amp;amp;&amp;amp; make install&amp;lt;/tt&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;，因为这会构建太多的方式，并不是gcc的所有组件在你未完成的操作系统上都已准备好。&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;'''--disable-nls''' 与上面的binutils相同。&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;'''--disable-nls''' 与上面的binutils相同。&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-l138&quot;&gt;第138行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第138行：&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;$HOME/opt/cross/bin/$TARGET-gcc --version&amp;lt;/source&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;$HOME/opt/cross/bin/$TARGET-gcc --version&amp;lt;/source&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;请注意，此编译器“无法”编译普通C程序。 每当你想要#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;include包含任何标准标头时，交叉编译器都会产生错误&lt;/del&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;请注意，此编译器“无法”编译普通C程序。 每当你想要#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;include包含任何标准头文件时，交叉编译器都会产生错误&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;C标准定义了两种不同的执行环境——“独立freestanding”和“托管hosted”。 虽然对于普通的应用程序程序员来说，这个定义可能相当模糊，但是当你进行操作系统开发时，它是相当清晰的： 内核执行是 “独立的”，你在用户空间中做的一切都是 “托管的”。 “独立”环境只需要提供C库的一个子集：float.h、 iso646.h、 limits.h、 stdalign.h、 stdarg.h、 stdbool.h、 stddef.h, stdint.h和stdnoreturn.h（从C11开始）。 所有这些文件都“仅仅”由typedef s和#define s 组成，因此你可以在看不到一个.c文件的情况下使用它们。&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;C标准定义了两种不同的执行环境——“独立freestanding”和“托管hosted”。 虽然对于普通的应用程序程序员来说，这个定义可能相当模糊，但是当你进行操作系统开发时，它是相当清晰的： 内核执行是 “独立的”，你在用户空间中做的一切都是 “托管的”。 “独立”环境只需要提供C库的一个子集：float.h、 iso646.h、 limits.h、 stdalign.h、 stdarg.h、 stdbool.h、 stddef.h, stdint.h和stdnoreturn.h（从C11开始）。 所有这些文件都“仅仅”由typedef s和#define s 组成，因此你可以在看不到一个.c文件的情况下使用它们。&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-l146&quot;&gt;第146行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第146行：&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;export PATH=&amp;quot;$HOME/opt/cross/bin:$PATH&amp;quot;&amp;lt;/source&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;export PATH=&amp;quot;$HOME/opt/cross/bin:$PATH&amp;quot;&amp;lt;/source&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;此命令将把新编译器添加到此shell会话的路径中。 如果你希望永久使用它，请将path命令添加到你的&amp;lt;tt&amp;gt;~/.profile&amp;lt;/tt&amp;gt;配置shell脚本或类似脚本中。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;有关更多信息，请参阅你的shell文档。&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;此命令将把新编译器添加到此shell会话的路径中。 如果你希望永久使用它，请将path命令添加到你的&amp;lt;tt&amp;gt;~/.profile&amp;lt;/tt&amp;gt;配置shell脚本或类似脚本中。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;有关更多信息，请参阅相关shell文档。&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;如果是你是从[[Bare Bones]]教程来到这里，那么现在你可以再使用新的交叉编译器来完成它，实现一个新的变体。 如果你开始是构建了一个新的GCC版本作为系统编译器，并使用它来构建出了交叉编译器，那么你现在可以安全地卸载那个系统编译器，除非你希望继续使用它。&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;如果是你是从[[Bare Bones]]教程来到这里，那么现在你可以再使用新的交叉编译器来完成它，实现一个新的变体。 如果你开始是构建了一个新的GCC版本作为系统编译器，并使用它来构建出了交叉编译器，那么你现在可以安全地卸载那个系统编译器，除非你希望继续使用它。&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-l181&quot;&gt;第181行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第181行：&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;== 更进一步 ==&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;== 更进一步 ==&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在相当长的一段时间内，使用这个简单的交叉编译器就足够了，但在某些时候，你会希望编译器自动包含你自制系统头和库。 &lt;/del&gt;为你自制操作系统构建[[OS Specific Toolchain|特定于操作系统的工具链]]&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在相当长的一段时间内，使用这个简单的交叉编译器就足够了，但在到了未来某个时候，你会希望编译器自动包含你自制系统的头文件和库。 &lt;/ins&gt;为你自制操作系统构建[[OS Specific Toolchain|特定于操作系统的工具链]]&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;== 另见 ==&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;== 另见 ==&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-l205&quot;&gt;第205行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第205行：&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;=== 预先构建的工具链 ===&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;=== 预先构建的工具链 ===&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这些都是由OSdev社区中的人根据自己的构建需求构建的，并且可以随意共享，而不保证任何支持，或者它甚至可以在你的工作直接使用。因个人而异请自行考虑使用。&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这些都是由OSdev社区中的人根据自己的构建需求构建的，并且可以随意共享，而不保证任何支持，或者它甚至可以在你的工作中直接使用。因个人而异请自行考虑使用。&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;'''Linux的最新版本(许多是ARCH的)'''&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;'''Linux的最新版本(许多是ARCH的)'''&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=GCC_Cross-Compiler&amp;diff=446&amp;oldid=prev</id>
		<title>2022年2月14日 (一) 05:43 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=446&amp;oldid=prev"/>
		<updated>2022-02-14T05:43:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;amp;diff=446&amp;amp;oldid=15&quot;&gt;显示更改&lt;/a&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=15&amp;oldid=prev</id>
		<title>Zhang3：/* 海湾合作委员会 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=15&amp;oldid=prev"/>
		<updated>2021-12-16T03:23:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;海湾合作委员会&lt;/span&gt;&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;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;2021年12月16日 (四) 03:23的版本&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-l87&quot;&gt;第87行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第87行：&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;'''--with-sysroot''' tells binutils to enable sysroot support in the cross-compiler by pointing it to a default empty directory. By default, the linker refuses to use sysroots for no good technical reason, while gcc is able to handle both cases at runtime. This will be useful later on.&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;'''--with-sysroot''' tells binutils to enable sysroot support in the cross-compiler by pointing it to a default empty directory. By default, the linker refuses to use sysroots for no good technical reason, while gcc is able to handle both cases at runtime. This will be useful later on.&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;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;=== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GCC &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;div&gt;:''See also the [http://gcc.gnu.org/install/configure.html offical instructions for configuring gcc].''&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;:''See also the [http://gcc.gnu.org/install/configure.html offical instructions for configuring 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;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=14&amp;oldid=prev</id>
		<title>Zhang3：创建页面，内容为“{{FirstPerson}} {{rating|1}} 本教程重点介绍为您自己的操作系统创建GCC交叉编译器。 我们在这里构建的编译器将有一个通用目标（i686 elf），它允许您将当前操作系统留在后面，这意味着不会使用主机操作系统的头或库。 在操作系统开发中，您“需要”一个交叉编译器，否则会发生很多意想不到的事情，因为编译器假定您的代码正在主机操作系统上运行。…”</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=GCC_Cross-Compiler&amp;diff=14&amp;oldid=prev"/>
		<updated>2021-12-16T03:23:08Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“{{FirstPerson}} {{rating|1}} 本教程重点介绍为您自己的操作系统创建GCC交叉编译器。 我们在这里构建的编译器将有一个通用目标（i686 elf），它允许您将当前操作系统留在后面，这意味着不会使用主机操作系统的头或库。 在操作系统开发中，您“需要”一个交叉编译器，否则会发生很多意想不到的事情，因为编译器假定您的代码正在主机操作系统上运行。…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FirstPerson}}&lt;br /&gt;
{{rating|1}}&lt;br /&gt;
本教程重点介绍为您自己的操作系统创建GCC交叉编译器。 我们在这里构建的编译器将有一个通用目标（i686 elf），它允许您将当前操作系统留在后面，这意味着不会使用主机操作系统的头或库。 在操作系统开发中，您“需要”一个交叉编译器，否则会发生很多意想不到的事情，因为编译器假定您的代码正在主机操作系统上运行。&lt;br /&gt;
&lt;br /&gt;
== 介绍 ==&lt;br /&gt;
&lt;br /&gt;
一般来说，交叉编译器是在平台a（“主机”）上运行，但为平台B（“目标”）生成可执行文件的编译器。这两个平台在CPU、操作系统和/或[：类别：可执行格式|可执行格式]]方面可能（但不需要）有所不同。 在我们的例子中，主机平台是您当前的操作系统，目标平台是您将要制作的操作系统。 重要的是要认识到这两个平台是不同的；您正在开发的操作系统总是与您当前使用的操作系统不同。 这就是为什么我们需要首先构建一个交叉编译器，否则您肯定会遇到麻烦。&lt;br /&gt;
&lt;br /&gt;
=== 为什么需要交叉编译器 ===&lt;br /&gt;
{{Main|Why do I need a Cross Compiler?}}&lt;br /&gt;
&lt;br /&gt;
您需要使用交叉编译器“”，除非您在自己的操作系统上开发“”。 编译器必须知道正确的目标平台（CPU、操作系统），否则您将遇到麻烦。 如果您使用系统附带的编译器，那么编译器不会知道它正在编译其他的东西。 一些教程建议使用系统编译器，并向编译器传递许多有问题的选项。 这在将来肯定会给您带来很多问题，解决方案是构建一个交叉编译器。 如果您已经尝试在不使用交叉编译器的情况下创建操作系统，请阅读文章[[为什么我需要交叉编译器？]]。&lt;br /&gt;
&lt;br /&gt;
=== 选择哪个编译器版本 ===&lt;br /&gt;
{{Main|Building GCC}}&lt;br /&gt;
&lt;br /&gt;
建议使用最新的[[GCC]]，因为它是最新和最棒的版本。 例如，如果使用GCC4.6，您可能会遇到麻烦。3构建GCC4.8。0交叉编译器。 如果您的系统编译器没有使用最新的主要GCC版本，我们建议您[[构建GCC |构建最新的GCC作为系统编译器]]。&lt;br /&gt;
&lt;br /&gt;
您也可以使用较旧的版本，因为它们通常相当好。 如果您的本地系统编译器不是太旧（至少GCC4.6.0），您可能希望省去麻烦，只需为交叉编译器选择最新的次要版本（如4.6.3，如果您的系统编译器是4.6.1）。&lt;br /&gt;
&lt;br /&gt;
您可以通过调用以下命令查看当前编译器版本：&lt;br /&gt;
&lt;br /&gt;
gcc--version&amp;lt;/source lang=“bash”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
您可以使用较旧的主要GCC版本来构建较新的主要GCC版本的交叉编译器。 例如，GCC4.7。3可能能够构建GCC4.8。0交叉编译器。 但是，如果您想在交叉编译器中使用最新和最好的GCC版本，我们建议您首先[[构建GCC |引导最新的GCC]]作为系统编译器。 使用OS X 10.7或更早版本的个人可能希望投资构建系统GCC（输出本机Mach-O），或者升级本地LLVM/Clang安装。 10.8及以上版本的用户应该从苹果开发者网站安装命令行工具，并使用Clang交叉编译GCC。&lt;br /&gt;
&lt;br /&gt;
=== 要选择哪个binutils版本 ===&lt;br /&gt;
{{Main|Cross-Compiler Successful Builds}}&lt;br /&gt;
我们建议您使用最新和最好的[[Binutils]]版本。但是，请注意，并非所有GCC和Binutils的组合都有效。如果遇到问题，请使用与所需编译器版本大致同时发布的Binutils。您可能至少需要Binutils 2.22，或者最好是最新的2.23。2释放。在当前操作系统上安装的Binutils版本并不重要。例如，您可以通过以下命令找到binutils版本：&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;ld --version&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 确定目标平台 ===&lt;br /&gt;
{{Main|Target Triplet}}&lt;br /&gt;
&lt;br /&gt;
你应该已经知道了。 如果您正在学习[[Bare Bones]]教程，则希望为&amp;lt;tt&amp;gt;i686 elf&amp;lt;/tt&amp;gt;构建交叉编译器。&lt;br /&gt;
&lt;br /&gt;
=== 关于arm none eabi gcc的注释 ===&lt;br /&gt;
apt get for Debiab/Ubuntu上有一个预构建的包gcc arm none eabi，但您不应该使用它，因为它既不包含libgcc，也不包含libgcc。也不是像stdint这样的独立C头文件。h、 &amp;lt;br&amp;gt;&lt;br /&gt;
相反，您应该使用&amp;lt;tt&amp;gt;arm none eabi&amp;lt;/tt&amp;gt;作为$TARGET自己构建它。&lt;br /&gt;
&lt;br /&gt;
== 为构建做准备 ==&lt;br /&gt;
&amp;lt;!-- Note how this section ([[Preparing GCC Build]]) is shared by [[Building GCC]] and [[GCC Cross-Compiler]]. --&amp;gt;&lt;br /&gt;
{{:Preparing GCC Build}}&lt;br /&gt;
&lt;br /&gt;
== 建造 ==&lt;br /&gt;
&lt;br /&gt;
我们构建了一个在主机上运行的工具集，可以将源代码转换为目标系统的目标文件。&lt;br /&gt;
&lt;br /&gt;
您需要决定在何处安装新编译器。 将其安装到系统目录中是危险的，也是一个非常糟糕的主意。 您还需要决定是全局安装新编译器，还是仅为您安装。 如果您只想安装它（推荐），安装到&amp;lt;tt&amp;gt;$HOME/opt/cross&amp;lt;/tt&amp;gt;通常是个好主意。 如果您想在全球范围内安装它，将其安装到&amp;lt;tt&amp;gt;/usr/local/cross&amp;lt;/tt&amp;gt;通常是个好主意。&lt;br /&gt;
&lt;br /&gt;
请注意，我们从源目录树构建所有内容，这被认为是良好的实践。 有些软件包只支持外部构建，有些软件包只支持内部构建，有些软件包两者都支持（但可能不提供make的广泛检查）。在源目录树中构建GCC失败得很惨，至少对于旧版本是如此。&lt;br /&gt;
&lt;br /&gt;
=== 准备 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PREFIX=&amp;quot;$HOME/opt/cross&amp;quot;&lt;br /&gt;
export TARGET=i686-elf&lt;br /&gt;
export PATH=&amp;quot;$PREFIX/bin:$PATH&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
我们将安装前缀添加到当前shell会话的&amp;lt;tt&amp;gt;路径中。 这确保编译器构建能够在构建新的binutil之后检测它们。&lt;br /&gt;
&lt;br /&gt;
前缀将配置构建过程，以便交叉编译器环境中的所有文件最终都位于$HOME/opt/cross中。 您可以将该前缀更改为您喜欢的任何前缀（例如，/opt/cross或$HOME/cross将是选项）。 如果您具有管理员访问权限并希望使交叉编译器工具链可供所有用户使用，则可以将其安装到/usr/local prefix中，或者如果您愿意更改系统配置，使此目录位于所有用户的搜索路径中，则可以将其安装到/usr/local/cross prefix中。从技术上讲，您甚至可以直接安装到/usr，这样您的交叉编译器将与系统编译器一起驻留，但由于以下几个原因，不建议这样做（例如，如果目标错误，可能会覆盖系统编译器，或者与系统的包管理发生冲突）。&lt;br /&gt;
&lt;br /&gt;
=== 比努蒂尔斯 ===&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
这让一些人有点困惑，他们应该通过包管理获得它，并遵循上面的说明。&lt;br /&gt;
#如果您希望将这些包构建为binutils的一部分：&lt;br /&gt;
mv isl-x.y.z binutils-x.y.z/isl&lt;br /&gt;
mv cloog-x.y.z binutils-x.y.z/cloog&lt;br /&gt;
# But reconsider: You should just get the development packages from your OS.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src&lt;br /&gt;
&lt;br /&gt;
mkdir build-binutils&lt;br /&gt;
cd build-binutils&lt;br /&gt;
../binutils-x.y.z/configure --target=$TARGET --prefix=&amp;quot;$PREFIX&amp;quot; --with-sysroot --disable-nls --disable-werror&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
这将编译binutils（汇编程序、反汇编程序和各种其他有用的东西），可以在系统上运行，但可以以$TARGET指定的格式处理代码。&lt;br /&gt;
&lt;br /&gt;
'''--disable-nls''' tells binutils not to include native language support. This is basically optional, but reduces dependencies and compile time. It will also result in English-language diagnostics, which the people on the [http://forum.osdev.org/ Forum] understand when you ask your questions. ;-)&lt;br /&gt;
&lt;br /&gt;
'''--with-sysroot''' tells binutils to enable sysroot support in the cross-compiler by pointing it to a default empty directory. By default, the linker refuses to use sysroots for no good technical reason, while gcc is able to handle both cases at runtime. This will be useful later on.&lt;br /&gt;
&lt;br /&gt;
=== 海湾合作委员会 ===&lt;br /&gt;
:''See also the [http://gcc.gnu.org/install/configure.html offical instructions for configuring gcc].''&lt;br /&gt;
&lt;br /&gt;
现在，您可以构建[[GCC]]。&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
这让一些人有点困惑，他们应该通过包管理获得它，并遵循上面的说明。&lt;br /&gt;
#如果您希望将这些包构建为gcc的一部分：&lt;br /&gt;
mv libiconv-x.y.z gcc-x.y.z/libiconv#Mac OS x用户&lt;br /&gt;
mv gmp-x.y.z gcc-x.y.z/gmp&lt;br /&gt;
mv mpfr-x.y.z gcc-x.y.z/mpfr&lt;br /&gt;
mv mpc-x.y.z gcc-x.y.z/mpc&lt;br /&gt;
mv isl-x.y.z gcc-x.y.z/isl&lt;br /&gt;
mv cloog-x.y.z gcc-x.y.z/cloog&lt;br /&gt;
#但请重新考虑：您应该从操作系统中获取开发包。&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src&lt;br /&gt;
&lt;br /&gt;
# The $PREFIX/bin dir _must_ be in the PATH. We did that above.&lt;br /&gt;
which -- $TARGET-as || echo $TARGET-as is not in the PATH&lt;br /&gt;
&lt;br /&gt;
mkdir build-gcc&lt;br /&gt;
cd build-gcc&lt;br /&gt;
../gcc-x.y.z/configure --target=$TARGET --prefix=&amp;quot;$PREFIX&amp;quot; --disable-nls --enable-languages=c,c++ --without-headers&lt;br /&gt;
make all-gcc&lt;br /&gt;
make all-target-libgcc&lt;br /&gt;
make install-gcc&lt;br /&gt;
make install-target-libgcc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We build [[libgcc]], a low-level support library that the compiler expects available at compile time. Linking against [[libgcc]] provides integer, floating point, decimal, stack unwinding (useful for exception handling) and other support functions. Note how we are ''not'' simply running &amp;lt;tt&amp;gt;make &amp;amp;&amp;amp; make install&amp;lt;/tt&amp;gt; as that would build way too much, not all components of gcc are ready to target your unfinished operating system.&lt;br /&gt;
&lt;br /&gt;
'''--disable-nls''' is the same as for binutils above.&lt;br /&gt;
&lt;br /&gt;
'''--without-headers''' tells [[GCC]] not to rely on any C library (standard or runtime) being present for the target.&lt;br /&gt;
&lt;br /&gt;
'''--enable-languages''' tells [[GCC]] not to compile all the other language frontends it supports, but only C (and optionally C++).&lt;br /&gt;
&lt;br /&gt;
It will take a while to build your cross-compiler.&lt;br /&gt;
&lt;br /&gt;
If you are building a cross compiler for x86-64, you may want to consider building Libgcc without the &amp;quot;red zone&amp;quot;: [[Libgcc_without_red_zone]]&lt;br /&gt;
&lt;br /&gt;
== 使用新编译器 ==&lt;br /&gt;
&lt;br /&gt;
现在您有了一个“裸”交叉编译器。它还没有访问C库或C运行时的权限，因此您不能使用任何标准包含或创建可运行的二进制文件。但是编译不久将要制作的内核就足够了。您的工具集驻留在$HOME/opt/cross（或您设置的&amp;lt;tt&amp;gt;$PREFIX&amp;lt;/tt&amp;gt;中）。例如，您有一个GCC可执行文件，安装为&amp;lt;tt&amp;gt;$HOME/opt/cross/bin/$TARGET GCC&amp;lt;/tt&amp;gt;，它为您的目标创建程序。&lt;br /&gt;
&lt;br /&gt;
现在，您可以通过调用以下命令来运行新编译器：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$HOME/opt/cross/bin/$TARGET-gcc --version&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
请注意此编译器如何“无法”编译普通C程序。只要你想包含任何标准头，交叉编译器就会抛出错误（除了少数几个真正独立于平台的、由编译器自己生成的头）。这是非常正确的-您还没有针对目标系统的标准库！&lt;br /&gt;
&lt;br /&gt;
C标准定义了两种不同的执行环境——“独立”和“托管”。虽然对于一般的应用程序程序员来说，这个定义可能相当模糊，但在进行操作系统开发时却非常明确：内核是“独立的”，在用户空间中所做的一切都是“托管的”。“独立”环境只需要提供C库的一个子集：float。h、 iso646。h、 限制。h、 stdalign。h、 斯塔格。h、 stdbool。h、 stddef。h、 斯特丁。h和stdnoreturn。h（从C11开始）。所有这些都由typedef s和#define s“only”组成，因此您可以在不使用单个函数的情况下实现它们。看到c文件了。&lt;br /&gt;
&lt;br /&gt;
要通过调用&amp;lt;tt&amp;gt;$TARGET gcc&amp;lt;/tt&amp;gt;使用新编译器，请通过键入以下内容将&amp;lt;tt&amp;gt;$HOME/opt/cross/bin&amp;lt;/tt&amp;gt;添加到&amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt;：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;export PATH=&amp;quot;$HOME/opt/cross/bin:$PATH&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
此命令将把新编译器添加到此shell会话的路径中。 如果希望永久使用，请将PATH命令添加到&amp;lt;tt&amp;gt;~/。配置文件&amp;lt;/tt&amp;gt;配置shell脚本或类似文件。 有关更多信息，请参阅shell文档。&lt;br /&gt;
&lt;br /&gt;
现在，您可以继续完成[[Bare Bones]]教程变体，并使用新的交叉编译器完成它。 如果您构建了一个新的GCC版本作为系统编译器，并使用它来构建交叉编译器，那么您现在可以安全地卸载它，除非您希望继续使用它。&lt;br /&gt;
&lt;br /&gt;
== 故障排除 ==&lt;br /&gt;
&lt;br /&gt;
通常，“验证”您是否仔细阅读了说明并准确键入了命令。 不要跳过说明。 如果您使用一个新的shell实例，如果您没有通过将其添加到shell概要文件中使其永久化，那么您必须再次设置PATH变量。 如果编译似乎真的搞砸了，请键入make distclean，然后重新开始make过程。 确保您的un archiever不会更改换行符。&lt;br /&gt;
&lt;br /&gt;
==== ld: cannot find -lgcc ====&lt;br /&gt;
&lt;br /&gt;
您指定要通过&amp;lt;tt&amp;gt;-lgcc&amp;lt;/tt&amp;gt;'开关将GCC低级运行库链接到可执行文件中，但忘记构建并正确安装库&amp;lt;br&amp;gt;&lt;br /&gt;
如果在安装libgcc时没有收到警告或错误，但仍然存在问题，则可以在项目中复制库并将其链接到&amp;lt;tt&amp;gt;-L.-lgcc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
libgcc位于$PREFIX/lib/gcc/$TARGET/&amp;lt;gcc version&amp;gt;/libgcc。A.&lt;br /&gt;
&lt;br /&gt;
==== Binutils 2.9 ====&lt;br /&gt;
&lt;br /&gt;
按字母顺序排列在顶部或底部的内容不一定是最新版本。 在2.9之后是2.10、2.11、2.12，然后是更多更新的版本，并且越来越有可能构建或支持您选择的GCC版本。&lt;br /&gt;
&lt;br /&gt;
==== Building GCC: 应该包含系统头的目录不存在 ====&lt;br /&gt;
&lt;br /&gt;
You might encounter this error when building &amp;lt;tt&amp;gt;mingw32&amp;lt;/tt&amp;gt; targets, for example &amp;lt;tt&amp;gt;x86_64-w64-mingw32&amp;lt;/tt&amp;gt;. The offending directory that can't be found is &amp;lt;tt&amp;gt;$SYSROOT/mingw/include&amp;lt;/tt&amp;gt;. 如果查看sysroot，您当然会意识到不存在这样的文件夹。&lt;br /&gt;
&lt;br /&gt;
The solution is simply to create the empty folders:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p $SYSROOT/mingw/include&lt;br /&gt;
mkdir -p $SYSROOT/mingw/lib&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
这将允许构建继续进行。 发生这种情况的原因是&amp;lt;tt&amp;gt;mingw32&amp;lt;/tt&amp;gt;（以及mingw本身）将&amp;lt;tt&amp;gt;包含路径和&amp;lt;tt&amp;gt;库路径配置为&amp;lt;tt&amp;gt;/mingw/INCLUDE&amp;lt;/tt&amp;gt;和&amp;lt;tt&amp;gt;/mingw/lib&amp;lt;/tt&amp;gt;，而不是默认的&amp;lt;tt&amp;gt;/usr/INCLUDE&amp;lt;/tt&amp;gt;和&amp;lt;tt&amp;gt;/usr/lib&amp;lt;/tt&amp;gt;。 我无法理解为什么即使这些文件夹中不需要任何东西，构建也会失败，为什么不只是创建它们。&lt;br /&gt;
&lt;br /&gt;
=== GCC libsanitizer未能生成 ===&lt;br /&gt;
有时GCC无法构建libsanitizer，如果发生这种情况，请在configure命令中追加&amp;lt;tt&amp;gt;--disable libsanitizer&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
这仅适用于构建托管编译器。&lt;br /&gt;
&lt;br /&gt;
== 更高级 ==&lt;br /&gt;
在相当长的一段时间内，使用这个简单的交叉编译器就足够了，但在某些时候，您会希望编译器自动包含您自己的系统头和库。为您自己的操作系统构建[[OS-Specific Toolchain | OS-Specific Toolchain]]就是一条出路。&lt;br /&gt;
&lt;br /&gt;
== 另见 ==&lt;br /&gt;
=== 文章 ===&lt;br /&gt;
*[[Cross-Compiler Successful Builds]] - combinations of GCC and Binutils which have been shown to work with this tutorial by OSDev.org members.&lt;br /&gt;
*[[Target Triplet]] - on target triplets and their use&lt;br /&gt;
*[[OS Specific Toolchain]] - going a step further and adding your own target.&lt;br /&gt;
*[[LLVM Cross-Compiler]] - some compilers make things much easier.&lt;br /&gt;
*[[Canadian Cross]] - making things yet more complicated.&lt;br /&gt;
&lt;br /&gt;
=== 外部链接 ===&lt;br /&gt;
*http://kegel.com/crosstool has a popular example of a script that automatically downloads, patches, and builds binutils, gcc, and glibc for known platforms.&lt;br /&gt;
*http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html - Summary of the support functions you get when you link with libgcc.&lt;br /&gt;
*http://forums.gentoo.org/viewtopic.php?t=66125 - Compiling Windows applications under Linux&lt;br /&gt;
*http://www.libsdl.org/extras/win32/cross/README.txt - dito&lt;br /&gt;
*https://github.com/travisg/toolchains - Another script for building simple cross compilers&lt;br /&gt;
*https://www.youtube.com/watch?v=aESwsmnA7Ec - A walkthrough of how to build a cross-compiler using Cygwin on Windows.&lt;br /&gt;
*https://github.com/Cheapskate01/Cross-Compiler-Build-Script - A dead-simple script that Binutils and Gcc for you.&lt;br /&gt;
&lt;br /&gt;
[[Category:Compilers]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[de:Cross-Compiler]]&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt Toolchains ===&lt;br /&gt;
These were built by people in the OSdev community for their own building needs and shared at will, without guaranteeing any support or that it will even work on your setup. YMMV.&lt;br /&gt;
&lt;br /&gt;
'''Latests versions for Linux (many arch)'''&lt;br /&gt;
&lt;br /&gt;
* [https://www.kernel.org/pub/tools/crosstool/ kernel.org various hosts/targets]&lt;br /&gt;
&lt;br /&gt;
'''For Linux i686 host'''&lt;br /&gt;
* [https://drive.google.com/open?id=1zcFAmxi7mtOwhMaKE36IsjLRB0uEv17p aarch64-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1uEFrOJPxy13vxWCy-5IbxCJAs5TRdtTE arm-eabi 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=13Kg6Xd8acUnwUoZQBTOjwAQQeGOeYzVz i386-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1F5RsfIEfcpRYAqu5UuGTKgkMa3eBsXnP i486-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1PdEFqMEJf_Vuf0drO1m8bjlrsudAmI5k i586-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1g9jzEIn8CB6ZiVrc0uxbZprepcX4gYex i686-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1xIeNJwD0Do-REFxzCLOkMIVYI3HGJUTX mips-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=10UuOf9LW4y9WEJcTWrMZW0GAlOWh9KG7 mips64-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1oW6UWr-OY22EgtyuXovORUtHeVLkL-Tw m64k-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1H3Cbq4D_kjROB-7Otiisa-mac_9FYUM- powerpc-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1kFGNHWhcBD9cf8X2y-BW49Su04lMa1ev sh-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1XzQDKTK35EX8b380bPRbuhX1GPKrtI77 sparc-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1pU8bS0McTyRUTHb1b_c8ZVa2Ka_XeeEp x86_64-elf 9.3.0 target]&lt;br /&gt;
* [https://drive.google.com/open?id=1cqk9RzY3QXQuaS-YdIWtCECKL81pcsv- xtensa-elf 9.3.0 target]&lt;br /&gt;
&lt;br /&gt;
'''For Linux x86_64 host'''&lt;br /&gt;
&lt;br /&gt;
* [https://drive.google.com/file/d/0Bw6lG3Ej2746STJaM2dNbC05elE/view?usp=sharing i386-elf &amp;amp; i686-elf 7.1.0 target uploaded by TheAlmostGenius]&lt;br /&gt;
&lt;br /&gt;
* [https://newos.org/toolchains/i386-elf-7.5.0-Linux-x86_64.tar.xz i386-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/x86_64-elf-7.5.0-Linux-x86_64.tar.xz x86_64-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/aarch64-elf-7.5.0-Linux-x86_64.tar.xz aarch64-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/arm-eabi-7.5.0-Linux-x86_64.tar.xz arm-eabi 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/m68k-elf-7.5.0-Linux-x86_64.tar.xz m68k-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/microblaze-elf-7.5.0-Linux-x86_64.tar.xz microblaze-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/mips-elf-7.5.0-Linux-x86_64.tar.xz mips-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/nios2-elf-7.5.0-Linux-x86_64.tar.xz nios2-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/powerpc-elf-7.5.0-Linux-x86_64.tar.xz powerpc-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/riscv32-elf-7.5.0-Linux-x86_64.tar.xz riscv32-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/riscv64-elf-7.5.0-Linux-x86_64.tar.xz riscv64-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/sh-elf-7.5.0-Linux-x86_64.tar.xz sh-elf 7.5.0 target]&lt;br /&gt;
* [https://newos.org/toolchains/sparc-elf-7.5.0-Linux-x86_64.tar.xz sparc-elf 7.5.0 target]&lt;br /&gt;
&lt;br /&gt;
The packages from phillid.tk below have been shrunk to about 10 MiB for each pair of packages (GCC &amp;amp;amp; Binutils).&lt;br /&gt;
Please note that this has been achieved by enabling only the C front-end for GCC.&lt;br /&gt;
If you're going to write your OS in any language but C or Assembly, these packages aren't for you.&lt;br /&gt;
These are actually Pacman packages, but untarring them to / and rm-ing /.MTREE and other clutter dotfiles contained in the package will work the same.&lt;br /&gt;
&lt;br /&gt;
'''For Windows host'''&lt;br /&gt;
* [https://drive.google.com/file/d/0B85K_c7mx3QjUnZuaFRPWlBIcXM/edit?usp=sharing i686-elf 4.8.2 target]&lt;br /&gt;
* [https://mega.co.nz/#F!bBxA3SKJ!TDL4i1NjaZKd4YMo9p2U7g x86_64-elf 5.1.0 target]&lt;br /&gt;
* [https://github.com/lordmilko/i686-elf-tools i686-/x86_64-elf 7.1.0 target + GDB]&lt;br /&gt;
&lt;br /&gt;
'''For Windows Subsystem for Linux (Beta) host'''&lt;br /&gt;
* [http://www.bin-os.com/i686-elf-6.1.0.tar.gz i686-elf 6.1.0 target] (extracts to a directory called &amp;quot;cross&amp;quot;, don't forget to install 'make' - I would recommend &amp;quot;apt-get install build-essential&amp;quot; to also add additional useful tools)&lt;br /&gt;
&lt;br /&gt;
'''For macOS host'''&lt;br /&gt;
&lt;br /&gt;
x86_64-elf [https://formulae.brew.sh/formula/x86_64-elf-binutils binutils] and [https://formulae.brew.sh/formula/x86_64-elf-gcc gcc] (canonical target name x86_64-pc-elf) can be installed from [https://brew.sh homebrew]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ brew install x86_64-elf-gcc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i686-elf toolchain is also [https://formulae.brew.sh/formula/i686-elf-gcc available] in homebrew.&lt;br /&gt;
&lt;br /&gt;
'''ARM prebuilt toolchains for multiple host platforms'''&lt;br /&gt;
&lt;br /&gt;
ARM provides it's own prebuilt toolchain based upon GNU utilities for development targeting ARM systems.&lt;br /&gt;
&lt;br /&gt;
* [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads GNU ARM Embedded Toolchain]&lt;br /&gt;
&lt;br /&gt;
'''Docker image'''&lt;br /&gt;
* [https://hub.docker.com/r/joshwyant/gcc-cross/ i686-elf 8.1.0 target]&lt;/div&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
</feed>