Nico Huber 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 4:
Patch Set 4:
What's the purpose of this? It would be cleaner to seperate code into two files, one for ramstage and one for romstage (and one combined, if that exists) instead.
The purpose is to have rom/ramstage code in a common compilation unit in `qemu-i440fx/fw_cfg.c`. See top of this branch. If you split that, you need an API between the compilation units (I'm not sure if the current API in `fw_cfg.h` suffices). It seemed like a little much overhead so I advised Thomas to remove the guard from the declarations.
Please have a look at the comments here: https://review.coreboot.org/c/coreboot/+/30844/1/src/include/string.h#56 Would you prefer the explicit error message over the linker error? Both point to a problem with strdup(), but the explicit message might protect people from trying to fix it :)
Now that I think about it, the current error (undeclared strdup()) might cause the most irritation, because that might look like something to fix for somebody less experienced with coreboot.