<!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 class="details" style="font-style: italic; color: #737278;">
<a href="https://gitlab.rtems.org/gedare">Gedare Bloom</a> created an issue: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5281">#5281</a>
</p>
<div class="md" style="position: relative; z-index: 1; color: #28272d; word-wrap: break-word;">
<h2 dir="auto" style="font-size: 1.5em; 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="#summary" aria-hidden="true" class="anchor" id="user-content-summary" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Summary</h2>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">When building the GR740 BSP with <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;'>RTEMS_MULTIPROCESSING</code> set to <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>true</code> , the build will fail.</p>
<h2 dir="auto" style="font-size: 1.5em; 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="#steps-to-reproduce" aria-hidden="true" class="anchor" id="user-content-steps-to-reproduce" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Steps to reproduce</h2>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">The INI file contents are:</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;">[DEFAULT]</span>
<span id="LC2" class="line" lang="plaintext">RTEMS_POSIX_API = True</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">[sparc/gr740_mp]</span>
<span id="LC5" class="line" lang="plaintext">INHERIT=gr740</span>
<span id="LC6" class="line" lang="plaintext">RTEMS_MULTIPROCESSING=True</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">I configure the Waf system with:</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial"><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;'>./waf configure --prefix=$RTEMS_PREFIX --rtems-config=gr740.ini</code></p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">And then <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;'>./waf</code> to build the BSP. I get the following output:</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;">Waf: Entering directory `/scratch/matteo/rtems-build/src/rtems-6.1/build'</span>
<span id="LC2" class="line" lang="plaintext">Waf: Leaving directory `/scratch/matteo/rtems-build/src/rtems-6.1/build'</span>
<span id="LC3" class="line" lang="plaintext">'build' finished successfully (0.081s)</span>
<span id="LC4" class="line" lang="plaintext">Waf: Entering directory `/scratch/matteo/rtems-build/src/rtems-6.1/build/sparc/gr740_mp'</span>
<span id="LC5" class="line" lang="plaintext">[ 167/1641] Compiling bsps/sparc/leon3/clock/ckinit.c</span>
<span id="LC6" class="line" lang="plaintext">In file included from ../../../bsps/sparc/leon3/clock/ckinit.c:46:</span>
<span id="LC7" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/ckinit.c: In function 'leon3_clock_initialize':</span>
<span id="LC8" class="line" lang="plaintext">../../../bsps/sparc/leon3/include/bsp/leon3.h:221:5: error: 'leon3_timer_core_index' undeclared (first use in this function); did you mean 'leon3_timecounter'?</span>
<span id="LC9" class="line" lang="plaintext"> 221 | ( leon3_timer_core_index != 0 ? 0 : 2 * LEON3_Cpu_Index )</span>
<span id="LC10" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC11" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/ckinit.c:181:36: note: in expansion of macro 'LEON3_CLOCK_INDEX'</span>
<span id="LC12" class="line" lang="plaintext"> 181 | timer = &LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX];</span>
<span id="LC13" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~</span>
<span id="LC14" class="line" lang="plaintext">../../../bsps/sparc/leon3/include/bsp/leon3.h:221:5: note: each undeclared identifier is reported only once for each function it appears in</span>
<span id="LC15" class="line" lang="plaintext"> 221 | ( leon3_timer_core_index != 0 ? 0 : 2 * LEON3_Cpu_Index )</span>
<span id="LC16" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC17" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/ckinit.c:181:36: note: in expansion of macro 'LEON3_CLOCK_INDEX'</span>
<span id="LC18" class="line" lang="plaintext"> 181 | timer = &LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX];</span>
<span id="LC19" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~</span>
<span id="LC20" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/../../../shared/dev/clock/clockimpl.h: In function '_Clock_Initialize':</span>
<span id="LC21" class="line" lang="plaintext">../../../bsps/sparc/leon3/include/bsp/leon3.h:221:5: error: 'leon3_timer_core_index' undeclared (first use in this function); did you mean 'leon3_timecounter'?</span>
<span id="LC22" class="line" lang="plaintext"> 221 | ( leon3_timer_core_index != 0 ? 0 : 2 * LEON3_Cpu_Index )</span>
<span id="LC23" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC24" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/ckinit.c:137:49: note: in expansion of macro 'LEON3_CLOCK_INDEX'</span>
<span id="LC25" class="line" lang="plaintext"> 137 | #define Adjust_clkirq_for_node() do { clkirq += LEON3_CLOCK_INDEX; } while(0)</span>
<span id="LC26" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~</span>
<span id="LC27" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/ckinit.c:145:7: note: in expansion of macro 'Adjust_clkirq_for_node'</span>
<span id="LC28" class="line" lang="plaintext"> 145 | Adjust_clkirq_for_node(); \</span>
<span id="LC29" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC30" class="line" lang="plaintext">../../../bsps/sparc/leon3/clock/../../../shared/dev/clock/clockimpl.h:249:3: note: in expansion of macro 'Clock_driver_support_find_timer'</span>
<span id="LC31" class="line" lang="plaintext"> 249 | Clock_driver_support_find_timer();</span>
<span id="LC32" class="line" lang="plaintext"> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC33" class="line" lang="plaintext"></span>
<span id="LC34" class="line" lang="plaintext">Waf: Leaving directory `/scratch/matteo/rtems-build/src/rtems-6.1/build/sparc/gr740_mp'</span>
<span id="LC35" class="line" lang="plaintext">Build failed</span>
<span id="LC36" class="line" lang="plaintext"> -> task in '/bsps/sparc/leon3/obj' failed with exit status 1 (run with -v to display more information)</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<h2 dir="auto" style="font-size: 1.5em; 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="#expected-behaviour" aria-hidden="true" class="anchor" id="user-content-expected-behaviour" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Expected behaviour</h2>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">Build should complete successfully.</p>
<h2 dir="auto" style="font-size: 1.5em; 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="#possible-fix" aria-hidden="true" class="anchor" id="user-content-possible-fix" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Possible fix</h2>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">From my own investigation this comes from <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;'>bsps/sparc/leon3/include/bsp/leon3.h</code> . <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>leon3_timer_core_index</code> is only declared if <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>LEON3_GPTIMER_BASE</code> is not defined but later in the file the <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>LEON3_CLOCK_INDEX</code> macro is defined in the following way:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="c" class="code highlight js-syntax-highlight language-c" 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="c" style="margin-top: 0;"><span class="cm" style="margin-top: 0;">/**</span></span>
<span id="LC2" class="line" lang="c"><span class="cm" style="margin-top: 0;"> * @brief This constant defines the index of the GPTIMER timer used by the</span></span>
<span id="LC3" class="line" lang="c"><span class="cm" style="margin-top: 0;"> * clock driver.</span></span>
<span id="LC4" class="line" lang="c"><span class="cm" style="margin-top: 0;"> */</span></span>
<span id="LC5" class="line" lang="c"><span class="cp" style="margin-top: 0;">#if defined(RTEMS_MULTIPROCESSING)</span></span>
<span id="LC6" class="line" lang="c"><span class="cp" style="margin-top: 0;">#define LEON3_CLOCK_INDEX \</span></span>
<span id="LC7" class="line" lang="c"><span class="cp" style="margin-top: 0;"> ( leon3_timer_core_index != 0 ? 0 : 2 * LEON3_Cpu_Index )</span></span>
<span id="LC8" class="line" lang="c"><span class="cp" style="margin-top: 0;">#else</span></span>
<span id="LC9" class="line" lang="c"><span class="cp" style="margin-top: 0;">#define LEON3_CLOCK_INDEX 0</span></span>
<span id="LC10" class="line" lang="c"><span class="cp" style="margin-top: 0;">#endif</span></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">So when <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;'>RTEMS_MULTIPROCESSING</code> is used the <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>LEON3_CLOCK_INDEX</code> will expand to use the <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;'>leon3_timer_core_index</code> variable which won't be declared as the GPTIMER base is defined for the GR740 BSP.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">I don't fully understand why the <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;'>LEON3_CLOCK_INDEX</code> macro is defined this way but changing it's define conditional to:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="c" class="code highlight js-syntax-highlight language-c" 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="c" style="margin-top: 0;"><span class="cp" style="margin-top: 0;">#if defined(RTEMS_MULTIPROCESSING) && !defined(LEON3_GPTIMER_BASE)</span></span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0;" align="initial">Will make the BSP build successfully, I haven't had the time to test this fix, it might break something else at runtime.</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5281">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/abcd94f0605c4944618d442f34899ae5/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/rtos/rtems/-/issues/5281"}}</script>
</p>
</div>
</body>
</html>