RTEMS Source Builder | Draft: rtems/config/tools: Add checks to stdcxx.py install script (!48)

Suraj Kumar (@the.m3chanic) gitlab at rtems.org
Tue Aug 20 04:24:30 UTC 2024




Suraj  Kumar commented: https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/48#note_111338


Another method could be to place something like this instead: 

```diff
- %define rsb_rtems_gcc_version %( %{_bindir}/%{_target}-gcc --version | head -1 | awk '{print $3}' )
+ %define rsb_rtems_gcc_version %( \
+  if [ -x %{_bindir}/%{_target}-gcc ]; then \
+    %{_bindir}/%{_target}-gcc --version | head -1 | awk '{print $3}'; \
+  else \
+    echo "'@RSB_GCC_VERSION@'"; \
+  fi \
+)
```

This way, even if things go wrong (which they should not, since by the 2nd time this script is included from `gcc-common-1.cfg`, GCC will have been built), we can add a check within `stdcxx-template.py` like such: 

```python
if gcc_version == "@RSB_GCC_VERSION@":
    # something went wrong when building with GCC
    gdb.execute("return")
```

I think this might be a clean approach. Please let me know your thoughts

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/48#note_111338
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240820/81e4c524/attachment.htm>


More information about the bugs mailing list