Subject: 1.6BETA_2 snapshot's cc / dlopen() ?
To: None <>
From: Ray Phillips <>
List: port-alpha
Date: 07/19/2002 17:25:54
Dear NetBSD/alpha:

I have the 1.6BETA_2 snapshot from

running on a 3000/400 and have attempted to install perl 5.005_03 and 
perl 5.6.1 on it from source.  The former installs happily on 1.5.2 
but neither even finishes running Configure properly on 1.6.

I realise the response is likely to be "install from pkgsrc rather 
than from source," but perl is supposed to install on most unicies 
isn't it?  So I wonder if the failure indicates a problem with part 
of 1.6 such as its new compiler?  (I'm just guessing.)

The problem with Configure is one of its small test programs core 
dumps.  The message written to the screen when Configure is run in 
interactive mode is:

Checking whether your dlsym() needs a leading underscore ...
pid 18412 (fred): unaligned access: va=0x16001447c pc=0x1600144dc 
ra=0x16008caa8 sp=0x1fffffa68 op=ldq
Segmentation fault - core dumped

I'm not proficient in these matters, but have found Configure creates 
a shared library(?),, from dyna.c [1] then compiles and runs 
fred.c [2] to see if it's possible to resolve's single symbol.

By trial and error I found the core dump occurs when dlopen() is 
called.  Any suggestions why, please?


% cat dyna.c
fred () { }

% cat fred.c

#include <stdio.h>
#define I_DLFCN
#ifdef I_DLFCN
#include <dlfcn.h>      /* the dynamic linker include file for Sunos/Solaris */
#include <sys/types.h>
#include <nlist.h>
#include <link.h>

extern int fred() ;

int main()
     void * handle ;
     void * symbol ;
#ifndef RTLD_LAZY
     int mode = 1 ;
     int mode = RTLD_LAZY ;
     handle = dlopen("./", mode) ;
     if (handle == NULL) {
         printf ("1\n") ;
         fflush (stdout) ;
     symbol = dlsym(handle, "fred") ;
     if (symbol == NULL) {
         /* try putting a leading underscore */
         symbol = dlsym(handle, "_fred") ;
         if (symbol == NULL) {
             printf ("2\n") ;
             fflush (stdout) ;
         printf ("3\n") ;
         printf ("4\n") ;
     fflush (stdout) ;