Re: Building RTEMS 6 toolchain on a Mac
Hello Heinz, you are probably one of the first persons building GCC 12 on this platform. I checked in a change which could fix the problem. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 1/2] sb: %if checks are numeric if the left and right values are numbers
From: Chris Johns - If the left and right values are numbers make the check numeric. Update #4631 --- source-builder/sb/config.py | 59 ++--- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 5bc96e2..e79c9c3 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -68,6 +68,13 @@ def _check_nil(value): istrue = False return istrue +def _check_number(value): +try: +float(value) +return True +except ValueError: +return False + class package: def __init__(self, name, arch, config): @@ -996,37 +1003,27 @@ class file: ifls = (' '.join(ifls[:op_pos]), op, ' '.join(ifls[op_pos + 1:])) break if len(ifls) != 3: - self._error('malformed if: ' + reduce(add, ls, '')) -if ifls[1] == '==': -if ifls[0] == ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '!=' or ifls[1] == '=!': -if ifls[0] != ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '>': -if ifls[0] > ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '>=' or ifls[1] == '=>': -if ifls[0] >= ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '<=' or ifls[1] == '=<': -if ifls[0] <= ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '<': -if ifls[0] < ifls[2]: -istrue = True -else: -istrue = False +self._error('malformed if: ' + reduce(add, ls, '')) +lhs = ifls[0] +operator = ifls[1] +rhs = ifls[2] +if _check_number(lhs) and _check_number(rhs): +log.trace('config: %s: %3d: _if: numeric value check' % \ + (self.name, self.lc)) +lhs = float(lhs) +rhs = float(rhs) +if operator == '==': +istrue = lhs == rhs +elif operator == '!=' or operator == '=!': +istrue = lhs != rhs +elif operator == '>': +istrue = lhs > rhs +elif operator == '>=' or operator == '=>': +istrue = lhs >= rhs +elif operator == '<=' or operator == '=<': +istrue = lhs <= rhs +elif operator == '<': +istrue = lhs < rhs else: self._error('invalid %if operator: ' + reduce(add, ls, '')) -- 2.24.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 2/2] gdb: Split python's version into major/minor and check for embed option
From: Chris Johns Closes #4631 --- source-builder/config/gdb-common-1.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg index c7f3955..e685445 100644 --- a/source-builder/config/gdb-common-1.cfg +++ b/source-builder/config/gdb-common-1.cfg @@ -81,6 +81,8 @@ %define gdb-python-config %(command -v %{gdb-enable-python}-config || true) %endif %define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev) +%define gdb-python-ver-major %(echo "%{gdb-python-ver-mm}" | sed -e 's/\..*//') +%define gdb-python-ver-minor %(echo "%{gdb-python-ver-mm}" | sed -e 's/.*\.//') %define gdb-python-header Python.h %define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header} %define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.* @@ -109,7 +111,7 @@ %endif %if %{gdb-python-config} != %{nil} %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;ihttp://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] GDB: fix python config command line arguments based on python version
On 22/4/22 11:18 pm, Frank Kühndel wrote: > Hi Chris, > > On 4/22/22 03:19, Chris Johns wrote: >> On 21/4/2022 5:45 pm, Karel Gardas wrote: >>> On 4/21/22 02:12, Chris Johns wrote: On 21/4/2022 4:38 am, Karel Gardas wrote: > Chris, Frank, > > I don't feel particularly comfortable with this patch. It works here on > Ubuntu > 20.04 with python 3.3 and Ubuntu 22.04 with Python 3.10, but I have to > admit > semantics of this cfg language is beyond my liking and a lot is in > complete > darkness here. E.g. how &&, < operator are working here. Delete both int > conversions and it'll not work at all. Keep one and it'll work well. > The problem is probably lack of time to go thorough all the docs on > docs.rtems.org to find relevant bits while working on the patch. > > Anyway, if you have time, please review and test on your platforms. I think you are right to be concerned. I cannot find in the parser any support for `int()` which makes me wonder if `int(3)` is being compared but I am not sure. >>> Hmm. And I've thought cfg format is just DSL interpreted in python hence >>> translated internally to python hence my int() usage. >>> Leave this with me and I will take a closer look. >>> Absolutely! >>> I think we will need to add a numerical compare. Hmmm. >>> Another solution may be to enhance version string to print every number >>> with two >>> digits and with leading zero if needed and concatenate string together. >>> This may >>> probably work too even with lexi comparison. >>> E.g. >>> >>> 2.7.1 -> "020701" >>> 2.7.17 -> "020717" >>> 3.9.2 -> "030902" >>> 3.10.3 -> "031003" >>> >>> Hard to judge which approach is cleanest one. >> This breaks when we exceed 99 etc. Maybe that will happen, maybe it will not. > >> I wonder if hacking the parser to handle this provides a more long term >> solution >> beyond this use case. >> >> The problem becomes adding support to the language. I wonder if checking if >> both >> the left and right hand sides in a compare are numeric, ie 3 or 3.0, and if >> they >> are make the comparison numeric? To force a lexicographical comparison simply >> have `%if x%{yyy} < 3.8`? > > Do not exists simpler solutions than changing the language? The language is not changing, rather the ability to check numbers is supported and I think that is a good change. > For example, calling `/usr/bin/python3-config --help` first. If the > result string contains `--embed` use it, else don't. > > For example on OpenSUSE (Python 3.6.15): > > $ /usr/bin/python3-config --help > Usage: /usr/bin/python3-config > --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir > > On Fedora 35 (Python 3.10.4): > > $ /usr/bin/python3-config --help > Usage: /usr/bin/python3.10-x86_64-config > --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed > > Again OpenSUSE but Python 2.7.18: > > $ /usr/bin/python2-config --help > Usage: /usr/bin/python2-config > [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help] > > For example, the following command will either return "--embed" or empty > (the redirection of strerr is important for Python 2): > > $ /usr/bin/python3-config --help 2>1 | grep --fixed-strings > --only-matching -e --embed Yes we could do this but I think the change I have posted is still good to have. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/2] gdb: Split python's version into major/minor and check for embed option
Hi Chris, I tested your two patches for ARM on top of 990e3f05e62cf48117f6de8346e9ea8a8d9b1ba3 (Git master rtems-source-builder, RTEMS 6) on the following OS: * openSUSE Leap 15.3 Python 2.7.18 * openSUSE Leap 15.3 Python 3.6.15 * Ubuntu 22.04 LTS Python 3.10.4 * AlmaLinux 8.5 (Arctic Sphynx) Python 3.6.8 * Debian GNU/Linux 11 (bullseye) Python 3.9.2 * Fedora Linux 35 (Container Image) Python 3.10.4 Everything worked fine. But inspecting the code, I wonder about this line: %if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 What if the Python version would be 2.9? (No, I do not I believe that I will ever see Python 2.8 or 2.9.) Many thanks for your efforts fk This is the output from the RSB log on Fedora: config: source-builder/config/gdb-common-1.cfg: 114:>%if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 [True] config: source-builder/config/gdb-common-1.cfg: 114: _if[1]: ['3', '<=', '3', ' &&', '10', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: AND found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: next OP found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('3', '<=', '3') True none True config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: joining: and config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('10', '<', '8') False and False config: source-builder/config/gdb-common-1.cfg: 114: _ifs[2]: dir=None 3 ['10', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 115: %define gdb-python-config-lib-check-flags --ldflags [False] config: source-builder/config/gdb-common-1.cfg: 116: %else [False] config: source-builder/config/gdb-common-1.cfg: 117:>%define gdb-python-config-lib-check-flags --ldflags --embed [True] config: source-builder/config/gdb-common-1.cfg: 118:>%endif [True] config: source-builder/config/gdb-common-1.cfg: 118: _ifs[2]: %endif: dir=None %endif True [] config: source-builder/config/gdb-common-1.cfg: 118: _if[1]: [] config: source-builder/config/gdb-common-1.cfg: 119:>%define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter}) [True] exe: shell: /usr/bin/python3-config --ldflags --embed | awk 'BEGIN{FS=" "}/python/{for(i=1;i%if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 [True] config: source-builder/config/gdb-common-1.cfg: 114: _if[1]: ['3', '<=', '3', '&&', '6', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: AND found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: next OP found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('3', '<=', '3') True none True config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: joining: and config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('6', '<', '8') True and True config: source-builder/config/gdb-common-1.cfg: 114: _ifs[2]: dir=None 3 ['6', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 115:>%define gdb-python-config-lib-check-flags --ldflags [True] config: source-builder/config/gdb-common-1.cfg: 116:>%else [True] config: source-builder/config/gdb-common-1.cfg: 117: %define gdb-python-config-lib-check-flags --ldflags --embed [False] config: source-builder/config/gdb-common-1.cfg: 118: %endif [False] config: source-builder/config/gdb-common-1.cfg: 118: _ifs[2]: %endif: dir=None %endif False [] config: source-builder/config/gdb-common-1.cfg: 118: _if[1]: [] config: source-builder/config/gdb-common-1.cfg: 119:>%define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter}) [True] exe: shell: /usr/bin/python3-config --ldflags | awk 'BEGIN{FS=" "}/python/{for(i=1;i%if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 [True] config: source-builder/config/gdb-common-1.cfg: 114: _if[1]: ['2', '<=', '3', '&&', '7', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: AND found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: next OP found at 3 config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('2', '<=', '3') True none True config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: joining: and config: source-builder/config/gdb-common-1.cfg: 114: _if: numeric value check config: source-builder/config/gdb-common-1.cfg: 114: _if[2]: ('7', '<', '8') True and True config: source-builder/config/gdb-common-1.cfg: 114: _ifs[2]: dir=None 3 ['7', '<', '8'] config: source-builder/config/gdb-common-1.cfg: 115:>%define gdb-python-config-lib-check-
rtems_rpc_task_init, where?
Hallo, with the new network stack, rtems_rpc_task_init no longer exists. What must/could be called/initialized instead? Danke, Heinz ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/2] gdb: Split python's version into major/minor and check for embed option
On 26/4/2022 4:01 am, Frank Kühndel wrote: > I tested your two patches for ARM on top of > 990e3f05e62cf48117f6de8346e9ea8a8d9b1ba3 (Git master > rtems-source-builder, RTEMS 6) on the following OS: > > * openSUSE Leap 15.3 Python 2.7.18 > * openSUSE Leap 15.3 Python 3.6.15 > * Ubuntu 22.04 LTS Python 3.10.4 > * AlmaLinux 8.5 (Arctic Sphynx) Python 3.6.8 > * Debian GNU/Linux 11 (bullseye) Python 3.9.2 > * Fedora Linux 35 (Container Image) Python 3.10.4 > > Everything worked fine. Thank you for the testing, it is appreciated. > But inspecting the code, I wonder about this line: > > %if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 > > What if the Python version would be 2.9? (No, I do not I believe that I > will ever see Python 2.8 or 2.9.) Oh yes nice catch. I suppose this is needed: %if %{gdb-python-ver-major} < 3 || \ %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8 ? I will give this a test and if it looks ok I will push the patch with this change. Thanks Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2 01/15] mptests: Manually adding file headers and licenses
On 23/4/2022 5:12 am, Ryan Long wrote: > These files had no file header, copyright, or license. Based on git > history, added appropriate copyrights and licenses. Looks good. Thanks Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: rtems_rpc_task_init, where?
On 26/4/2022 4:54 am, Heinz Junkes wrote: > Hallo, > > with the new network stack, rtems_rpc_task_init no longer exists. > > What must/could be called/initialized instead? There is no call. The user land NFS RPC negotiation is handled in the mount call and the NFSv4 client is a kernel land implementation and directly handles the RPC side of things. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 1/2] sb: %if checks are numeric if the left and right values are numbers
From: Chris Johns - If the left and right values are numbers make the check numeric. Update #4631 --- source-builder/sb/config.py | 69 +++-- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 5bc96e2..ad078d9 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -68,6 +68,13 @@ def _check_nil(value): istrue = False return istrue +def _check_number(value): +try: +float(value) +return True +except ValueError: +return False + class package: def __init__(self, name, arch, config): @@ -915,6 +922,12 @@ class file: (self.name, self.lc, self.if_depth, join_op)) +# If OR and the previous check was true short circuit the evaluation +if join_op == 'or' and cistrue: +log.trace('config: %s: %3d: _if[%i]: OR true, short circuit eval' % \ + (self.name, self.lc, + self.if_depth)) +break ori = 0 andi = 0 i = len(cls) @@ -935,10 +948,8 @@ class file: i = andi elif andi == 0: i = ori -elif ori < andi: -i = andi else: -i = andi +i = min(ori, andi) log.trace('config: %s: %3d: _if[%i]: next OP found at %i' % \ (self.name, self.lc, self.if_depth, @@ -996,37 +1007,27 @@ class file: ifls = (' '.join(ifls[:op_pos]), op, ' '.join(ifls[op_pos + 1:])) break if len(ifls) != 3: - self._error('malformed if: ' + reduce(add, ls, '')) -if ifls[1] == '==': -if ifls[0] == ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '!=' or ifls[1] == '=!': -if ifls[0] != ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '>': -if ifls[0] > ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '>=' or ifls[1] == '=>': -if ifls[0] >= ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '<=' or ifls[1] == '=<': -if ifls[0] <= ifls[2]: -istrue = True -else: -istrue = False -elif ifls[1] == '<': -if ifls[0] < ifls[2]: -istrue = True -else: -istrue = False +self._error('malformed if: ' + reduce(add, ls, '')) +lhs = ifls[0] +operator = ifls[1] +rhs = ifls[2] +if _check_number(lhs) and _check_number(rhs): +log.trace('config: %s: %3d: _if: numeric value check' % \ + (self.name, self.lc)) +lhs = float(lhs) +rhs = float(rhs) +if operator == '==': +istrue = lhs == rhs +elif operator == '!=' or operator == '=!': +istrue = lhs != rhs +elif operator == '>': +istrue = lhs > rhs +elif operator == '>=' or operator == '=>': +istrue = lhs >= rhs +elif operator == '<=' or operator == '=<': +istrue = lhs <= rhs +elif operator == '<': +istrue = lhs < rhs else: self._error('invalid %if operator: ' + reduce(add, ls, '')) -- 2.24.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 2/2] gdb: Split python's version into major/minor and check for embed option
From: Chris Johns Closes #4631 --- source-builder/config/gdb-common-1.cfg | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg index c7f3955..68eb0f3 100644 --- a/source-builder/config/gdb-common-1.cfg +++ b/source-builder/config/gdb-common-1.cfg @@ -81,6 +81,8 @@ %define gdb-python-config %(command -v %{gdb-enable-python}-config || true) %endif %define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev) +%define gdb-python-ver-major %(echo "%{gdb-python-ver-mm}" | sed -e 's/\..*//') +%define gdb-python-ver-minor %(echo "%{gdb-python-ver-mm}" | sed -e 's/.*\.//') %define gdb-python-header Python.h %define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header} %define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.* @@ -109,7 +111,8 @@ %endif %if %{gdb-python-config} != %{nil} %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;ihttp://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/2] gdb: Split python's version into major/minor and check for embed option
On 26/4/2022 8:04 am, Chris Johns wrote: > On 26/4/2022 4:01 am, Frank Kühndel wrote: >> I tested your two patches for ARM on top of >> 990e3f05e62cf48117f6de8346e9ea8a8d9b1ba3 (Git master >> rtems-source-builder, RTEMS 6) on the following OS: >> >> * openSUSE Leap 15.3 Python 2.7.18 >> * openSUSE Leap 15.3 Python 3.6.15 >> * Ubuntu 22.04 LTS Python 3.10.4 >> * AlmaLinux 8.5 (Arctic Sphynx) Python 3.6.8 >> * Debian GNU/Linux 11 (bullseye) Python 3.9.2 >> * Fedora Linux 35 (Container Image) Python 3.10.4 >> >> Everything worked fine. > > Thank you for the testing, it is appreciated. > >> But inspecting the code, I wonder about this line: >> >> %if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8 >> >> What if the Python version would be 2.9? (No, I do not I believe that I >> will ever see Python 2.8 or 2.9.) > > Oh yes nice catch. I suppose this is needed: > > %if %{gdb-python-ver-major} < 3 || \ > %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8 > > ? > > I will give this a test and if it looks ok I will push the patch with this > change. I ended up posting v2 because I needed to update the compound if statement logic. There is no precedence ability, just left to right and the logic short circuits if true when an OR is seen. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel