RTEMS Tools | Provide an RTEMS STD C++ script in Python (#5)

Suraj Kumar (@the.m3chanic) gitlab at rtems.org
Mon Jul 8 22:20:47 UTC 2024




Suraj  Kumar commented on a discussion: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/issues/5#note_108894


@chris  Thank you, I have gotten a better understanding of things from your comments. 

1. I was thinking of having it in the `src/rsb/source-builder/sb` directory along with where the other Python files seem to be situated. I was wondering if something like `../sb/stdcxx.py` would work or if there is an OS-independent form of resolving this relative path? 
2. Sure, fixed (Although, if it is already defined, is there anything stopping us from using that macro instead?)
3. Fixed 
4. Okay, this made the idea a lot clearer to me, I have implemented it in my code. 
5. Noted, fixed
6. Noted, thanks

Here are my updated modifications to `gcc-common-1.cfg`: 

### To get the current GCC Version for the target

```
%define stdcxx_script stdcxx-template.py
%define gcc_install_dir %{build_dir}/$SB_BUILD_ROOT/bin
%define rtems_gcc_version %(%{gcc_install_dir}/%{_target}-%{rtems_version}-gcc --version | head -1 | awk '{print $3}')
%define stdcxx_template_path ${build_top}/../sb/%{stdcxx_script}
```

 

### To modify existing stdcxx.py template 

```
cat %{stdcxx_template_path} | sed "s/@RSB_GCC_VERSION@/%{rtems_gcc_version}/g" > %{build_dir}/$SB_BUILD_ROOT/share/gdb/python/rtems/stdcxx.py
```

I hope this resolves the standing issues with the original version

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/issues/5#note_108894
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/20240708/18e96503/attachment-0001.htm>


More information about the bugs mailing list