Skip to content

Conversation

@statham-arm
Copy link
Collaborator

This allows picolibc tests to mark themselves as "skipped" by returning the special exit code 77. Previously that didn't work in an FVP test run, so those tests are marked as failed rather than skipped.

In particular, test-sprintf-percent-n was affected, because we build picolibc in a mode that doesn't support printf("%n"), and that test knew it and was trying to return "skipped".

Background: Fast Models does support the SYS_EXIT_EXTENDED semihosting request, which allows specifying an exit status. But it doesn't support the ":semihosting-features" pseudo-file that advertises support for non-default semihosting features including that one. So picolibc wrongly believes that SYS_EXIT_EXTENDED doesn't work, and doesn't try it.

This commit works around that lack of support by simply creating a real file called ":semihosting-features" in the directory where the model will run. Then picolibc does find it, and learns from it that it's allowed to SYS_EXIT_EXTENDED.

This makes test-sprintf-percent-n stop failing. It also means we can remove the semihost-exit-extended test from the list of tests specially disabled on FVP runs, because now it works.

This allows picolibc tests to mark themselves as "skipped" by
returning the special exit code 77. Previously that didn't work in an
FVP test run, so those tests are marked as failed rather than skipped.

In particular, test-sprintf-percent-n was affected, because we build
picolibc in a mode that doesn't support printf("%n"), and that test
knew it and was trying to return "skipped".

Background: Fast Models does support the SYS_EXIT_EXTENDED semihosting
request, which allows specifying an exit status. But it doesn't
support the ":semihosting-features" pseudo-file that advertises
support for non-default semihosting features including that one. So
picolibc wrongly believes that SYS_EXIT_EXTENDED doesn't work, and
doesn't try it.

This commit works around that lack of support by simply creating a
_real_ file called ":semihosting-features" in the directory where the
model will run. Then picolibc does find it, and learns from it that
it's allowed to SYS_EXIT_EXTENDED.

This makes test-sprintf-percent-n stop failing. It also means we can
remove the semihost-exit-extended test from the list of tests
specially disabled on FVP runs, because now it works.
@statham-arm statham-arm requested a review from dcandler November 25, 2024 12:56
@statham-arm statham-arm merged commit 327f60c into ARM-software:main Nov 25, 2024
1 check passed
@statham-arm statham-arm deleted the fvp-semihosting-features branch November 25, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants