From 23369f9c9e51a427959543e926525e7a0bee525e Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Mon, 24 Aug 2015 15:59:23 +0200 Subject: [PATCH] DS: workaround for weak symbol issue The bitcode file given to the instrumentation pass does not include certain weak symbols, in particular regcomp and regfree, which are required to be visible to the magic pass for state transfer to work correctly. This patch forces DS to make the calls using their actual symbol names (with leading underscore), thus resolving the issue, but this issue should really be solved in a cleaner and more generic way. Change-Id: Iebee4341cc30ddabcf7593afb5c49d41c0839863 --- minix/servers/ds/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/minix/servers/ds/Makefile b/minix/servers/ds/Makefile index 6619f5448..649611c18 100644 --- a/minix/servers/ds/Makefile +++ b/minix/servers/ds/Makefile @@ -5,4 +5,11 @@ SRCS= main.c store.c DPADD+= ${LIBSYS} LDADD+= -lsys +# FIXME: workaround for the linker pass not seeing weak symbols. The +# following symbols are essential for magic instrumentation, since they +# perform memory de/allocation. For some reason, their weak versions are +# not picked up by the linker in the first (instrumentation) pass. With +# these definitions we force the first pass to include them. +CPPFLAGS.store.c+= -Dregcomp=_regcomp -Dregfree=_regfree + .include -- 2.44.0