-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-31904 : Add support for VxWorks RTOS #4184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
10d4405
9d53ef2
db2e0e8
cb3aa97
1939a13
9a92b63
e997ecc
7faa281
98d3bdf
249794c
8bab325
21457f7
b6c9012
809b73a
847515f
4abb38d
08d4b40
c8c322c
fd303e0
93dca1b
288e627
c768168
e7bf7e3
f4b41a9
f94b66a
2b16c82
215bc2e
6921cf8
e62ed36
0861635
4d9158a
c6d7110
760da7a
1a0786f
9752833
aeb5a6d
dd24c10
e83c1d8
f1e3e72
29c94e6
4a59407
cf0fdd7
233711d
a290567
aa2e09f
18463dd
db70b18
dd55e39
0ad214f
7058513
a6e829f
9a9e4c6
ec4c065
1a3e146
4ec2302
fdda86b
b73d9a5
e660837
e4b940f
1e9e98c
0d014f4
228058d
7fdefac
9561d7f
a582432
f5f8a74
209108b
57750be
86fdad0
f3da70f
70e3042
7f38637
4d65430
78758f2
71a0b0e
5d2dcd0
7876778
e985afc
709f6ad
29fd9ea
9ea42d2
c7de1d7
2b5937e
a23d30f
f33eced
52f7458
e86db34
133514e
1a0239e
e6499a0
5c5e61b
5b933aa
4abcbc0
fea0a12
2bb0bfa
9197e5d
2c6f668
4e7a964
a702f6b
a747cf6
e1f0fd9
9dad132
ad3997c
fbe4165
ac8e483
73aaf36
105fcbf
0e36173
3a047a7
7df8049
b82e97b
2ef69a1
e39429a
e603320
170b3f7
a0b998d
fe61e8d
40f7d9a
09df4b7
ba4f218
972edd9
7041c76
85f315b
83b8cd8
0442599
38b4dd7
74ebbae
65c32bb
09819ef
53374cc
9b5a90b
ef20abe
e81a6c8
2e8d900
deab193
8e29fd4
8caee0f
7bc49fb
f0616ce
960dec6
f26b019
af6eaae
7b76b99
803e1a5
5588990
3db05a3
0f76411
025544a
afb5e55
aeb5d73
d5be8e1
fa9a502
7da582d
3892899
0442de5
2e84e47
ca82e3c
034a945
19b7f66
2072c80
0cd3581
622a824
a3d6c1b
bab4fe3
1d927d4
eed3c7a
98a86cb
7452f6d
e5d38de
69607b4
c59bc98
bc2e110
dfa1144
01dd52f
e5a9b35
b4c6bdc
21fb278
640cce7
f64606e
8f2516a
d16ad7f
bf0607a
785ced6
084256d
7d62768
dd7460b
61490c0
4ca9f18
8092657
22701dd
768c619
36b0634
0ba5ab7
dc42724
c79857f
cdaa817
217b2d9
61a4f27
92465c7
0461bda
72b343d
f569783
8598648
875bb82
addd1a0
37b7dc8
a74b6d6
fc9529f
cc3d30b
df4b6ff
39e4d4e
f2682d6
ddde264
d0c89e4
69ff954
d5127ac
d0ecc40
43aeefc
0b620c4
79f497a
cbcfdf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Allow cross-build of VxWorks if --host=*-wrs-vxworks is passed to configure |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,7 @@ corresponding Unix manual entries for more information on calls."); | |
#define HAVE_FSYNC 1 | ||
#define fsync _commit | ||
#else | ||
#ifndef __VXWORKS__ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are all of this function absent? It looks suspicious that all of them are grouped alphabetically. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A couple are present in some configurations of VxWorks, but following comment is dated. |
||
/* Unix functions that the configure script doesn't check for */ | ||
#define HAVE_EXECV 1 | ||
#define HAVE_FORK 1 | ||
|
@@ -184,6 +185,7 @@ corresponding Unix manual entries for more information on calls."); | |
#define HAVE_GETEUID 1 | ||
#define HAVE_GETGID 1 | ||
#define HAVE_GETPPID 1 | ||
#endif | ||
#define HAVE_GETUID 1 | ||
#define HAVE_KILL 1 | ||
#define HAVE_OPENDIR 1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,7 +159,7 @@ if_indextoname(index) -- return the corresponding interface name\n\ | |
# undef HAVE_GETHOSTBYNAME_R_6_ARG | ||
#endif | ||
|
||
#if defined(__OpenBSD__) | ||
#if defined(__OpenBSD__) || defined(__VXWORKS__) | ||
# include <sys/uio.h> | ||
#endif | ||
|
||
|
@@ -181,6 +181,13 @@ if_indextoname(index) -- return the corresponding interface name\n\ | |
# endif | ||
#endif | ||
|
||
#ifdef __VXWORKS__ | ||
# include <ipcom_sock2.h> | ||
# define gethostbyaddr_r ipcom_gethostbyaddr_r | ||
# define h_errno errno | ||
# include <hostLib.h> | ||
#endif | ||
|
||
#if !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS) | ||
# define USE_GETHOSTBYNAME_LOCK | ||
#endif | ||
|
@@ -525,7 +532,7 @@ set_error(void) | |
return PyErr_SetFromErrno(PyExc_OSError); | ||
} | ||
|
||
|
||
/*#ifndef __VXWORKS__ */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this no longer needed, remove it. |
||
static PyObject * | ||
set_herror(int h_error) | ||
{ | ||
|
@@ -543,7 +550,7 @@ set_herror(int h_error) | |
|
||
return NULL; | ||
} | ||
|
||
/* #endif */ | ||
|
||
static PyObject * | ||
set_gaierror(int error) | ||
|
@@ -896,7 +903,7 @@ init_sockobject(PySocketSockObject *s, | |
return 0; | ||
} | ||
|
||
|
||
#ifdef HAVE_SOCKETPAIR | ||
/* Create a new socket object. | ||
This just creates the object and initializes it. | ||
If the creation fails, return NULL and set an exception (implicit | ||
|
@@ -916,7 +923,7 @@ new_sockobject(SOCKET_T fd, int family, int type, int proto) | |
} | ||
return s; | ||
} | ||
|
||
#endif | ||
|
||
/* Lock to allow python interpreter to continue, but only allow one | ||
thread to be in gethostbyname or getaddrinfo */ | ||
|
@@ -5419,6 +5426,7 @@ Return the service name from a port number and protocol name.\n\ | |
The optional protocol name, if given, should be 'tcp' or 'udp',\n\ | ||
otherwise any protocol will match."); | ||
|
||
#ifndef __VXWORKS__ | ||
serhiy-storchaka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/* Python interface to getprotobyname(name). | ||
This only returns the protocol number, since the other info is | ||
already known or not useful (like the list of aliases). */ | ||
|
@@ -5445,7 +5453,7 @@ PyDoc_STRVAR(getprotobyname_doc, | |
"getprotobyname(name) -> integer\n\ | ||
\n\ | ||
Return the protocol number for the named protocol. (Rarely used.)"); | ||
|
||
#endif | ||
|
||
#ifndef NO_DUP | ||
/* dup() function for socket fds */ | ||
|
@@ -6385,8 +6393,10 @@ static PyMethodDef socket_methods[] = { | |
METH_VARARGS, getservbyname_doc}, | ||
{"getservbyport", socket_getservbyport, | ||
METH_VARARGS, getservbyport_doc}, | ||
#ifndef __VXWORKS__ | ||
{"getprotobyname", socket_getprotobyname, | ||
METH_VARARGS, getprotobyname_doc}, | ||
#endif | ||
#ifndef NO_DUP | ||
{"dup", socket_dup, | ||
METH_O, dup_doc}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1421,13 +1421,15 @@ PyInit_timezone(PyObject *m) { | |
#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) | ||
PyObject *otz0, *otz1; | ||
tzset(); | ||
#ifndef __VXWORKS__ | ||
PyModule_AddIntConstant(m, "timezone", timezone); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No timezone, no _timezone, you have to use tzset/tzget |
||
#ifdef HAVE_ALTZONE | ||
PyModule_AddIntConstant(m, "altzone", altzone); | ||
#else | ||
PyModule_AddIntConstant(m, "altzone", timezone-3600); | ||
#endif | ||
PyModule_AddIntConstant(m, "daylight", daylight); | ||
#endif | ||
otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape"); | ||
otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape"); | ||
PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2926,7 +2926,7 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; } | |
if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info[:2]) == '$PACKAGE_VERSION')"; then | ||
break | ||
fi | ||
interp= | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this line is removed? Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't checked in a regenerated configure yet. What version do you use? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last stable version is 2.69. |
||
|
||
done | ||
if test x$interp = x; then | ||
as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5 | ||
|
@@ -3257,6 +3257,9 @@ then | |
*-*-cygwin*) | ||
ac_sys_system=Cygwin | ||
;; | ||
*-*-vxworks*) | ||
ac_sys_system=VxWorks | ||
;; | ||
*) | ||
# for now, limit cross builds to known configurations | ||
MACHDEP="unknown" | ||
|
@@ -3301,6 +3304,9 @@ if test "$cross_compiling" = yes; then | |
*-*-cygwin*) | ||
_host_cpu= | ||
;; | ||
*-*-vxworks*) | ||
_host_cpu= | ||
;; | ||
*) | ||
# for now, limit cross builds to known configurations | ||
MACHDEP="unknown" | ||
|
@@ -3319,6 +3325,10 @@ fi | |
# wildcard, and that the wildcard does not include future systems | ||
# (which may remove their limitations). | ||
case $ac_sys_system/$ac_sys_release in | ||
# On VxWorks if _XOPEN_SOURCE is defined the socket.h header | ||
# has undefined types. | ||
VxWorks* ) | ||
define_xopen_source=no;; | ||
# 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. | ||
|
@@ -6152,7 +6162,7 @@ esac | |
fi | ||
fi | ||
|
||
if test "$cross_compiling" = yes; then | ||
if test "$cross_compiling" = yes && test "$ac_sys_system" != VxWorks ; then | ||
case "$READELF" in | ||
readelf|:) | ||
as_fn_error $? "readelf for the host is required for cross builds" "$LINENO" 5 | ||
|
@@ -13274,7 +13284,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
fi | ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 | ||
$as_echo "$ac_cv_c_char_unsigned" >&6; } | ||
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then | ||
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes && test "$ac_sys_system" != "VxWorks" ; then | ||
$as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h | ||
|
||
fi | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,6 +377,9 @@ then | |
*-*-cygwin*) | ||
ac_sys_system=Cygwin | ||
;; | ||
*-*-vxworks*) | ||
ac_sys_system=VxWorks | ||
;; | ||
*) | ||
# for now, limit cross builds to known configurations | ||
MACHDEP="unknown" | ||
|
@@ -418,9 +421,12 @@ if test "$cross_compiling" = yes; then | |
_host_cpu=$host_cpu | ||
esac | ||
;; | ||
*-*-cygwin*) | ||
_host_cpu= | ||
;; | ||
*-*-cygwin*) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems this is not indented as above lines. |
||
_host_cpu= | ||
;; | ||
*-*-vxworks*) | ||
_host_cpu=$host_cpu | ||
;; | ||
*) | ||
# for now, limit cross builds to known configurations | ||
MACHDEP="unknown" | ||
|
@@ -509,6 +515,11 @@ case $ac_sys_system/$ac_sys_release in | |
QNX/6.3.2) | ||
define_xopen_source=no | ||
;; | ||
# On VxWorks, defining _XOPEN_SOURCE causes compile failures | ||
# in network headers still using system V types. | ||
VxWorks/*) | ||
define_xopen_source=no | ||
;; | ||
|
||
esac | ||
|
||
|
@@ -4004,7 +4015,10 @@ fi | |
|
||
# checks for compiler characteristics | ||
|
||
AC_C_CHAR_UNSIGNED | ||
# test results in duplicate def of __CHAR_UNSIGNED__ on VxWorks | ||
if test "$ac_sys_system" != "VxWorks" ; then | ||
AC_C_CHAR_UNSIGNED | ||
fi | ||
AC_C_CONST | ||
|
||
works=no | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look correct to me. multiprocessing requires TRUE = 1. I think you should 'undef' the existing TRUE/FALSE and define what multiprocessing expects.