From 29974c5147a21bd9744183136c88147731c14b49 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 27 Aug 2019 16:32:37 +0200 Subject: sandbox: compile with symbol -fvisibility=hidden barebox defines many symbols that are reserved for the C implementation. This collides with the libc, when building barebox for ARCH=sandbox. Specify -fvsibility-hidden, so libraries barebox is linked against don't inadvertently use barebox' functions. This fixes a heap corruption occurring when issuing fb0.enable=1 on my system, because X11 used strdup out of barebox, but free out of glibc[1]: binding file /lib/x86_64-linux-gnu/libX11.so.6 [0] to ./barebox [0]: normal symbol l `strdup' [GLIBC_2.2.5] [...] binding file /lib/x86_64-linux-gnu/libc.so.6 [0] to /lib/x86_64-linux-gnu/libc.so.6 [0]: normal symbol `free' [GLIBC_2.2.5] [1]: cf. CFLAGS +=-Dfree=barebox_free in arch/sandbox/Makefile Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/sandbox/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index 2a75b81cf6..780783a1e0 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -1,6 +1,7 @@ KBUILD_DEFCONFIG := sandbox_defconfig -CPPFLAGS += -D__SANDBOX__ -fno-strict-aliasing +CPPFLAGS += -D__SANDBOX__ -fno-strict-aliasing -fvisibility=hidden + machine-y := sandbox -- cgit v1.2.3