Hi Dave, all,
With the addition of shared library ABI versioning in current dev
branch, we become more strict in the addition of any new symbols.
This is a very quick intro on how to go about it. For chapter and
verse refer to http://www.akkadia.org/drepper/dsohowto.pdf - it's
well worth reading. It covers the visibility("hidden") attribute
that we've started using in places too.
So, Dave's builds are not working after merging...
<brolley> I'm getting build problems since pulling in the latest
<brolley> for example:
<brolley> === pminfo ===
<brolley> gcc -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all
-D_FORTIFY_SOURCE=2 -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.8.9\"
-I../../src/include -I../../src/include/pcp -c -o pminfo.o pminfo.c
<brolley> gcc -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all
-D_FORTIFY_SOURCE=2 -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.8.9\"
-I../../src/include -I../../src/include/pcp -o pminfo -Wall
-L../../src/libpcp/src -L../../src/libpcp_pmda/src pminfo.o -lpcp
<brolley> pminfo.o: In function `main':
<brolley> /home/brolley/pcp/pcpfans/brolley/dev/src/pminfo/pminfo.c:775:
undefined reference to `pmDiscoverServices'
<brolley> It's as if it's finding an old libpcp or something
<nathans> that symbol doesnt exist in dev branch
<nathans> right?
<brolley> It does in mine :-)
<nathans> your merge musta stamped on it - ohhh
<nathans> hah, you will need to export that & version the abi appropriately
The reason is that unless a symbol is explicitly listed in the DSO
version-script file now, and associated with some ABI version, its
not going to be exported. The patch below should show the sort of
changes that will be needed for this case... (though we'd ideally
have some real code there and the real API - this is just a primer)
diff --git a/src/include/pcp/pmapi.h b/src/include/pcp/pmapi.h
index ff3e724..892d5f1 100644
--- a/src/include/pcp/pmapi.h
+++ b/src/include/pcp/pmapi.h
@@ -659,6 +659,8 @@ extern int pmUnpackEventRecords(pmValueSet *, int, pmResult
***);
/* Free set of pmResults from pmUnpackEventRecords */
extern void pmFreeEventResult(pmResult **);
+extern int pmDiscoverServices(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/libpcp/src/auxserver.c b/src/libpcp/src/auxserver.c
index afff419..884028b 100644
--- a/src/libpcp/src/auxserver.c
+++ b/src/libpcp/src/auxserver.c
@@ -835,3 +835,9 @@ __pmServerUnadvertisePresence(__pmServerPresence *s)
}
#endif /* !HAVE_SERVICE_DISCOVERY */
+
+int
+pmDiscoverServices(void)
+{
+ return -EOPNOTSUPP;
+}
diff --git a/src/libpcp/src/exports b/src/libpcp/src/exports
index e2b40cf..91b9f4c 100644
--- a/src/libpcp/src/exports
+++ b/src/libpcp/src/exports
@@ -398,3 +398,8 @@ PCP_3.0 {
local: *;
};
+
+PCP_3.1 {
+ global:
+ pmDiscoverServices;
+} PCP_3.0;
This is true for all the shared libraries we have, with the exception of
DSO PMDAs. For that case, the build restricts the set of symbols using
an anonymous version script, and only the PMDA init routine is exported.
This process is automated in the build (assuming the correct macros have
been used in the makefiles, which all do now - e.g. see PMDAINIT in the
sample PMDA makefile).
cheers.
--
Nathan
|