summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2019-08-27 16:32:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-08-28 13:47:41 +0200
commit29974c5147a21bd9744183136c88147731c14b49 (patch)
tree2a035f130922985985fa9d626ac740050c5c66f2
parentbc195edea16dc6eec7d50a1d9862afe3aa93eb75 (diff)
downloadbarebox-29974c5147a21bd9744183136c88147731c14b49.tar.gz
barebox-29974c5147a21bd9744183136c88147731c14b49.tar.xz
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 <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/sandbox/Makefile3
1 files changed, 2 insertions, 1 deletions
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