RPM Community Forums

Mailing List Message of <rpm-users>

Re: RPM5 on FreeBSD: hto* functions

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 25 Jun 2011 - 04:24:16 CEST
Message-id: <64884829-4564-4CF2-9606-182BE71831A9@mac.com>

On Jun 23, 2011, at 2:24 PM, Miller, Vincent (Rick) wrote:

> 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.

Replace dbconvert.c with dbconvert.sh.

The program is NOT essential to RPM, nor is the executable used anywhere.

The sources are included for reference.

> 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.

The dbconver.c code is pretty recent and hasn't been compiled much on
non-linux. So I'm not too surprised at portability issue with endian issues.

> 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?

I can't easily answer programming questions about platforms that I
do not currently have development access to.

Don't build dbconvert.c would be my suggestion.

And reading signs instead of try-and-see can easily trick you imho.

When you finish building, do
	cd tests
	make check
and report what works and what doesn't.

From the output of "make check", I will be able to tell you how
much pain you are in for, and whether you have built successfully.


73 de Jeff
Received on Sat Jun 25 21:27:09 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.