You are not logged in.

#1 2006-08-01 07:43:15

arcatan
Member
Registered: 2006-08-01
Posts: 3

Problems with errno.h

I tried to build Python using PKGBUILD from current for 2.4.3-3. Here's what I get:

gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -fPIC -DPy_BUILD_CORE -o Objects/complexobject.o Objects/complexobject.c
Objects/complexobject.c: In function '_Py_c_quot':
Objects/complexobject.c:102: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c:102: error: (Each undeclared identifier is reported only once
Objects/complexobject.c:102: error: for each function it appears in.)
Objects/complexobject.c: In function '_Py_c_pow':
Objects/complexobject.c:134: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c: In function 'complex_div':
Objects/complexobject.c:377: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c: In function 'complex_classic_div':
Objects/complexobject.c:398: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c: In function 'complex_remainder':
Objects/complexobject.c:416: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c: In function 'complex_divmod':
Objects/complexobject.c:440: error: 'EDOM' undeclared (first use in this function)
Objects/complexobject.c: In function 'complex_pow':
Objects/complexobject.c:476: error: 'ERANGE' undeclared (first use in this function)
Objects/complexobject.c:477: error: 'EDOM' undeclared (first use in this function)
make: *** [Objects/complexobject.o] Error 1

I reinstalled kernel-headers to see if that solves the problem. Now even configure doesn't work.

