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.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to