Hello Werner Zeh, Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/38638
to review the following change.
Change subject: cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros ......................................................................
cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros
In glibc feature control macros, _DEFAULT_SOURCE is the shorthand to tell glibc to enable "all the default stuff", meaning POSIX, BSD and Systen V interfaces. However, this macro is somewhat recent and older glibc versions (e.g. 2.12) are still occasionally in use that don't recognize it yet. For the benefits of users with these versions, let's also enable the deprecated _BSD_SOURCE and _SVID_SOURCE macros which essentially achieve the same thing. We must continue to define _DEFAULT_SOURCE so that newer glibc versions don't throw a deprecation warning.
This patch should make BSD-style byteswap macros like le32toh() available on these older glibc versions.
Change-Id: I019bbcf738a1bcdccd7b299bdde29cd4d4ded134 Signed-off-by: Julius Werner jwerner@chromium.org --- M util/cbfstool/Makefile.inc 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/38638/1
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index d8ad959..356b295 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -109,6 +109,7 @@ TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings TOOLCFLAGS += -O2 TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h +TOOLCPPFLAGS += -D_BSD_SOURCE -D_SVID_SOURCE # _DEFAULT_SOURCE for older glibc TOOLCPPFLAGS += -D_XOPEN_SOURCE=700 # strdup() from string.h TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap TOOLCPPFLAGS += -I$(top)/util/cbfstool
Hello Werner Zeh, Martin Roth, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38638
to look at the new patch set (#2).
Change subject: cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros ......................................................................
cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros
In glibc feature control macros, _DEFAULT_SOURCE is the shorthand to tell glibc to enable "all the default stuff", meaning POSIX, BSD and System V interfaces. However, this macro is somewhat recent and older glibc versions (e.g. 2.12) are still occasionally in use that don't recognize it yet. For the benefits of users with these versions, let's also enable the deprecated _BSD_SOURCE and _SVID_SOURCE macros which essentially achieve the same thing. We must continue to define _DEFAULT_SOURCE so that newer glibc versions don't throw a deprecation warning.
This patch should make BSD-style byteswap macros like le32toh() available on these older glibc versions.
Change-Id: I019bbcf738a1bcdccd7b299bdde29cd4d4ded134 Signed-off-by: Julius Werner jwerner@chromium.org --- M util/cbfstool/Makefile.inc 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/38638/2
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38638 )
Change subject: cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros ......................................................................
Patch Set 2: Code-Review+2
Thanks for working it out Julius. cbfstool is now able to compile without errors on my system with glibc 2.12.
Julius Werner has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38638 )
Change subject: cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros ......................................................................
cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros
In glibc feature control macros, _DEFAULT_SOURCE is the shorthand to tell glibc to enable "all the default stuff", meaning POSIX, BSD and System V interfaces. However, this macro is somewhat recent and older glibc versions (e.g. 2.12) are still occasionally in use that don't recognize it yet. For the benefits of users with these versions, let's also enable the deprecated _BSD_SOURCE and _SVID_SOURCE macros which essentially achieve the same thing. We must continue to define _DEFAULT_SOURCE so that newer glibc versions don't throw a deprecation warning.
This patch should make BSD-style byteswap macros like le32toh() available on these older glibc versions.
Change-Id: I019bbcf738a1bcdccd7b299bdde29cd4d4ded134 Signed-off-by: Julius Werner jwerner@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/38638 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Werner Zeh werner.zeh@siemens.com --- M util/cbfstool/Makefile.inc 1 file changed, 1 insertion(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Werner Zeh: Looks good to me, approved
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index d8ad959..356b295 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -109,6 +109,7 @@ TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings TOOLCFLAGS += -O2 TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h +TOOLCPPFLAGS += -D_BSD_SOURCE -D_SVID_SOURCE # _DEFAULT_SOURCE for older glibc TOOLCPPFLAGS += -D_XOPEN_SOURCE=700 # strdup() from string.h TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap TOOLCPPFLAGS += -I$(top)/util/cbfstool
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38638 )
Change subject: cbfstool: Set deprecated _BSD_SOURCE and _SVID_SOURCE macros ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/369 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/368 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/367
Please note: This test is under development and might not be accurate at all!