Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30844 )
Change subject: string.h: allow to compile strdup in romstage ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/30844/1/src/include/string.h File src/include/string.h:
https://review.coreboot.org/#/c/30844/1/src/include/string.h@56 PS1, Line 56: { You can put a
#if !defined(__PRE_RAM__) dead_code("Cannot strdup() in pre-RAM environments") #endif
here, then you'll guarantee with a link-time assertion that calls to this will get optimized out. (I guess the undefined reference to malloc would do the same, but this makes the intent more explicit.)