Can't build db48 or db6

Both databases/db48 and databases/db6 fail to build on FreeBSD 9.2 powerpc64 with the similar errors:

Code:
===>  Building for db48-4.8.30.0
./libtool --mode=compile c++ -c -I. -I./../dist/..  -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing ./../dist/../cxx/cxx_db.cpp
./libtool --mode=compile c++ -c -I. -I./../dist/..  -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing ./../dist/../cxx/cxx_dbc.cpp
libtool: compile:  c++ -c -I. -I./../dist/.. -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing ./../dist/../cxx/cxx_dbc.cpp  -fPIC -DPIC -o .libs/cxx_dbc.o
libtool: compile:  c++ -c -I. -I./../dist/.. -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing ./../dist/../cxx/cxx_db.cpp  -fPIC -DPIC -o .libs/cxx_db.o
In file included from ./../dist/../dbinc/mutex.h:15,
                 from ./db_int.h:884,
                 from ./../dist/../cxx/cxx_dbc.cpp:11:
./../dist/../dbinc/mutex_int.h: In function 'int MUTEX_SET(int*)':
./../dist/../dbinc/mutex_int.h:599: error: cast from 'int*' to 'int' loses precision
In file included from ./../dist/../dbinc/mutex.h:15,
                 from ./db_int.h:884,
                 from ./../dist/../cxx/cxx_db.cpp:11:
./../dist/../dbinc/mutex_int.h: In function 'int MUTEX_SET(int*)':
./../dist/../dbinc/mutex_int.h:599: error: cast from 'int*' to 'int' loses precision
*** [cxx_dbc.lo] Error code 1
*** [cxx_db.lo] Error code 1
2 errors
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /usr/ports/databases/db48.

Code:
===>  Building for db6-6.0.20
./libtool --mode=compile g++48 -c -I. -I./../src  -D_THREAD_SAFE -O2 -pipe -O3 -mcpu=G5 -maltivec -mcpu=G5 -fno-strict-aliasing ../lang/cxx/cxx_channel.cpp
./libtool --mode=compile g++48 -c -I. -I./../src  -D_THREAD_SAFE -O2 -pipe -O3 -mcpu=G5 -maltivec -mcpu=G5 -fno-strict-aliasing ../lang/cxx/cxx_db.cpp
libtool: compile:  g++48 -c -I. -I./../src -D_THREAD_SAFE -O2 -pipe -O3 -mcpu=G5 -maltivec -mcpu=G5 -fno-strict-aliasing ../lang/cxx/cxx_db.cpp  -fPIC -DPIC -o .libs/cxx_db.o
libtool: compile:  g++48 -c -I. -I./../src -D_THREAD_SAFE -O2 -pipe -O3 -mcpu=G5 -maltivec -mcpu=G5 -fno-strict-aliasing ../lang/cxx/cxx_channel.cpp  -fPIC -DPIC -o .libs/cxx_channel.o
In file included from ./../src/dbinc/mutex.h:15:0,
                 from ./db_int.h:1116,
                 from ../lang/cxx/cxx_channel.cpp:11:
./../src/dbinc/mutex_int.h: In function 'int MUTEX_SET(int*)':
./../src/dbinc/mutex_int.h:599:15: error: cast from 'int*' to 'int' loses precision [-fpermissive]
   return (int)tsl;
               ^
In file included from ./../src/dbinc/mutex.h:15:0,
                 from ./db_int.h:1116,
                 from ../lang/cxx/cxx_db.cpp:11:
./../src/dbinc/mutex_int.h: In function 'int MUTEX_SET(int*)':
./../src/dbinc/mutex_int.h:599:15: error: cast from 'int*' to 'int' loses precision [-fpermissive]
   return (int)tsl;
               ^
gmake: *** [cxx_channel.lo] Error 1
gmake: *** Waiting for unfinished jobs....
gmake: *** [cxx_db.lo] Error 1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /usr/ports/databases/db6.
*** [build] Error code 1

Stop in /usr/ports/databases/db6.

Yet databases/db42 builds just fine.

This is my /etc/make.conf:
Code:
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc48)
CC=gcc48
CXX=g++48
CPP=cpp48
CPUTYPE=G5
CFLAGS+=-O3 -maltivec
.endif
WITH_BDB_VER=6
 
Does it build correctly if you use the default compiler?
 
In that case I'd file a PR. It may be something specific to PowerPC so be sure to mention that.
 
Back
Top