Matt Thompson | 19 May 2011 21:52
Favicon

32 bit build with external libprotobuf_c

Hi,

I was compiling libnmsg on a 32 bit linux system with an external
libprotobuf_c and it seems that the m4 macro checks of the structure
sizes are hardcoded for a 64 bit system.

>From autoconf/check_libprotobuf-c_sizeof.m4:

if test "$use_internal_libprotobuf_c" != "true"; then
    AC_CHECK_SIZEOF(ProtobufCMessageDescriptor,, [[#include
<google/protobuf-c/protobuf-c.h>]])
    AC_CHECK_SIZEOF(ProtobufCFieldDescriptor,,   [[#include
<google/protobuf-c/protobuf-c.h>]])
    AC_CHECK_SIZEOF(ProtobufCEnumDescriptor,,    [[#include
<google/protobuf-c/protobuf-c.h>]])

    if test "$ac_cv_sizeof_ProtobufCEnumDescriptor" != "120"; then
        AC_MSG_FAILURE([sizeof(ProtobufCEnumDescriptor) != 120])
    fi

    if test "$ac_cv_sizeof_ProtobufCFieldDescriptor" != "72"; then
        AC_MSG_FAILURE([sizeof(ProtobufCFieldDescriptor) != 72])
    fi

    if test "$ac_cv_sizeof_ProtobufCMessageDescriptor" != "120"; then
        AC_MSG_FAILURE([sizeof(ProtobufCMessageDescriptor) != 120])
    fi
fi

On a 32 bit system the structure sizes are:
(Continue reading)

Robert Edmonds | 19 May 2011 22:03

Re: 32 bit build with external libprotobuf_c

Matt Thompson wrote:
> I was compiling libnmsg on a 32 bit linux system with an external
> libprotobuf_c and it seems that the m4 macro checks of the structure
> sizes are hardcoded for a 64 bit system.

yes, they are.  it's a rather crude check to make sure that the
protobuf-c structs haven't changed, as the nmsg msgmod ABI
(NMSG_MSGMOD_VERSION in msgmod_plugin.h) embeds structures created by
the protobuf-c compiler.

i am thinking these checks should actually be disabled by default.

--

-- 
Robert Edmonds
edmonds <at> isc.org

Gmane