Attention is currently required from: Thomas Heijligen, Anastasia Klimchuk.
Hello Felix Singer, build bot (Jenkins), Thomas Heijligen, Angel Pons, Peter Marheine,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/68433
to look at the new patch set (#7).
Change subject: tests: Add prefix to io_mock functions not to clash with macros
......................................................................
tests: Add prefix to io_mock functions not to clash with macros
Flashrom I/O mock functions need to be renamed so that they do not
have name clash with standard I/O, because the latter are allowed
to be macros. Adding a prefix to flashrom mock functions avoids
them being accidentally expanded. Standard I/O functions are
expanded and flashrom mocks stay as they are.
BUG=b:237606255
TEST=ninja test
1) gcc 12.2.0 on Debian
2) clang 15.0 on Chromium OS
Ticket: https://ticket.coreboot.org/issues/411
Change-Id: I7998a8fb1b9e65621e12adbfab5460a245d5606b
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M tests/chip.c
M tests/io_mock.c
M tests/io_mock.h
M tests/linux_mtd.c
M tests/linux_spi.c
M tests/parade_lspcon.c
M tests/realtek_mst_i2c_spi.c
M tests/tests.c
8 files changed, 65 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/33/68433/7
--
To view, visit https://review.coreboot.org/c/flashrom/+/68433
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7998a8fb1b9e65621e12adbfab5460a245d5606b
Gerrit-Change-Number: 68433
Gerrit-PatchSet: 7
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/68432 )
(
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: tests: Undefine _FORTIFY_SOURCE for unit tests to avoid _chk variants
......................................................................
tests: Undefine _FORTIFY_SOURCE for unit tests to avoid _chk variants
The option _FORTIFY_SOURCE, when enabled, can result in some functions
being expanded into _chk variants. For example, `fprintf` can get
expanded into `__fprintf_chk`. This makes sense for building a real
binary, but is not needed for unit tests.
In unit test environment all those functions are wrapped. In the
example above, both `fprintf` and `__fprintf_chk` needed to be mocked.
Disabling _FORTIFY_SOURCE avoids expanding functions into _chk
variants, without any loss of testing coverage because that would
be wrapped/mocked anyway.
This patch also removes two existing _chk wraps because they are not
needed anymore.
BUG=b:237606255
TEST=ninja test on
1) gcc 12.2.0 on Debian
2) clang 15.0 on Chromium OS
Ticket: https://ticket.coreboot.org/issues/411
Change-Id: I70cb1cd90d1f377ff4606acad3c1b514120ae4f7
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68432
Reviewed-by: Peter Marheine <pmarheine(a)chromium.org>
Reviewed-by: Felix Singer <felixsinger(a)posteo.net>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M tests/meson.build
M tests/tests.c
2 files changed, 35 insertions(+), 18 deletions(-)
Approvals:
build bot (Jenkins): Verified
Felix Singer: Looks good to me, approved
Peter Marheine: Looks good to me, but someone else must approve
diff --git a/tests/meson.build b/tests/meson.build
index b0375a1..66adb92 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -69,9 +69,7 @@
'-Wl,--wrap=fsync',
'-Wl,--wrap=fread',
'-Wl,--wrap=fgets',
- '-Wl,--wrap=__fgets_chk',
'-Wl,--wrap=fprintf',
- '-Wl,--wrap=__vfprintf_chk',
'-Wl,--wrap=fclose',
'-Wl,--wrap=feof',
'-Wl,--wrap=ferror',
@@ -115,6 +113,7 @@
cargs,
'-ffunction-sections',
'-fdata-sections',
+ '-U_FORTIFY_SOURCE',
],
export_dynamic : true,
link_args : mocks,
diff --git a/tests/tests.c b/tests/tests.c
index 53bad65..77cb1ef 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -222,14 +222,6 @@
return NULL;
}
-char *__wrap___fgets_chk(char *buf, int len, FILE *fp)
-{
- LOG_ME;
- if (get_io() && get_io()->fgets)
- return get_io()->fgets(get_io()->state, buf, len, fp);
- return NULL;
-}
-
size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *fp)
{
LOG_ME;
@@ -282,14 +274,6 @@
return 0;
}
-int __wrap___vfprintf_chk(FILE *fp, const char *fmt, va_list args)
-{
- LOG_ME;
- if (get_io() && get_io()->fprintf)
- return get_io()->fprintf(get_io()->state, fp, fmt, args);
- return 0;
-}
-
int __wrap_fclose(FILE *fp)
{
LOG_ME;
--
To view, visit https://review.coreboot.org/c/flashrom/+/68432
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I70cb1cd90d1f377ff4606acad3c1b514120ae4f7
Gerrit-Change-Number: 68432
Gerrit-PatchSet: 7
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67473 )
Change subject: flashrom.c: Plumb 'all_skipped' global state into func param
......................................................................
Patch Set 6:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/67473/comment/9c57f221_124f07e3
PS1, Line 12: Change-Id: Ic7990b0afebd49d2a27e89b03638b64e36c329df
: Signed-off-by: Aarya Chaumal <aarya.chaumal(a)gmail.com>
keep these:
```
Change-Id: I2346c869c47b48604360b0facf9313aae086c8dd
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
```
and use `git commit --amend --author=Edward O'Callaghan <quasisec(a)google.com>"`. You can use `Co-Author: ` if it is more than a trivial rebase too.
--
To view, visit https://review.coreboot.org/c/flashrom/+/67473
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic7990b0afebd49d2a27e89b03638b64e36c329df
Gerrit-Change-Number: 67473
Gerrit-PatchSet: 6
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Mon, 07 Nov 2022 00:46:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/68963 )
Change subject: programmer: Drop dead fallback_map() boilerplate
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS1:
> Needs rebase
done.
--
To view, visit https://review.coreboot.org/c/flashrom/+/68963
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibb7760f807fae040416cef2797a7dbf6572f7df9
Gerrit-Change-Number: 68963
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Mon, 07 Nov 2022 00:41:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69133 )
Change subject: tree/: Convert flashchip erase_block func ptr to enumerate
......................................................................
Patch Set 5:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/69133/comment/c3c4e5ea_8ceb8630
PS4, Line 7: [ALT]
> We can go with these if it's OK with you.
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/69133
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I02ae7e4c67c5bf34ec2fd7ffe4af8a2aba6fd5e5
Gerrit-Change-Number: 69133
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sun, 06 Nov 2022 22:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment