From: David van Moolenbroek Date: Mon, 24 Aug 2015 13:59:23 +0000 (+0200) Subject: DS: workaround for weak symbol issue X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/tasks/static/gitweb.js?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F3163%2F1;p=minix.git 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 --- 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