<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>

<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.rtems.org/amar">Amar Takhar</a>
<a href="https://gitlab.rtems.org/rtems/programs/gsoc/-/issues/56#note_123076">commented</a>:
</p>
<div class="md" style="position: relative; z-index: 1; color: #28272d; word-wrap: break-word;">
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 0 0 16px;" align="initial">
<a href="#contents-of-old-wiki-page-for-reference" aria-hidden="true" class="anchor" id="user-content-contents-of-old-wiki-page-for-reference" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Contents of old wiki page for reference</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">This page is intended to capture notes and information about using <a href="http://clang.llvm.org/" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">Clang</a> to compile RTEMS.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">All supporting files, patches, replacement files, etc. needed should be in <a href="https://ftp.rtems.org/pub/rtems/people/joel/clang/" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">https://ftp.rtems.org/pub/rtems/people/joel/clang/</a>. If something is missing, let Joel know.</p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#development-log" aria-hidden="true" class="anchor" id="user-content-development-log" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Development Log</h1>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#open-issues" aria-hidden="true" class="anchor" id="user-content-open-issues" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Open Issues</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">These are issues in clang for them to address:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">newlib uses pragma warning which clang does not know</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<a href="http://llvm.org/bugs/show_bug.cgi?id=10300" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">PR10300</a>.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Reported 2011-07-07 to <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/date.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/date.html</a>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">clang does not know registers used in RTEMS i386 FP context macros</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<a href="http://llvm.org/bugs/show_bug.cgi?id=10299" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">PR10299</a>.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Reported 2011-07-07 to <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/016022.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/016022.html</a>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">clang does not preprocess score/cpu/i386/cpu_asm.S the same as gcc. Generates incorrect code.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<a href="http://llvm.org/bugs/show_bug.cgi?id=10298" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">PR10298</a>.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Initially reported 2011-07-07 to <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/016019.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/016019.html</a>
</li>
</ul>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">These are issues in clang for us to address:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">clang does not know the RTEMS include paths. No immediate solution.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">clang when targeting i386-rtems needs to define <strong style="font-weight: 600; margin-top: 0;">USER_LABEL_PREFIX</strong>. Other ports probably have something similar and something like a register prefix macro.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">clang has problem to handle the "-B" option which does not search the header files under the directory include specified by option "-B".</li>
</ul>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">These are issues in newlib:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">newlib has warnings for PTHREAD_MUTEX_xxx being redefined - need to submit patch.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">newlib has warnings in rtems specific crt0.c - need to submit patch.</li>
</ul>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">There are the issues identified so far in RTEMS:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Remove dependency on -specs or change the format of -specs option from "-specs specs_file" by default to "-specs=specs_file".</li>
</ul>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#commit-history" aria-hidden="true" class="anchor" id="user-content-commit-history" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Commit History</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><strong style="font-weight: 600; margin-top: 0;">2011-07-07</strong>: Small patch to make sure <strong style="font-weight: 600;">rtems</strong> was defined was committed.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><strong style="font-weight: 600; margin-top: 0;">2011-07-01</strong>: The initial patches which add RTEMS support to clang and llvm (clang-rtems-20110629.diff and llvm-rtems-20110629.diff) were merged. This was reported in <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/015913.html" rel="nofollow noreferrer noopener" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-July/015913.html</a></p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#base-tools" aria-hidden="true" class="anchor" id="user-content-base-tools" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Base Tools</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">For now, you need the regular RTEMS toolchain installed. We are using the normal RTEMS binutils and gdb. In addition, the way I have been building requires using the CPU-rtems4.11-gcc as a helper wrapper.</p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#building-clang" aria-hidden="true" class="anchor" id="user-content-building-clang" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Building Clang</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">Check out LLVM and Clang using the instructions at <a href="http://clang.llvm.org/get_started.html#build" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">http://clang.llvm.org/get_started.html#build</a>. In my case, I started in a working directory (<em>/users/joel/llvm</em>) and checked out into <em>/users/joel/llvm/llvm</em>. After the checkout completed, I performed the following commands:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">cd /users/joel/llvm</span>
<span id="LC2" class="line" lang="plaintext">mkdir b-llvm</span>
<span id="LC3" class="line" lang="plaintext">cd b-llvm</span>
<span id="LC4" class="line" lang="plaintext">../llvm/configure --prefix=/users/joel/llvm/install</span>
<span id="LC5" class="line" lang="plaintext">make</span>
<span id="LC6" class="line" lang="plaintext">make install</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><strong style="font-weight: 600; margin-top: 0;">UPDATE (7/30/19):</strong> <em>configure</em> is no longer supported. cmake is used instead. Try the following command instead of the configure line above:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">cmake -DCMAKE_INSTALL_PREFIX=/users/joel/llvm/install -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">And then you can <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>make && make install</code>. (You should also pass -j option to make for a faster build.)</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">After this completed, I ensured that my PATH included /opt/rtems-4.11/bin and /users/joel/llvm/install/bin for subsequent builds.</p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#building-newlib-with-clang" aria-hidden="true" class="anchor" id="user-content-building-newlib-with-clang" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Building Newlib With Clang</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">I created a script file named <em style="margin-top: 0;">/users/joel/llvm/j-newlib</em> with the following contents.</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">CPU=i386</span>
<span id="LC2" class="line" lang="plaintext">../newlib-1.19.0/configure --host=${CPU}-rtems4.11 \</span>
<span id="LC3" class="line" lang="plaintext">  --prefix=/users/joel/llvm/install \</span>
<span id="LC4" class="line" lang="plaintext">  --with-newlib \</span>
<span id="LC5" class="line" lang="plaintext">  CC="clang -ccc-host-triple ${CPU}-rtems4.11 -ccc-gcc-name ${CPU}-rtems4.11-gcc" \</span>
<span id="LC6" class="line" lang="plaintext">  CC_FOR_TARGET="clang -ccc-host-triple ${CPU}-rtems4.11 -ccc-gcc-name ${CPU}-rtems4.11-gcc" \</span>
<span id="LC7" class="line" lang="plaintext">  CC_FOR_BUILD="clang " \</span>
<span id="LC8" class="line" lang="plaintext">  PONIES=true \</span>
<span id="LC9" class="line" lang="plaintext">  AR=${CPU}-rtems4.11-ar \</span>
<span id="LC10" class="line" lang="plaintext">  AS=${CPU}-rtems4.11-as >c.log 2>&1 && \</span>
<span id="LC11" class="line" lang="plaintext">make -j4 >b.log 2>&1 && \</span>
<span id="LC12" class="line" lang="plaintext">make install >i.log 2>&1 </span>
<span id="LC13" class="line" lang="plaintext"></span>
<span id="LC14" class="line" lang="plaintext">echo $?</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><strong style="font-weight: 600; margin-top: 0;">UPDATE (7/30/19):</strong> <em>-ccc-host-triple</em> is no longer supported. Replace with <em>-target</em> instead.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">newlib must be patched as appropriate for the version of RTEMS being built.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">I used the <em style="margin-top: 0;">j-newlib</em> script to build newlib as follows:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">cd /users/joel/llvm</span>
<span id="LC2" class="line" lang="plaintext">mkdir b-newlib</span>
<span id="LC3" class="line" lang="plaintext">cd b-newlib</span>
<span id="LC4" class="line" lang="plaintext">sh -x ../j-newlib</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">clang cannot build the file newlib/libc/sys/rtems/crt0.c. There is a replacement of that file on the ftp site. I am not sure if this is a clang bug, questionable code in crt0.c or a combination of the two. <strong style="font-weight: 600; margin-top: 0;">UPDATE (7/30/19):</strong> clang can now build crt0.c from newlib.</p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#building-rtems" aria-hidden="true" class="anchor" id="user-content-building-rtems" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Building RTEMS</h1>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">I have successfully built RTEMS follow the command below from a build directory parallel to your RTEMS source tree (e.g., /users/joel/b-rtems)</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">CPU=i386</span>
<span id="LC2" class="line" lang="plaintext">../rtems/configure --target=${CPU}-rtems4.11 \</span>
<span id="LC3" class="line" lang="plaintext">  --prefix=/users/joel/llvm/install \</span>
<span id="LC4" class="line" lang="plaintext">  AR=${CPU}-rtems4.11-ar \</span>
<span id="LC5" class="line" lang="plaintext">  AS=${CPU}-rtems4.11-as \</span>
<span id="LC6" class="line" lang="plaintext">  CC_FOR_BUILD="clang " \</span>
<span id="LC7" class="line" lang="plaintext">  CC_FOR_TARGET="clang -ccc-host-triple ${CPU}-rtems4.11 -ccc-gcc-name ${CPU}-rtems4.11-gcc " \</span>
<span id="LC8" class="line" lang="plaintext">  CC_FOR_HOST="clang -ccc-host-triple ${CPU}-rtems4.11 -ccc-gcc-name ${CPU}-rtems4.11-gcc " >c.log 2>&1 </span>
<span id="LC9" class="line" lang="plaintext"></span>
<span id="LC10" class="line" lang="plaintext">make RTEMS_BSP="pc386" >b.log 2>&1</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><em style="margin-top: 0;">UPDATE (7/30/19):</em> I had to provide the path to the installed newlib header files. I did this by providing a CPATH environment variable, for example</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">export CPATH=/users/joel/llvm/install/i386-rtems5/include</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">There are maybe some bugs in the rtems configure system. when attach the CC_FOR_TARGET,CC_FOR_BUILD flags to the cofigure command, it will generate some config.status inside which will add CC="cross compiler" to every subdir,but some subdir do not expect this CC, like in dir i386-rtems4.11/c/pc386/lib/libbsp/i386/pc386/tools. It contains some host code compiled by host compiler which should be auto detected, if you add CC="cross compiler" it will failed, So if you encounter this error you need delete the CC="cross compiler" command in the file i386-rtems4.11/c/pc386/lib/libbsp/i386/pc386/config.status for tools.</p>
<h1 dir="auto" style="font-size: 1.75em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 24px 0 16px;" align="initial">
<a href="#references" aria-hidden="true" class="anchor" id="user-content-references" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>References</h1>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;"><a href="http://clang.llvm.org/" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">Clang Page</a></li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;"><a href="https://www.studentrobotics.org/trac/wiki/Beagleboard_DSP/Building" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">TIC6x+Newlib Toolchain Build Instructions</a></li>
</ul>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">

<br>
<a href="https://gitlab.rtems.org/rtems/programs/gsoc/-/issues/56#note_123076">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/7acdf71d66a17280c0d0894df9606d1c/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/programs/gsoc/-/issues/56#note_123076"}}</script>


</p>
</div>
</body>
</html>