RPM Community Forums

Mailing List Message of <rpm-users>

RPM5 on FreeBSD: hto* functions

From: Miller, Vincent (Rick) <vmiller@verisign.com>
Date: Thu 23 Jun 2011 - 20:24:40 CEST
Message-ID: <CA28FD27.2D93%vmiller@verisign.com>
Hi,

I'm compiling RPM 5.3.11 on FreeBSD 8.2-RELEASE and encountered an error that is more fundamental than previous errors.  dbconvert.c  makes calls to various hto*() functions, which are not defined in FreeBSD's libc.

When compiling dbconvert.c, the compiler throws an error indicating that htobe32 and htole32 are undefined symbols (see below).

dbconvert.o(.text+0x894):/home/vmiller/rpm-5.3.11/tools/dbconvert.c:184: undefined reference to `htobe32'
dbconvert.o(.text+0x8a9):/home/vmiller/rpm-5.3.11/tools/dbconvert.c:176: undefined reference to `htole32'
dbconvert.o(.text+0x8cb):/home/vmiller/rpm-5.3.11/tools/dbconvert.c:176: undefined reference to `htole32'

A site (http://www.man-online.org/page/3-htobe32)  explained that including sys/endian.h would be necessary.  I modified the tools/dbconvert.c to add #include <sys/endian.h>.  It resolved the initial errors, but produced another indicating bswap32 was an undefined symbol.  However, sys/endian.h does define bswap32.

Why is the compiler unable to reference the bswap32 definition in sys/endian.h?  Is there a way to force this or is this a sign that installing RPM5 onto FreeBSD will be more of a pain than I had initially anticipated?

==
Vincent (Rick) Miller
Systems Engineer
vmiller@Verisign.com

t: 703-948-4395
21345 Ridgetop Cir Dulles, VA 20166

VerisignInc.com
Received on Sat Jun 25 01:10:56 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.