Skip to content

Conversation

@kuhlenough
Copy link

@kuhlenough kuhlenough commented Oct 30, 2017

This pull request enables cpython to cross-build on VxWorks (the world’s leading RTOS and the only interplanetary OS)

This does not provide complete configuration of all target systems possible. It's assumed that the user is familiar with automake cross-builds and has called ./configure with the appropriate environment (CFLAGS,LDFLAGS, CC,CCP, etc) and appropriate site.config and configuration arguments.

VxWorks 7 currently supports Intel, ARM and PowerPC processors running in 32bit and 64bit mode compiled with GCC, ICC, a llvm/clang variant, or Wind River’s Diab compiler. So the verification matrix is large and subsequent pull requests will address the various variants as they are validated.

This pull also also includes some support for automake's --enable-shared=no functionality. If this non-default flag is set, various targets and flags are disabled in Make.pre.in and thus the generated Makefile


Validated with GCC 4.8.1.10 as provided with VxWorks 7

. ./vxworks_env.sh && \
./configure --host=x86-wrs-vxworks --prefix=/yow-build40-lx1/bkuhl/workspace/vsbSim/usr/root \
--bindir=/yow-build40-lx1/bkuhl/workspace/vsbSim/usr/root/gnu/bin --includedir=/yow-build40-lx1/bkuhl/workspace/vsbSim/usr/h/public \
--libdir=/yow-build40-lx1/bkuhl/workspace/vsbSim/usr/lib/common  --build=i686-linux-gnu  --cache-file=config.vx.app --with-libm=no --with-ensurepip=no --with-suffix=.vxe

.. and an appropriate site.config

#! /bin/sh
# config.vx.app - autoconf configuration file for VxWorks
#
# Copyright (c) 2017  Wind River Systems, Inc.
#
# This software is released under the terms of the 
# Python Software Foundation License Version 2
# included in this repository in the LICENSE file
# or at https://docs.python.org/3/license.html
#
# modification history
# -------------------- 
# 23sep17,brk  create
	

	#defined in UNIX layer, but just a wrapper to select()
	ac_cv_func_poll=no
	 
	# forces define of PY_FORMAT_LONG_LONG (Python)
	ac_cv_have_long_long_format=yes

	#Python wants these explicit when cross compiling
	
	ac_cv_file__dev_ptmx=no
	ac_cv_file__dev_ptc=no
	
	ac_cv_buggy_getaddrinfo=no
	
	ac_cv_func_gettimeofday=yes
	
	#ignore empty header in UNIX layer
	ac_cv_header_langinfo_h=no

        #avoid not finding pthread in various extra libs, 
        ac_cv_pthread_is_default=yes

        #gcc fails to compile endian test
        case $host in 
                 ppc*-vxworks )
                        ac_cv_c_bigendian=yes ;;
                 arm*-vxworks )
                        ac_cv_c_bigendian=no ;;
                 x86*-vxworks )
                        ac_cv_c_bigendian=no ;;
                 mips*-vxworks )
                        ac_cv_c_bigendian=yes ;;
        esac

https://bugs.python.org/issue31904

#endif
if (msg->msg_controllen < 0)
return 0;
if (space < cmsg_len_end)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mistake will have recall the pull request and move this back where it was orignally

if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info[:2]) == '$PACKAGE_VERSION')"; then
break
fi
interp=
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could restore this?
But I'm not sure it's necessary?
Do you automatically rewrite ./configure and check in ./configure.ac has changed, or do I need to supply it in my pull?
If I do need to provide an updated ./configure in the pull, do I have to use a specific version of autotools ( I notice this one is a bit dated ?)


ext = Extension('_ctypes',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be restored

@kuhlenough kuhlenough changed the title Python should support VxWorks RTOS ( 31904 ) bpo-31904 : Python should support VxWorks RTOS Oct 30, 2017
@kuhlenough kuhlenough closed this Oct 30, 2017
All doesn't include shared if static build
Hardwire asscii encoding for VxWorks
default to UTF-8 (like Android)
Semicolon as path separator
If build is configure'd for static, propigate to Makefile
Add detection for oddly named VxWorks OPENSSL and HASH libraries
Fix some warnings with unused functions and macro re-def
Extra include in faulthandler.c
Avoid duplicate macro definition
Setup.py complies all VxWorks compatible modules
Update some extension modules to compile on VxWorks
VxWorks does not have "timezone" and daylight "constants"
Limited signal fields in VxWorks
undef DATE TIME for VxWorks
@kuhlenough kuhlenough reopened this Oct 30, 2017
@kuhlenough kuhlenough closed this Oct 30, 2017
@kuhlenough kuhlenough mannequin mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants