autoconf
[Top][All Lists]
Advanced

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

Re: Implementing a segfault test


From: Jason Curl
Subject: Re: Implementing a segfault test
Date: Sun, 23 Sep 2007 19:45:14 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Andrej Prsa wrote:
Hi,

my project uses a mixture of C and Fortran functions by translating
Fortran to C with f2c, compiling the generated sources into a library,
and linking the rest of the project to that library. For this scheme to
work, the executable also needs to be linked with g2c *or* with f2c.
Under most circumstances g2c is preferred.

The problem is that there is a bug in libg2c that causes a segfault on
some processors, i.e. dual core opterons and some 64bit intels; see:

http://people.debian.org/~terpstra/message/20070906.195243.618bfaf4.en.html

For these processors I would like to have the build system fall back on
"-lf2c -lm". I would like to ask for advice on how to implement this
test in autoconf. Since there is no list of affected processors, I don't
really know which processors would segfault with g2c and I can't switch
on the target. I would instead like to execute the test similar to the
one in the bug report above that would pass for most processors but
cause a segfault on the affected few. The ones that exhibit a segfault
need to be linked against libf2c.

Thanks for your help,
Andrej

I'm not entirely sure what the return code for a program that seg faulted would be, but first you can try the macro AC_RUN_IFELSE with the offending library.

It might be workable if you implement a signal handler that if called, it returns to the shell something other than zero. You'll likely have to check it at least on the platforms you might expect it to fail, I'm not sure if the signal would be OS dependent.

See:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Runtime

Cheers,
Jason.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]