Skip to content
Commit a27ab5f3 authored by Marek Behún's avatar Marek Behún Committed by Tom Rini
Browse files

string: make memcpy() visible to fix LTO linking errors



It seems that sometimes (happening on ARM64, for example with
turris_mox_defconfig) GCC, when linking with LTO, changes the name of
lib/string.c's memcpy() function to memcpy.isra.0.

This is a problem however when GCC for a code such as this:
	struct some_struct *info = get_some_struct();
	struct some struct tmpinfo;
	tmpinfo = *info;
emits a call to memcpy() by builtin behaviour, to copy *info to tmpinfo.

This then results in the following linking error:
  .../lz4.c:93: undefined reference to `memcpy'
  .../uuid.c:206: more undefined references to `memcpy' follow

Make memcpy() visible by using the __visible macro to avoid this error.

Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
parent c3a3f374
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment