bpo-31904: Add cross-build support for VxWorks RTOS by pxinwr · Pull Request #11968 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Include/osdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable build system to cross-build for VxWorks RTOS.
21 changes: 19 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3268,6 +3268,9 @@ then
*-*-cygwin*)
ac_sys_system=Cygwin
;;
*-*-vxworks*)
ac_sys_system=VxWorks
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
Expand Down Expand Up @@ -3312,6 +3315,9 @@ if test "$cross_compiling" = yes; then
*-*-cygwin*)
_host_cpu=
;;
*-*-vxworks*)
_host_cpu=$host_cpu
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
Expand Down Expand Up @@ -3399,6 +3405,11 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h
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

Expand Down Expand Up @@ -5283,6 +5294,8 @@ cat >> conftest.c <<EOF
i386-gnu
#elif defined(__APPLE__)
darwin
#elif defined(__VXWORKS__)
vxworks
#else
# error unknown platform triplet
#endif
Expand Down Expand Up @@ -9391,7 +9404,7 @@ then
BLDSHARED="$LDSHARED"
fi
;;
Linux*|GNU*|QNX*)
Linux*|GNU*|QNX*|VxWorks*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
Expand Down Expand Up @@ -9472,6 +9485,8 @@ then
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
VxWorks*)
CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5
Expand Down Expand Up @@ -9530,6 +9545,8 @@ then
# to 2048 kilobytes so that the stack doesn't overflow
# when running test_compile.py.
LINKFORSHARED='-Wl,-E -N 2048K';;
VxWorks*)
LINKFORSHARED='--export-dynamic';;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5
Expand Down Expand Up @@ -15079,7 +15096,7 @@ $as_echo "$SOABI" >&6; }


case $ac_sys_system in
Linux*|GNU*|Darwin)
Linux*|GNU*|Darwin|VxWorks)
EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
*)
EXT_SUFFIX=${SHLIB_SUFFIX};;
Expand Down
21 changes: 19 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ then
*-*-cygwin*)
ac_sys_system=Cygwin
;;
*-*-vxworks*)
ac_sys_system=VxWorks
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
Expand Down Expand Up @@ -423,6 +426,9 @@ if test "$cross_compiling" = yes; then
*-*-cygwin*)
_host_cpu=
;;
*-*-vxworks*)
_host_cpu=$host_cpu
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
Expand Down Expand Up @@ -507,6 +513,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

Expand Down Expand Up @@ -829,6 +840,8 @@ cat >> conftest.c <<EOF
i386-gnu
#elif defined(__APPLE__)
darwin
#elif defined(__VXWORKS__)
vxworks
#else
# error unknown platform triplet
#endif
Expand Down Expand Up @@ -2555,7 +2568,7 @@ then
BLDSHARED="$LDSHARED"
fi
;;
Linux*|GNU*|QNX*)
Linux*|GNU*|QNX*|VxWorks*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
Expand Down Expand Up @@ -2634,6 +2647,8 @@ then
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
VxWorks*)
CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
esac
fi
AC_MSG_RESULT($CCSHARED)
Expand Down Expand Up @@ -2690,6 +2705,8 @@ then
# to 2048 kilobytes so that the stack doesn't overflow
# when running test_compile.py.
LINKFORSHARED='-Wl,-E -N 2048K';;
VxWorks*)
LINKFORSHARED='--export-dynamic';;
esac
fi
AC_MSG_RESULT($LINKFORSHARED)
Expand Down Expand Up @@ -4578,7 +4595,7 @@ AC_MSG_RESULT($SOABI)

AC_SUBST(EXT_SUFFIX)
case $ac_sys_system in
Linux*|GNU*|Darwin)
Linux*|GNU*|Darwin|VxWorks)
EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
*)
EXT_SUFFIX=${SHLIB_SUFFIX};;
Expand Down
24 changes: 12 additions & 12 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,6 @@
/* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN

/* Define to 1 if you must link with -lrt for shm_open(). */
#undef SHM_NEEDS_LIBRT

/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H

/* Define to 1 if you have the shm_open syscall */
#undef HAVE_SHM_OPEN

/* Define to 1 if you have the shm_unlink syscall */
#undef HAVE_SHM_UNLINK

/* Define to 1 if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H

Expand Down Expand Up @@ -930,6 +918,12 @@
/* Define to 1 if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H

/* Define to 1 if you have the `shm_open' function. */
#undef HAVE_SHM_OPEN

/* Define to 1 if you have the `shm_unlink' function. */
#undef HAVE_SHM_UNLINK

/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION

Expand Down Expand Up @@ -1109,6 +1103,9 @@
/* Define to 1 if you have the <sys/mkdev.h> header file. */
#undef HAVE_SYS_MKDEV_H

/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H

/* Define to 1 if you have the <sys/modem.h> header file. */
#undef HAVE_SYS_MODEM_H

Expand Down Expand Up @@ -1383,6 +1380,9 @@
/* Define if setpgrp() must be called as setpgrp(0, 0). */
#undef SETPGRP_HAVE_ARG

/* Define to 1 if you must link with -lrt for shm_open(). */
#undef SHM_NEEDS_LIBRT

/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
#undef SIGNED_RIGHT_SHIFT_ZERO_FILLS

Expand Down
46 changes: 32 additions & 14 deletions setup.py