SafeTP & Sparc Architecture

(If the information contained here is not totally accurate, I apologize. I'm not very familiar with Sparc processors.)

The latest versions of GMP use the 64-bit ABI (application binary interface) on Sparc processors by default. Since most systems have gcc configured to use the 32-bit ABI by default, and SafeTP doesn't change this, SafeTP will be unable to link with the GMP library (libgmp.a).

There are two solutions: compile SafeTP to use the 64-bit ABI, or compile GMP to use the 32-bit ABI.

64-bit SafeTP (doesn't work?)

To compile SafeTP in 64-bit mode, add CXXFLAGS=-m64 to the command line of ./configure. In fact, the GMP manual recommends all this:

  (sftpd)$ ./configure CXXFLAGS="-m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"

Note that you may need to adjust your shared-library settings for this to work. For example,

  (sftpd)$ export LD_LIBRARY_PATH=/usr/local/lib/sparcv9

However, when I tried it on a Sparc machine, I got a failure (Bus error) in SafeTP's test program sdsa. SafeTP won't work if sdsa does not. I haven't spent time to figure out what's wrong.

32-bit GMP

To compile GMP to use the 32-bit ABI, just say

  (gmp)$ ./configure ABI=32
when configuring GMP.

The bad news is if you've already built GMP and are just now running into this problem, you'll have to build it from scratch again. The good news is it seems to work, at least on my test machine. Use make check after building SafeTP to find out if it worked.