[PATCH 4/6] sandbox: compile with symbol -fvisibility=hidden

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 arch/sandbox/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 2a75b81cf632..780783a1e08c 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
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux