Attached is proposed patch for Makefile.am and configure.ac so I will be
able to push cpg_iteration implementation and we will able to increase
cpg lib version independently on other libs.
Regards,
Honza
Steven Dake wrote:
> On Thu, 2009-08-20 at 15:53 +0200, Fabio M. Di Nitto wrote:
>> On Thu, 2009-08-20 at 15:18 +0200, Jan Friesse wrote:
>>> Fabio,
>>> when will libtool happened? I would like to have this feature + tool in
>>> Corosync 1.1.0.
>> I don't know. I think Jim started on this conversion. If necessary I can
>> take it over but it won't happen overnight.
>>
>>> Is attached patch good solution of problem?
>> Unfortunately no because it will bump the soname for all libraries.
>> That's why we need a more fine graded control over them with libtools.
>>
>> Fabio
>>
>
> cpg_iteration functionality is not gating on libtool. Honza, please
> sort out a way to have finer version number control for the cpg library.
>
> Regards
> -steve
>
>>> Regards,
>>> Honza
>>>
>>> Fabio M. Di Nitto napsal(a):
>>>> On Wed, 2009-08-19 at 21:57 -0700, Steven Dake wrote:
>>>>> On Thu, 2009-08-20 at 06:39 +0200, Fabio M. Di Nitto wrote:
>>>>>> This change the API and ABI for cpg.
>>>>>>
>>>>>> Before this change can go anywhere, it needs proper Makefile.am love or
>>>>>> even easier queue it after libtool changes that makes slightly easier to
>>>>>> have per library API and ABI versioning.
>>>>>>
>>>>>> Let's try, as a general rule, to avoid the same nightmare we had between
>>>>>> whitetank and current status with hidden API/ABI changes.
>>>>>>
>>>>>> Fabio
>>>>>>
>>>>> The addition of API calls are allowed in Y releases, and those additions
>>>>> don't result in a soname bump.
>>>> I am not discussing if they are allowed or not. I know they are allowed.
>>>>
>>>>>>>> diff --git a/trunk/include/corosync/ipc_cpg.h
>>>>>>>> b/trunk/include/corosync/ipc_cpg.h
>>>>>>>> index 1d240d4..7df1891 100644
>>>>>>>> --- a/trunk/include/corosync/ipc_cpg.h
>>>>>>>> +++ b/trunk/include/corosync/ipc_cpg.h
>>>>>>>> @@ -45,6 +45,9 @@ enum req_cpg_types {
>>>>>>>> MESSAGE_REQ_CPG_MCAST = 2,
>>>>>>>> MESSAGE_REQ_CPG_MEMBERSHIP = 3,
>>>>>>>> MESSAGE_REQ_CPG_LOCAL_GET = 4,
>>>>>>>> + MESSAGE_REQ_CPG_ITERATIONINITIALIZE = 5,
>>>>>>>> + MESSAGE_REQ_CPG_ITERATIONNEXT = 6,
>>>>>>>> + MESSAGE_REQ_CPG_ITERATIONFINALIZE = 7
>>>>>>>> };
>>>>>>>>
>>>>>>>> enum res_cpg_types {
>>>>>>>> @@ -56,7 +59,10 @@ enum res_cpg_types {
>>>>>>>> MESSAGE_RES_CPG_DELIVER_CALLBACK = 5,
>>>>>>>> MESSAGE_RES_CPG_FLOW_CONTROL_STATE_SET = 6,
>>>>>>>> MESSAGE_RES_CPG_LOCAL_GET = 7,
>>>>>>>> - MESSAGE_RES_CPG_FLOWCONTROL_CALLBACK = 8
>>>>>>>> + MESSAGE_RES_CPG_FLOWCONTROL_CALLBACK = 8,
>>>>>>>> + MESSAGE_RES_CPG_ITERATIONINITIALIZE = 9,
>>>>>>>> + MESSAGE_RES_CPG_ITERATIONNEXT = 10,
>>>>>>>> + MESSAGE_RES_CPG_ITERATIONFINALIZE = 11,
>>>>>>>> };
>>>>
>>>> ^^^ this is the problem.
>>>>
>>>> You are changing the internal API/ABI of the library towards the
>>>> executive/service.
>>>>
>>>> Unless you want to make sure that those values are totally optional,
>>>> then you need to bump the soname to make sure executive version that
>>>> handles those values is correctly linked against the correct version of
>>>> the library.
>>>>
>>>> See for example here:
>>>>
>>>> http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
>>>>
>>>> ==== copy/paste ====
>>>>
>>>> When a new version of a library is binary-incompatible with the old one
>>>> the soname needs to change. In C, there are four basic reasons that a
>>>> library would cease to be binary compatible:
>>>>
>>>> 1. The behavior of a function changes so that it no longer meets
>>>> its original specification,
>>>>
>>>> 2. Exported data items change (exception: adding optional items to
>>>> the ends of structures is okay, as long as those structures are
>>>> only allocated within the library).
>>>>
>>>> 3. An exported function is removed.
>>>>
>>>> 4. The interface of an exported function changes.
>>>>
>>>>
>>>> If you can avoid these reasons, you can keep your libraries
>>>> binary-compatible. Said another way, you can keep your Application
>>>> Binary Interface (ABI) compatible if you avoid such changes. For
>>>> example, you might want to add new functions but not delete the old
>>>> ones. You can add items to structures but only if you can make sure that
>>>> old programs won't be sensitive to such changes by adding items only to
>>>> the end of the structure, only allowing the library (and not the
>>>> application) to allocate the structure, making the extra items optional
>>>> (or having the library fill them in), and so on. Watch out - you
>>>> probably can't expand structures if users are using them in arrays.
>>>>
>>>> ==== copy/paste ====
>>>>
>>>> By adding entries to the ipc, you are breaking ABI unless you are 100%
>>>> sure that an old version of cpg.lcrso will work just fine with the new
>>>> library and viceversa.
>>>>
>>>> Fabio
>>>>
>
commit 4bba4159429432acd0a26b1c792ae55b34fe8bba
Author: Jan Friesse <[email protected]>
Date: Thu Aug 27 17:07:51 2009 +0200
Support for independent cpg library version
diff --git a/trunk/configure.ac b/trunk/configure.ac
index 6d82a4a..a7e55ec 100644
--- a/trunk/configure.ac
+++ b/trunk/configure.ac
@@ -164,6 +164,9 @@ SOMAJOR="4"
SOMINOR="0"
SOMICRO="0"
SONAME="${SOMAJOR}.${SOMINOR}.${SOMICRO}"
+# Special for libcpg
+CPG_SOMICRO="1"
+CPG_SONAME="${SOMAJOR}.${SOMINOR}.${CPG_SOMICRO}"
# local options
AC_ARG_ENABLE([ansi],
@@ -375,6 +378,7 @@ AC_SUBST([SOMAJOR])
AC_SUBST([SOMINOR])
AC_SUBST([SOMICRO])
AC_SUBST([SONAME])
+AC_SUBST([CPG_SONAME])
AC_SUBST([OS_DYFLAGS])
@@ -420,6 +424,7 @@ AC_MSG_RESULT([ Features
=${PACKAGE_FEATURES}])
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE build info:])
AC_MSG_RESULT([ Library SONAME = ${SONAME}])
+AC_MSG_RESULT([ CPG Library SONAME = ${CPG_SONAME}])
AC_MSG_RESULT([ Default optimization = ${OPT_CFLAGS}])
AC_MSG_RESULT([ Default debug options = ${GDB_CFLAGS}])
AC_MSG_RESULT([ Extra compiler warnings = ${EXTRA_WARNING}])
diff --git a/trunk/lib/Makefile.am b/trunk/lib/Makefile.am
index 31e8664..164aa07 100644
--- a/trunk/lib/Makefile.am
+++ b/trunk/lib/Makefile.am
@@ -40,7 +40,7 @@ INCLUDES = -I$(top_builddir)/include
-I$(top_srcdir)/include
lib_LIBRARIES = libcpg.a libconfdb.a libevs.a libcfg.a libquorum.a \
libvotequorum.a libpload.a libcoroipcc.a
-SHARED_LIBS = $(lib_LIBRARIES:%.a=%.so.$(SONAME))
+SHARED_LIBS = $(filter-out libcpg.so.$(SONAME),
$(lib_LIBRARIES:%.a=%.so.$(SONAME))) libcpg.so.$(CPG_SONAME)
SHARED_LIBS_SO = $(lib_LIBRARIES:%.a=%.so)
SHARED_LIBS_SO_TWO = $(lib_LIBRARIES:%.a=%.so.$(SOMAJOR))
@@ -75,6 +75,11 @@ libconfdb.so.$(SONAME): confdb.o sa-confdb.o
libcoroipcc.so.$(SONAME)
ln -sf libconfdb.so.$(SONAME) libconfdb.so
ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)
+libcpg.so.$(CPG_SONAME): cpg.o libcoroipcc.so.$(SONAME)
+ $(CC) $(DARWIN_OPTS) $^ -o $@
+ ln -sf $@ libcpg.so
+ ln -sf $@ libcpg.so.$(SOMAJOR)
+
lib%.so.$(SONAME): %.o libcoroipcc.so.$(SONAME)
$(CC) $(DARWIN_OPTS) $^ -o $@
ln -sf lib$*.so.$(SONAME) lib$*.so
@@ -95,6 +100,11 @@ libconfdb.so.$(SONAME): confdb.o sa-confdb.o
libcoroipcc.so.$(SONAME)
ln -sf libconfdb.so.$(SONAME) libconfdb.so
ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)
+libcpg.so.$(CPG_SONAME): cpg.o libcoroipcc.so.$(SONAME)
+ $(LD) $(SOLARIS_OPTS) -G $^ -o $@
+ ln -sf $@ libcpg.so
+ ln -sf $@ libcpg.so.$(SOMAJOR)
+
lib%.so.$(SONAME): %.o libcoroipcc.so.$(SONAME)
$(LD) $(SOLARIS_OPTS) -G $^ -o $@
ln -sf lib$*.so.$(SONAME) lib$*.so
@@ -118,6 +128,14 @@ libconfdb.so.$(SONAME): confdb.o sa-confdb.o
../lcr/lcr_ifact.o libcoroipcc.so.$
ln -sf libconfdb.so.$(SONAME) libconfdb.so
ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)
+libcpg.so.$(CPG_SONAME): cpg.o libcoroipcc.so.$(SONAME)
+ $(CC) -shared -o $@ \
+ -Wl,-soname=libcpg.so.$(SOMAJOR) \
+ -Wl,-version-script=$(srcdir)/libcpg.versions \
+ $^ $(LDFLAGS) $(AM_LDFLAGS)
+ ln -sf $@ libcpg.so
+ ln -sf $@ libcpg.so.$(SOMAJOR)
+
lib%.so.$(SONAME): %.o libcoroipcc.so.$(SONAME)
$(CC) -shared -o $@ \
-Wl,-soname=lib$*.so.$(SOMAJOR) \
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais