This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Various] glibc-2.1: sigstack doesn't work


> The program code has to take care of this case.  The code simply has
> to do, if the error is ENOSYS, what it would do if sigstack is not
> available.

That would mean autoconf should be changed and that autoconf based
packages whose configure script is generated with an older autoconf
may fail on functions like sig{,alt}stack.

autoconf generates from

    AC_CHECK_FUNC(foo)

the configure script

    echo $ac_n "checking for foo""... $ac_c" 1>&6
    ...
      cat > conftest.$ac_ext <<EOF
    #line 531 "configure"
    #include "confdefs.h"
    /* System header to define __stub macros and hopefully few prototypes,
    	which can conflict with char foo(); below.  */
    #include <assert.h>
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
    	builtin and then its argument prototype would still apply.  */
    char foo();
    
    int main() {
    
->    /* The GNU C library defines this for functions which it implements
->    	to always fail with ENOSYS.  Some functions are actually named
->    	something starting with __ and the normal name is an alias.  */
    #if defined (__stub_foo) || defined (__stub___foo)
    choke me
    #else
    foo();
    #endif
    
    ; return 0; }
    EOF
    if { (eval echo configure:554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
      rm -rf conftest*
      eval "ac_cv_func_foo=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_func_foo=no"
    fi

i.e. it only checks if __stub_foo is not #defined and it can link the
function foo from a library.  If the comment marked above isn't true
anymore for newer glibc releases the autoconf maintainers should
probably be informed about this change.

However, this would also mean that checking for the availability with
AC_CHECK_FUNCS would be difficult, because testing the return code
against -1 and errno against ENOSYS is appropriate only for system
calls while autoconf does not know if the function to test is a system
call or not.


urs


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]