tests: Support linking with system libc

This patch allows for linking selected files with system libc. This
allows for creating libraries interacting with filesystem, standard I/O
and other parts of system. Until now it was only possible using CMocka
proxy functions or functions not masked by code under test.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I652362ba61a25e974d706357fc36479ccee763e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70108
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jan Dabros <jsd@semihalf.com>
diff --git a/tests/Makefile.inc b/tests/Makefile.inc
index 90f01d1..530c3c6 100644
--- a/tests/Makefile.inc
+++ b/tests/Makefile.inc
@@ -51,6 +51,8 @@
 $(foreach test, $(alltests), \
 	$(eval $(test)-srcobjs := $(addprefix $(testobj)/$(test)/, \
 		$(patsubst %.c,%.o,$(filter src/%,$($(test)-srcs))))) \
+	$(eval $(test)-sysobjs := $(addprefix $(testobj)/$(test)/, \
+		$(patsubst %.c,%.o,$($(test)-syssrcs)))) \
 	$(eval $(test)-objs := $(addprefix $(testobj)/$(test)/, \
 		$(patsubst %.c,%.o,$($(test)-srcs)))))
 $(foreach test, $(alltests), \