Friday, January 18, 2008

64bit Firebird for MacOS 10.5 (Leopard)

Today I put the finishing touches to a native 64bit port of Firebird for MacOS 10.5 (Leopard).
This required the following changes to the Firebird 2.1 code base (B2_1_Release). For anybody else considering adding a new platform to Firebird then you may find this useful.

Changes:
1. src/jrd/common.h (line 289)
#ifdef __x86_64__
#define DARWIN64
#define IMPLEMENTATION isc_info_db_impl_darwin_x64 /* 73 */
#endif

2. src/jrd/inf_pub.h (line 203)
add
isc_info_db_impl_darwin_x64 = 73,

3. src/jrd/license.h (line 135)
amend
#ifdef DARWIN
#if defined(i386)
#define FB_PLATFORM "UI" /* Darwin/Intel */
to
#if defined(i386) || defined (__x86_64__)

4. src/jrd/pag.cpp (line 155)
insert (last)
static const int CLASS_DARWIN_X64 = 31; // Darwin x64
amend (line 158)
static const int CLASS_MAX = CLASS_DARWIN_X64;
since this is the last one added

5. src/jrd/pag.cpp (line 245)
insert (last)
archLittleEndian // CLASS_DARWIN_X64
make sure you add a , to the class above...

6. src/jrd/pag.cpp (line 322)
Pick up the right class for the right architecture..
add
#ifdef DARWIN64
const SSHORT CLASS = CLASS_DARWIN_X64
#endif

7. src/remote/protocol.h (line 150)
add a new architecture
arch_darwin_64 = 41,
and update arch_max
arch_max = 42

8. src/remote/remote_def.h (line 72)
add a new architecture
#elif defined(DARWIN64)
const P_ARCH ARCHITECTURE = arch_darwin_64;

9. src/remote/xdr.cpp
Make sure SWOP DOUBLE is defined correctly
by appending
|| defined(DARWIN64)
to the intel crowd.

10. src/jrd/utl.cpp (line 218)
add
"Firebird/Darwin/Intel64" /* 73 */

11. src/common/classes/fb_atomic.h (line 82)
add || defined (__x86_64__)

12. configure.in (line 62)
In the target darwin section add
dnl CPU_TYPE=x86_64
This can be uncommented when you do a 64bit build


Now read the notes in builds/posix/prefix.darwin_x86_64

1. edit configure.in so that MAKEFILE_PREFIX=darwin_x86_64
2. Uncomment the CPU_TYPE
3. edit extern/icu/source/config/mh-darwin to set the right 64bit flags (-arch x86_64) for LD_FLAGS
for CFLAGS, CXXFLAGS
4. export CFLAGS='-arch x86_64'
5. export CXXFLAGS='-arch x86_64'

Then check and make sure that
MACOSX_DEPLOYMENT_TARGET=10.5
and export that for good measure.

Build should be good to go. Welcome to native 64bit Firebird on MacOS

Wednesday, January 9, 2008

depot Files and HP-UX

I have just finished writing a depot install for Firebird Classic 2.0x on HPUX . A depot install is the HP equivalent of a Linux rpm or Solaris package. The operating system install uninstall utilities take command of looking after the files. Although in more complex areas you still have to have the relevant postinstall and postremove scripts to handle things like links etc.
To allow a user other than root to use SD-UX you need to give yourself access to it e.g.
swacl -m user:pbeach:crwit -l host
To create a depot install you need to write a .psf file (the Firebird specific one will be found in builds/install/arch-specific/hpux/classic/firebirdCS.psf), you then

test it using:
swpackage -vv -p ./firebirdCS.psf

create it using:
swpackage -d "| gzip -c > /firebird2/gen/firebird.depot.gz" -x media_type=tape -vv -s firebirdCS.psf

install it using:
swinstall -s /firebird.depot.gz

list installed packages using
swlist

remove it using
swremove Firebird

Open Source Code Contains Security Holes

The following was sent to Charles Babcock at Information week in reply to an article entitled:

Open Source Code Contains Security Holes

As a developer and administrator of the Firebird Project I completely reject the statement you made in the above article.

"The somewhat moribund Firebird project, for example, is listed with 195 identified defects, of which it has verified zero and fixed zero. The active Firefox browser project, on the other hand,
has fixed 370 bugs, verified 56 and faces another 246 to verify and fix."

The Firebird project is in fact incredibly active - perhaps a look at this chart on our bug tracker might give you a clue.

http://tinyurl.com/yt5pgl

Firstly the Firebird project reviewed the Coverity results almost immediately they were published and found that the report isn't actually related to the Firebird engine. This URL shows our appropriate comments from the 7th March 2006:
http://www.firebirdnews.org/?p=180

Also more comments from Claudio on the 26th March 2006:
http://www.firebirdnews.org/?p=243

Secondly in a more detailed reply to the actual "PR" issue raised by David Maxwell, open source strategist for Coverity. If you had asked about this before printing the article you could have put some facts straight.

Nearly all of the 195 identified defects are in fact actually within an external piece of code we use for character sets and collation sequences ICU

http://www-306.ibm.com/software/globalization/icu/index.jsp

"The International Component for Unicode (ICU) is a mature, portable set of C/C++ and Java libraries for Unicode support, software internationalization (I18N) and globalization (G11N),
giving applications the same results on all platforms."

A open source project maintained by IBM. I will admit that we are using an older version of ICU (3.0) than is currently available and we will be upgrading to a newer version in the near future.
But this is not something that is a trivial exercise, as it means that any database using a different version of ICU would be incompatible with the version we ship. We plan to upgrade ICU
in Firebird version 2.5

Other defects reported are one in
usr/include/c++/4.0.2/i386-redhat-linux/bits/gthr-default.h
Not our problem either....

And there are four defects in firebird2/src/gpre/pretty.cpp a piece of old code used with a pre-compiler (gpre) to make BLR look good. BLR (Binary Language Representation),
Firebird's internal compiled language. This doesn't affect the Firebird server at all.

I would like you to print a correction or at least acknowledge the innacuracy of the article as regards Firebird.

Regards
Paul Beach

Monday, January 7, 2008

Firebird 2.03 on HPUX 11

I have just released a classic version of Firebird V2.03 for HPUX 11. This is a 64bit version for PA-RISC 2.0. The current install mechanism as per Firebird 1.5.x uses a tar file and scripts to install firebird into /opt/firebird etc. I think the time has now come to try and write a depot file so that we can use the HPUX installer to install firebird. Initial analysis indicates that I need to write a .psf file that contains the relevant instructions, and that I can test it using the following command:
swpackage -p -vv -s ./firebirdCS.psf -d /sd/firebird
Where:
-p = preview mode (don't do anything - just test the psf file)
-vv = very verbose
-s = source psf file
-d = destination