building krb5-1.4 on hpux and solaris with native compilers

Ken Raeburn raeburn at MIT.EDU
Mon Feb 14 22:41:43 EST 2005

On Feb 14, 2005, at 19:58, Arlene Berry wrote:
> Yes.  I don't have a Solaris 8 box set up at the moment but the man  
> page on Sun's web site indicates it supports the same options as 9.   
> Gcc isn't our favorite because we've found that you get unresolved  
> references at run-time unless you have the gcc libraries available or  
> force it to statically link one of them.

Have you tried this recently?  I know it used to be kind of annoying in  
this way, but in gcc 3 and the upcoming gcc 4 they seem to have  
overhauled a lot of stuff.  (I don't know if it works better with GNU  
binutils or with the native tools these days, though.)

> The linker comes with the OS.  Compilers are purchased separately  
> which is why we're using an old one.  It does include a C++ compiler.   
> I've been digging deeper into the manuals and found this  
> ix128 in the Linkers and Libraries Guide for Solaris 9.  It covers all  
> of the ways initialization and termination routines can be declared.

Ah, good.  Thanks.

>   One method is via pragmas which is supported by our compiler as well  
> as by newer compilers.

Unfortunately, the approach I've been using is, "pass the name of the  
initializer function to this macro, and depending on the  
OS/compiler/configure options, it'll make the right thing happen", and  
similarly providing the function names when linking the library.  But a  
#pragma cannot be generated as output from a macro invocation (which is  
why the C99 spec adds _Pragma), and there aren't any hooks to add  
special compiler options in the file defining the initializer.

However, nothing says we can't add in one more file on Solaris.  We've  
already got hooks for generating auxiliary files like a modified export  
list for various platforms.  I'll take a look at possibly generating a  
tiny C source file to emit the finalizer (and optional initializer)  
call with the right pragma magic.

> Here's HP's info. on initializers:   
>  It's  
> not 100% correct as it says 11.25 and up supports +fini and +init for  
> both 32 and 64-bit modes.  However, my patched 11.11 system says it  
> supports +fini and +init for both 32 and 64-bit modes and, after I  
> patched it today, so does my 11.0 system.  The +I option is available  
> on 10.20, available for both bit modes on 11.0, and available for  
> 32-bit mode only on 11.11.

Do you have patch numbers for the 11.x systems that I could add to our  

> You wouldn't use both the pragmas and the linker options as they are  
> two different methods for accomplishing the same thing.

Ah, good.  Adding some linker options isn't hard.  Doing the pragmas  
would be annoying, at least if C99-style pragmas aren't supported.

> Unfortunately, our unix systems are all on a development network which  
> does not have external access but I would be happy to help in other  
> ways.

If you're willing to try building some snapshots and patches, we might  
be able to work something out.  I've also written a test program which  
should exercise some dynamic loading and unloading (dlopen/dlclose) in  
ways that we didn't get to do much with the 1.4 code.


More information about the krbdev mailing list