commonlib: Add GCD function

Implement a simple GCD function.

BUG=b:307790895
TEST=emerge-geralt coreboot
TEST=make tests/commonlib/bsd/gcd-test

Change-Id: I21819cda4299b3809b8ca7a95cbdc6a87e4b3481
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78798
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/commonlib/Makefile.inc b/src/commonlib/Makefile.inc
index 86e8c56..70e731d 100644
--- a/src/commonlib/Makefile.inc
+++ b/src/commonlib/Makefile.inc
@@ -58,3 +58,6 @@
 romstage-y += bsd/elog.c
 ramstage-y += bsd/elog.c
 smm-y += bsd/elog.c
+
+decompressor-y += bsd/gcd.c
+all-y += bsd/gcd.c