checking MACHDEP... linux2
checking EXTRAPLATDIR... 
checking for --without-gcc... no
checking for --with-cxx=<compiler>... no
checking for c++... c++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for AIX... no
checking for --with-suffix... 
checking for case-insensitive build directory... no
checking LIBRARY... libpython$(VERSION).a
checking LINKCC... $(PURIFY) $(CXX)
checking for --enable-shared... yes
checking for --enable-profiling... 
checking LDLIBRARY... libpython$(VERSION).so
checking for ranlib... ranlib
checking for ar... ar
checking for a BSD-compatible install... /bin/install -c
checking for --with-pydebug... no
checking whether gcc accepts -fno-strict-aliasing... yes
checking whether gcc accepts -OPT:Olimit=0... no
checking whether gcc accepts -Olimit 1500... no
checking whether pthreads are available without options... no
checking whether gcc accepts -Kpthread... no
checking whether gcc accepts -Kthread... no
checking whether gcc accepts -pthread... no
checking whether c++ also accepts flags for thread support... no
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking fcntl.h usability... no
checking fcntl.h presence... yes
configure: WARNING: fcntl.h: present but cannot be compiled
configure: WARNING: fcntl.h:     check for missing prerequisite headers?
configure: WARNING: fcntl.h: see the Autoconf documentation
configure: WARNING: fcntl.h:     section "Present But Cannot Be Compiled"
configure: WARNING: fcntl.h: proceeding with the preprocessor's result
configure: WARNING: fcntl.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for fcntl.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking pthread.h usability... no
checking pthread.h presence... no
checking for pthread.h... no
checking stropts.h usability... yes
checking stropts.h presence... yes
checking for stropts.h... yes
checking termios.h usability... no
checking termios.h presence... yes
configure: WARNING: termios.h: present but cannot be compiled
configure: WARNING: termios.h:     check for missing prerequisite headers?
configure: WARNING: termios.h: see the Autoconf documentation
configure: WARNING: termios.h:     section "Present But Cannot Be Compiled"
configure: WARNING: termios.h: proceeding with the preprocessor's result
configure: WARNING: termios.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for termios.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking utime.h usability... no
checking utime.h presence... no
checking for utime.h... no
checking sys/audioio.h usability... no
checking sys/audioio.h presence... no
checking for sys/audioio.h... no
checking sys/bsdtty.h usability... no
checking sys/bsdtty.h presence... no
checking for sys/bsdtty.h... no
checking sys/file.h usability... no
checking sys/file.h presence... yes
configure: WARNING: sys/file.h: present but cannot be compiled
configure: WARNING: sys/file.h:     check for missing prerequisite headers?
configure: WARNING: sys/file.h: see the Autoconf documentation
configure: WARNING: sys/file.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/file.h: proceeding with the preprocessor's result
configure: WARNING: sys/file.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/file.h... yes
checking sys/loadavg.h usability... no
checking sys/loadavg.h presence... no
checking for sys/loadavg.h... no
checking sys/lock.h usability... no
checking sys/lock.h presence... no
checking for sys/lock.h... no
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/modem.h usability... no
checking sys/modem.h presence... no
checking for sys/modem.h... no
checking sys/param.h usability... no
checking sys/param.h presence... yes
configure: WARNING: sys/param.h: present but cannot be compiled
configure: WARNING: sys/param.h:     check for missing prerequisite headers?
configure: WARNING: sys/param.h: see the Autoconf documentation
configure: WARNING: sys/param.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/param.h: proceeding with the preprocessor's result
configure: WARNING: sys/param.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/param.h... yes
checking sys/poll.h usability... no
checking sys/poll.h presence... yes
configure: WARNING: sys/poll.h: present but cannot be compiled
configure: WARNING: sys/poll.h:     check for missing prerequisite headers?
configure: WARNING: sys/poll.h: see the Autoconf documentation
configure: WARNING: sys/poll.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/poll.h: proceeding with the preprocessor's result
configure: WARNING: sys/poll.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/poll.h... yes
checking sys/select.h usability... no
checking sys/select.h presence... yes
configure: WARNING: sys/select.h: present but cannot be compiled
configure: WARNING: sys/select.h:     check for missing prerequisite headers?
configure: WARNING: sys/select.h: see the Autoconf documentation
configure: WARNING: sys/select.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/select.h: proceeding with the preprocessor's result
configure: WARNING: sys/select.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/select.h... yes
checking sys/socket.h usability... no
checking sys/socket.h presence... yes
configure: WARNING: sys/socket.h: present but cannot be compiled
configure: WARNING: sys/socket.h:     check for missing prerequisite headers?
configure: WARNING: sys/socket.h: see the Autoconf documentation
configure: WARNING: sys/socket.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/socket.h: proceeding with the preprocessor's result
configure: WARNING: sys/socket.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/socket.h... yes
checking sys/time.h usability... no
checking sys/time.h presence... yes
configure: WARNING: sys/time.h: present but cannot be compiled
configure: WARNING: sys/time.h:     check for missing prerequisite headers?
configure: WARNING: sys/time.h: see the Autoconf documentation
configure: WARNING: sys/time.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/time.h: proceeding with the preprocessor's result
configure: WARNING: sys/time.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/time.h... yes
checking sys/times.h usability... no
checking sys/times.h presence... yes
configure: WARNING: sys/times.h: present but cannot be compiled
configure: WARNING: sys/times.h:     check for missing prerequisite headers?
configure: WARNING: sys/times.h: see the Autoconf documentation
configure: WARNING: sys/times.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/times.h: proceeding with the preprocessor's result
configure: WARNING: sys/times.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for sys/times.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking sys/wait.h usability... no
checking sys/wait.h presence... no
checking for sys/wait.h... no
checking pty.h usability... no
checking pty.h presence... yes
configure: WARNING: pty.h: present but cannot be compiled
configure: WARNING: pty.h:     check for missing prerequisite headers?
configure: WARNING: pty.h: see the Autoconf documentation
configure: WARNING: pty.h:     section "Present But Cannot Be Compiled"
configure: WARNING: pty.h: proceeding with the preprocessor's result
configure: WARNING: pty.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.python.org/python-bugs ##
configure: WARNING:     ## ------------------------------------------------ ##
checking for pty.h... yes
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking netpacket/packet.h usability... yes
checking netpacket/packet.h presence... yes
checking for netpacket/packet.h... yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking bluetooth.h usability... no
checking bluetooth.h presence... no
checking for bluetooth.h... no
checking bluetooth/bluetooth.h usability... yes
checking bluetooth/bluetooth.h presence... yes
checking for bluetooth/bluetooth.h... yes
checking for dirent.h that defines DIR... no
checking for sys/ndir.h that defines DIR... no
checking for sys/dir.h that defines DIR... no
checking for ndir.h that defines DIR... no
checking for library containing opendir... none required
checking whether sys/types.h defines makedev... no
checking for sys/mkdev.h... (cached) no
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking for term.h... no
checking for clock_t in time.h... yes
checking for makedev... no
checking Solaris LFS bug... no
checking for mode_t... no
checking for off_t... no
checking for pid_t... no
checking return type of signal handlers... int
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for int... yes
checking size of int... configure: error: cannot compute sizeof (int), 77
See `config.log' for more details.

I've had this kind of problems (error codes like ERANGE not defined) with building other packages, too.

Offline

#2 2006-08-01 16:22:12

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Problems with errno.h

do you have kernel-headers installed? do you run a custom kernel that has /lib/modules/`uname -r`/build pointing to an invalid location where there are no kernel headers?


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#3 2006-08-01 16:28:57

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Problems with errno.h

kth5 wrote:

do you have kernel-headers installed?

All the failed headers are from the glibc package, not kernel-headers. I suggest reinstalling the glibc package and checking config.log for more detailed error messages.

do you run a custom kernel that has /lib/modules/`uname -r`/build pointing to an invalid location where there are no kernel headers?

That is unrelated. A userspace program should never rely on those headers, they are not meant for userspace. If a program does, it will most likely break. If a program needs kernel headers, it should rely on the sanitized headers from /usr/include/linux and /usr/include/asm, which are provided by the kernel-headers package (which are from the libc-linux-headers project).

Offline

#4 2006-08-01 16:40:27

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Problems with errno.h

brain0 wrote:
kth5 wrote:

do you have kernel-headers installed?

All the failed headers are from the glibc package, not kernel-headers. I suggest reinstalling the glibc package and checking config.log for more detailed error messages.

do you run a custom kernel that has /lib/modules/`uname -r`/build pointing to an invalid location where there are no kernel headers?

That is unrelated. A userspace program should never rely on those headers, they are not meant for userspace. If a program does, it will most likely break. If a program needs kernel headers, it should rely on the sanitized headers from /usr/include/linux and /usr/include/asm, which are provided by the kernel-headers package (which are from the libc-linux-headers project).

Not quite, try resolving internal header dependencies:

/use/include/errno.h:

#ifndef _ERRNO_H

/* The includer defined __need_Emath if he wants only the definitions
   of EDOM and ERANGE, and not everything else.  */
#ifndef __need_Emath
# define _ERRNO_H 1
# include <features.h>
#endif

__BEGIN_DECLS

/* Get the error number constants from the system-specific file.
   This file will test __need_Emath and _ERRNO_H.  */
#include <bits/errno.h>
#undef  __need_Emath

#ifdef  _ERRNO_H

/* Declare the `errno' variable, unless it's defined as a macro by
   bits/errno.h.  This is the case in GNU, where it is a per-thread
   variable.  This redeclaration using the macro still works, but it
   will be a function declaration without a prototype and may trigger
   a -Wstrict-prototypes warning.  */
#ifndef errno
extern int errno;
#endif

errno.h in glibc still needs parts which are only found in the kernel headers. wether they're taken from kernel-headers or kernel26 depends on the include path other, which is not always as clear as it seems. at least on my box python builds fine with default kernel26 and kernel-headers installed.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#5 2006-08-03 09:56:17

arcatan
Member
Registered: 2006-08-01
Posts: 3

Re: Problems with errno.h

I did "pacman -S glibc", now again configure succeeds but make fails (as before pacman -S kernel-headers). I use stock kernel26 (2.6.17.7-1). /lib/modules/`uname -r`/build/include contains header files.

Offline

#6 2006-08-05 10:42:12

arcatan
Member
Registered: 2006-08-01
Posts: 3

Re: Problems with errno.h

Problem solved! I noticed /usr/include/linux was a symlink to /usr/include. I removed it and reinstalled glibc and kernel-headers and now everything works again.

Offline

Board footer

Powered by FluxBB