Comments (6)
Expand the definition of this ticket to include all the VM changes needed for
Tyler
to add his port to windows (from emails 04/22, 04/23):
- Updated the SCons build to work on Windows. Note there are two small
changes needed to the src/vm/SConstruct file:
Change 1:
img_sources = env.Command(["pmstdlib_img.c", "pmstdlib_nat.c"],
[PMSTDLIB_SOURCES],
"%s src/tools/pmImgCreator.py -c -s -o src/vm/pmstdlib_img.c" \
" --native-file=src/vm/pmstdlib_nat.c $SOURCES" %
(sys.executable))
Note that I need to explicitly use the path to the Python exe to use,
since we cannot use the #!/usr/bin/python bash trick. This should also
work on Linux - at least it works under cygwin.
Change 2:
if sys.platform != "win32":
env['ARFLAGS'] = "rcs"
lib = env.Library("pmvm_%s" % vars.args["PLATFORM"], SOURCES +
img_sources)
Note that the MS 'librarian' does not understand the 'rcs' flags, so
we only add those in the non-Windows case.
- I changed the timer from a standard Windows timer to a Windows
'multi-media' timer. This obviates the need to have the message queue
called all the time. thus it also does not need the custom plat_tick
function that was added.
- I created a stdint.h and placed it in the src\platform\windows
folder. This allows us to use the core vm source unchanged. Though I
suspect this could cause issues doen the road with mingw or some other
compiler.
- I used the pmfeatures.h to place some compiler-specific defines,
also to eliminate the need to change any of the core source files.
Fortunately, Dean uses a model where all code includes pm.h, which
then includes pmfeatures.h - this reall simplifies things.
==================================
Sorry, there is one more small change needed to the core source code
to make it compatible with the Microsoft C/C++ compiler. The MS
compiler does not fully support the C99 standard, and so some features
that are accepted with GCC are not accepted my MSC.
The only issue I have found thus far is in interp.c, line 707, when
__DEBUG__ is set: the paddr variable is declared after executable
statements in the case block. It adds a few lines, but this is what I
did:
case RETURN_VALUE:
{
#if __DEBUG__
uint8_t const *paddr = 0;
#endif
/* Get expiring frame's TOS */
pobj2 = PM_POP();
#if __DEBUG__
/* #109: Check that stack should now be empty */
/* Get the number of local variables for this code obj
*/
paddr = FP->fo_func->f_co->co_codeimgaddr
+ CI_STACKSIZE_FIELD + 1;
t8 = mem_getByte(FP->fo_func->f_co->co_memspace,
&paddr);
/* SP should point to one past the end of the locals
*/
/* C_ASSERT(SP == &(FP->fo_locals[t8]));*/
#endif
...
}
Note the two changes:
1. Adding braces to make a local block scope.
2. Moving the paddr declaration to the beginning of the block.
Also note that if you wish, the '-Wdeclaration-after-statement' flag
can be added to the GCC build, and it will error if this usage occurs
again. I tested this with the cygwin desktop build, and it finds the
issue.
I know you wanted to keep the number of changes to support Windows at
a minimum, and this is quite inconvenient to work around a 'broken'
compiler, but I still (currently) think it is worthwhile.
Original comment by [email protected]
on 17 May 2009 at 9:51
from python-on-a-chip.
Made changes listed above as well as those in the README of the
windows_08_a.zip file
that Tyler posted in the python-on-a-chip files section.
No new tests. make check passes.
Mainlined directly, see r365
Original comment by [email protected]
on 18 May 2009 at 8:09
- Changed state: Started
from python-on-a-chip.
Don't know why this wasn't marked "Fixed" back in May.
Original comment by [email protected]
on 25 Feb 2010 at 9:35
- Changed state: Fixed
- Added labels: Milestone-r10
from python-on-a-chip.
Changing Milestone-r10 to Milestone-r09
Original comment by [email protected]
on 7 Mar 2010 at 6:26
- Added labels: Milestone-r09
from python-on-a-chip.
Changed r09 to R09
Original comment by [email protected]
on 12 Mar 2010 at 8:22
from python-on-a-chip.
Original comment by [email protected]
on 13 Mar 2010 at 1:30
- Added labels: Milestone-09
from python-on-a-chip.
Related Issues (20)
- Remove pycscope from tools HOT 1
- Multithread HOT 1
- running ipm in Windows desttop
- Create new platform darwin with xcode project HOT 2
- false positive in string/sequence comparison HOT 1
- Patch for /src/lib/dict.py
- PIC32 support? HOT 4
- Linker trouble due to ordering of files HOT 1
- Compiler warning when shifting an 8-bit value beyond 8 bits HOT 1
- Implement SLICE_1,2,3 HOT 2
- Fix string cache
- Implement the simplest form of try/catch HOT 1
- Fix compile system so string cache can be disabled
- Fix sys.time overflow HOT 3
- Fix build break when HAVE_SNPRINTF_FORMAT is false HOT 4
- Fix C_NULL for C++ compiler HOT 3
- Unable to build v10 posix64 HOT 1
- support for user data types
- functions assigned to a class attribute are promoted to members HOT 1
- empty string assignment produces garbage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-on-a-chip.