手機 - F(x)tec Pro1 - Sailfish OS - 解決Undefined reference to bcmp問題



參考資訊:
https://patchwork.kernel.org/project/linux-kbuild/patch/20190312215203.27643-1-natechancellor@gmail.com/

添加如下程式到lib/string.c

#ifdef __HAVE_ARCH_MEMCMP
int bcmp(const void *cs, const void *ct, size_t n)
{
       return memcmp(cs, ct, n);
}
EXPORT_SYMBOL(bcmp);
#else
/**
 * memcmp - Compare two areas of memory
 * @cs: One area of memory
 * @ct: Another area of memory
 * @count: The size of the area.
 */
#undef memcmp
__visible int memcmp(const void *cs, const void *ct, size_t count)
{
	const unsigned char *su1, *su2;
	int res = 0;

	for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
		if ((res = *su1 - *su2) != 0)
			break;
	return res;
}
EXPORT_SYMBOL(memcmp);
#endif