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
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 <minix.service.mk>