From: Alan W. I. <ir...@be...> - 2004-12-02 02:01:51
|
On 2004-12-02 00:27+0100 Emmanuel Bertin wrote: > Hi all, > > Although there is no problem on x86 systems, a strange thing happens when > linking statically a C program with PLPlot on the x86-64 architecture: *Any* > unsuccesfull call to fopen() happens to generate immediately a segmentation > fault!! I tried with various 5.x versions, including the latest > 5.3.1.cvs.20041028, with different versions of glibc on Mandrake 10.x and the > latest Gentoo. No such problem ever happens when linking dynamically. Here is > what strace says: > > brk(0) = 0xd4c000 > brk(0xd6d000) = 0xd6d000 > stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=420, ...}) = 0 > --- SIGSEGV (Segmentation fault) @ 0 (0) --- > +++ killed by SIGSEGV +++ > > Does anyone have a clue??? I guess it may have to do with some library used > by PLPlot, but I have not been able to find which one. I suspect you have the dynamic drivers enabled when they shouldn't be (for a static library build). Can you generate the behaviour with any of the _installed_ examples using the exact procedure below? You must use --disable-dynamic --disable-dyndrivers as configure options for the static build to be done correctly. Also, you must clean out all the dynamic libraries from the $prefix install area before doing the usual "./configure --options.... ; make; make install" of the normal configure, build, and install sequence. After such a special build and install, then do cp -a $prefix/share/plplot$version/examples /tmp cd /tmp/examples make to compile and properly link the examples against the static libraries. $prefix is the prefix you specified at configure time. If you follow the above directions for building static libraries and building examples linked against them for version 5.3.1.cvs.20041028, and the examples segfault, we want to know about it. Conversely, if the examples work with the above make command, then you should look at that linking generated by that make command and follow it for your own statically linked applications. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |