473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Compiling 2.5.1 on OpenBSD 4.1

Hi all,

In my prev post, I indicated I was using 2.5.1 on one box and 2.5p3 on the
OpenBSD box. I'm trying to build 2.5.1 on OpenBSD and I get this:

Modules/posixmodule.c:5701: error: `lstat' undeclared (first use in this
function)

I browsed the source and don't understand why I'm getting it. I'm not a
configure expert, but I did figure out that pyconfig.h has these set:

#define HAVE_LSTAT 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1

and that posixmodule.c includes sys/stat.h, sys/types.h (per the lstat
manpage) as well as declaring lstat outright.

I'm stumped. Any suggestions? ./configure was run with no options.

TIA,
nazgul
Jul 29 '07 #1
5 2288
I'm stumped. Any suggestions?

You will have to find the true declaration of lstat - reading
man pages or checking that everything "looks right" won't help.

So where is lstat declared? Is it declared at all, and if so,
is that declaration conditional perhaps?

Produce a preprocessor output (posixmodule.i), by adding
-fsave-temps to the compiler line compiling posixmodule.c
(copy the line from the make output into a shell, and add
this command line); then inspect that output to see whether
lstat has been declared.

Regards,
Martin
Jul 29 '07 #2
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <ma****@v.loewis.dewrote in news:46**************@v.loewis.de:
>I'm stumped. Any suggestions?

You will have to find the true declaration of lstat - reading
man pages or checking that everything "looks right" won't help.

So where is lstat declared? Is it declared at all, and if so,
is that declaration conditional perhaps?

Produce a preprocessor output (posixmodule.i), by adding
-fsave-temps to the compiler line compiling posixmodule.c
(copy the line from the make output into a shell, and add
this command line); then inspect that output to see whether
lstat has been declared.

Regards,
Martin
Thanks Martin. Did I mention this was OpenBSD 4.1 in the original post? Here's the patch:

--- configure.~1~ Mon Mar 12 06:50:51 2007
+++ configure Sun Jul 29 11:47:27 2007
@@ -1553,7 +1553,7 @@
# On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
# even though select is a POSIX function. Reported by J. Ribbens.
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
- OpenBSD/2.* | OpenBSD/3.[0123456789] | OpenBSD/4.[0])
+ OpenBSD/2.* | OpenBSD/3.[0123456789] | OpenBSD/4.[01])
define_xopen_source=no;;
# Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
# _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
Jul 29 '07 #3
Thanks Martin. Did I mention this was OpenBSD 4.1 in the original post? Here's the patch:

It may work, but I don't like it. Can you please try this one instead,
and report whether it works?

Thanks,
Martin

Index: configure
================================================== =================
--- configure (Revision 56599)
+++ configure (Arbeitskopie)
@@ -1388,6 +1388,14 @@
_ACEOF
+# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
+# also defined. This can be overridden by defining _BSD_SOURCE
+
+cat >>confdefs.h <<\_ACEOF
+#define _BSD_SOURCE 1
+_ACEOF
+
+
# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
Jul 29 '07 #4
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <ma****@v.loewis.dewrote
in news:46**************@v.loewis.de:
>
It may work, but I don't like it. Can you please try this one instead,
and report whether it works?
Different error:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o
In file included from Include/Python.h:57,
from Modules/posixmodule.c:30:
Include/pyport.h:520: warning: `struct winsize' declared inside parameter list
Include/pyport.h:520: warning: its scope is only this definition or declaration, which is probably not what you want
Include/pyport.h:521: warning: `struct winsize' declared inside parameter list
Modules/posixmodule.c: In function `_pystat_fromstructstat':
Modules/posixmodule.c:1306: error: structure has no member named `st_atimespec'
Modules/posixmodule.c:1307: error: structure has no member named `st_mtimespec'
Modules/posixmodule.c:1308: error: structure has no member named `st_ctimespec'
Modules/posixmodule.c: In function `posix_chroot':
Modules/posixmodule.c:1735: error: `chroot' undeclared (first use in this function)
Modules/posixmodule.c:1735: error: (Each undeclared identifier is reported only once
Modules/posixmodule.c:1735: error: for each function it appears in.)
Modules/posixmodule.c: In function `posix_setgroups':
Modules/posixmodule.c:5506: warning: implicit declaration of function `setgroups'
Modules/posixmodule.c: In function `posix_wait3':
Modules/posixmodule.c:5590: warning: implicit declaration of function `wait3'
Modules/posixmodule.c: In function `posix_wait4':
Modules/posixmodule.c:5614: warning: implicit declaration of function `wait4'
Modules/posixmodule.c: In function `posix_lstat':
Modules/posixmodule.c:5701: error: `lstat' undeclared (first use in this function)
Modules/posixmodule.c: In function `posix_major':
Modules/posixmodule.c:6337: warning: implicit declaration of function `major'
Modules/posixmodule.c: In function `posix_minor':
Modules/posixmodule.c:6350: warning: implicit declaration of function `minor'
Modules/posixmodule.c: In function `posix_makedev':
Modules/posixmodule.c:6363: warning: implicit declaration of function `makedev'
Modules/posixmodule.c: In function `posix_getloadavg':
Modules/posixmodule.c:7955: warning: implicit declaration of function `getloadavg'
*** Error code 1

Stop in /bu/pkg/Python-2.5.1 (line 1111 of Makefile).

__BSD_VISIBLE is there (it wasn't there before and that's what was causing my original problem).
dnm@kili:/bu/pkg/Python-2.5.1$ grep _BSD_SOURCE pyconfig.h
dnm@kili:/bu/pkg/Python-2.5.1$ grep _BSD_VISIBLE pyconfig.h
#define __BSD_VISIBLE 1

I don't understand what's causing the problem, though:

/usr/include/unistd.h:
#if __XPG_VISIBLE >= 500
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
int ttyname_r(int, char *, size_t)
__attribute__((__bounded__(__string__,2,3)));
#endif

#if __BSD_VISIBLE || __XPG_VISIBLE <= 500
/* Interfaces withdrawn by X/Open Issue 5 Version 0 */
void *brk(void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void);
char *getpass(const char *);
void *sbrk(int);
#endif

#if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420
int lockf(int, int, off_t);
#endif
---

posixmodule.i:
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
int ttyname_r(int, char *, size_t)
__attribute__((__bounded__(__string__,2,3)));
# 188 "/usr/include/unistd.h" 3 4
int lockf(int, int, off_t);
---

Plus, I get lots of warnings that I didn't get using my patch. Sample:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/threadmodule.c -o Modules/threadmodule.o
In file included from Include/Python.h:57,
from Modules/threadmodule.c:5:
Include/pyport.h:520: warning: `struct winsize' declared inside parameter list
Include/pyport.h:520: warning: its scope is only this definition or declaration, which is probably not what you want
Include/pyport.h:521: warning: `struct winsize' declared inside parameter list

Here are the differences between the pyconfig.h with my patch and with yours:

dnm@kili:/bu/pkg/Python-2.5.1$ diff pyconfig.h pyconfig.h.martin
93c93
< #define HAVE_CURSES_RESIZETERM 1
---
/* #undef HAVE_CURSES_RESIZETERM */
647c647
< #define HAVE_TERM_H 1
---
/* #undef HAVE_TERM_H */
744c744
< #define MVWDELCH_IS_EXPRESSION 1
---
/* #undef MVWDELCH_IS_EXPRESSION */
863c863
< #define WINDOW_HAS_FLAGS 1
---
/* #undef WINDOW_HAS_FLAGS */
932c932
< /* #undef _POSIX_C_SOURCE */
---
#define _POSIX_C_SOURCE 200112L
941c941
< /* #undef _XOPEN_SOURCE */
---
#define _XOPEN_SOURCE 600
944c944
< /* #undef _XOPEN_SOURCE_EXTENDED */
---
#define _XOPEN_SOURCE_EXTENDED 1
Thanks,
dnm
Jul 29 '07 #5
I don't have OpenBSD available, so I have to do all my research over
the web. I would really appreciate if this problem could be solved
"for good". In the past, it was always difficult that the *BSDs would
hide interfaces if I say that my program uses XOPEN/Unix. Python
uses a "POSIX+" approach: use POSIX interfaces where available;
use platform-specific ones elsewhere.
I'll be happy to test anything you want WRT OpenBSD. I have one here and I
don't think it's going anywhere.
>
I see. The macros _BSD_SOURCE didn't actually get defined.
Please try the revised patch below.
This looks to have fixed it. Build was succesful. Thanks!

dnm
Jul 31 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Yuri Pimenov | last post by:
Hello, all. Im trying to build python 2.3.2 on openbsd 3.4. First of all, ./configure complains several times about unability to test sys/select.h, sys/lock.h files: .... checking ncurses.h...
3
by: Noah | last post by:
I'm getting configure warnings and make errors when I try to build Python 2.3.4 under OpenBSD 3.5. I don't see anything in the README under "Platform specific note" for OpenBSD. I tried opening...
4
by: Aaron Baugher | last post by:
I have an OpenBSD 3.3 system running MySQL 3.23.55 from the ports tree. Everything started out at the default settings. This system holds a large vBulletin 2.2.9 forum database, and that's pretty...
2
by: Steph L | last post by:
Hi, A given Milter program compiles ok on OpenBSD/FreeBSD/Linux but not on Solaris : it uses daemon(3) http://www.openbsd.org/cgi-bin/man.cgi?query=daemon&apropos=0&sektion...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
1
by: insyte | last post by:
I'm attempting to write a faily simple threaded app that fires off a thread to select() on a FIFO while the main loop handles data read from that pipe and a few other tasks. For some reason, calls...
1
by: Geoff | last post by:
Hi! I'm wanting to use openbsd to run a webserver because of its high security. The website is written in python. Before I was using linux with apache 2 and mod_python and this worked well. My...
1
by: nazgul | last post by:
Hi all, I have an app that runs on multiple boxes. On my slackware box, running Python 2.5.1, top shows this: Mem: 1002736k total, 453268k used, 549468k free, 31392k buffers Swap: ...
60
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
On May 3, 8:09 am, apati...@gmail.com wrote: A programmer that uses Vista? :O Vista is a hog of an operating system. Downgrade to Windows XP or get yourself a Linux distro.
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.