Bill Allombert on Wed, 28 Jan 2004 14:50:33 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: FreeBSD and Pari


On Wed, Jan 28, 2004 at 01:42:37PM +0100, Karim Belabas wrote:
> I have received the following report. Any comments ?
> 
> ( the workaround is still there in unstable 2-2-7. I have asked for details
> about the compilation "crash" )
> 
> ========================================================================
> I just compiled Pari on FreeBSD. There's a workaround for FreeBSD               
> (version 2.2.5) in the source file pari-2.1.5/src/gp/highlvl.c. But with        
> recent version of FreeBSD (>=4.x), this workaround is I think not needed
> any more and crashes the compilation.                                           
I looked up the dlopen manpage for those versions (that FreeBSD
conveniently provide online) and both were quite similar, did not
mention DL_DFLT_NAME, but state that

 A null pointer supplied for path is interpreted as a reference
 to the main executable of the process.

So it seems that the work-around has no raison d'être.

>  /* dlopen(NULL) returns a handle to the running process. 
>   * Bug report Y. Uchikawa: does not work for gp-dyn on FreeBSD 2.2.5
>   */ 

So either I am mistaken (which is quite possible) or this change was not
neccessary in the first place but in fact the -export-dynamic linker
flag was the real fix.

Now, it seems the code has changed to

#if defined(__FreeBSD__) || defined(__CYGWIN__)
  if (! *lib) lib = DL_DFLT_NAME;
#else
  if (! *lib) lib = NULL;
#endif

So, is it neccessary on cygwin ?

Alternatively we can do

#ifndef DL_DFLT_NAME
#define DL_DFLT_NAME NULL
#endif
  if (! *lib) lib = DL_DFLT_NAME;

which should cover all case.

Cheers,
Bill.