Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

stinos
Copy link
Contributor

@stinos stinos commented Nov 20, 2015

Changes to nlr as per comments to #1632

Sidenote: the nlrx64.S implementation (originally enabled just for cygwin ) compiles fine using both cygwin and mingw gcc versions but it might be broken as the produced executables do not function for me on two different machines. The cygwin one just exits with no info whatsoever, the mingw one hits the second assert(!"bad free"); in gc_free() and segfaults from the moment anything is interpreted/executed.

@stinos stinos changed the title Windows gcc build fix 64bit mingw build support Nov 20, 2015
@dpgeorge
Copy link
Member

I'm ok with this, but I did not test it.

I guess the nlrx64.S stuff can be fixed some other time.

The BSD stuff is a copy from the unix makefile but at least there it
makes some sense, a windows makefile on BSD doesn't.
The -lmman flag is probably for mmap functions but there is no other build
support for it on windows so just that flag won't cut it anyway.
- add mp_int_t/mp_uint_t typedefs in mpconfigport.h
- fix integer suffixes/formatting in mpconfig.h and mpz.h
- use MICROPY_NLR_SETJMP=1 in Makefile since the current nlrx64.S
  implementation causes segfaults in gc_free()
- update README
@stinos stinos force-pushed the windows-gcc-build-fix branch from 38cef76 to e200254 Compare November 23, 2015 19:36
@stinos
Copy link
Contributor Author

stinos commented Nov 23, 2015

Rebased it against latest changes and all tests still pass, except machine_mem/meminfo/math_fun. First two because they are made for unix port (never got to making them skip) and the last one because mingw prints -0 instead of plain 0 in some places but that's the only difference.

I dont have the knowledge myself for fixing the x64 assembly.

@pfalcon
Copy link
Contributor

pfalcon commented Nov 23, 2015

math_fun. First two because they are made for unix port (never got to making them skip) and the last one because mingw prints -0 instead of plain 0 in some places but that's the only difference.

Since yesterday, libc no longer prints floats, uPy itself does.

@stinos
Copy link
Contributor Author

stinos commented Nov 23, 2015

The Makefile doesn't yet have utils/printf.c

@pfalcon
Copy link
Contributor

pfalcon commented Nov 23, 2015

It's handled by py/formatfloat.c

@stinos
Copy link
Contributor Author

stinos commented Nov 24, 2015

Then I guess migw's asinh (and others) returns -0?

@pfalcon
Copy link
Contributor

pfalcon commented Nov 24, 2015

Bottom line is that I'd like to have a look first.

@pfalcon
Copy link
Contributor

pfalcon commented Nov 24, 2015

Ok with revision of ede1f54:

6 tests failed: repl_basic repl_cont repl_emacs_keys machine_mem math_fun import_file

--- math_fun.py.exp 2015-11-24 17:04:23.279753791 +0200
+++ math_fun.py.out 2015-11-24 17:04:23.279753791 +0200
@@ -68,7 +68,7 @@
 -1.0379
 -0.88137
 -0.48121
-0
+-0
 0.48121
 1.0379
 5.2983

With master:

10 tests failed: repl_basic repl_cont repl_emacs_keys machine_mem complex1 float1 math_fun string_format string_format_modulo import_file

--- float1.py.exp   2015-11-24 17:23:33.533898466 +0200
+++ float1.py.out   2015-11-24 17:23:33.533898466 +0200
@@ -15,8 +15,8 @@
 inf
 inf
 inf
-nan
-nan
+-nan
+-nan
 ValueError
 ValueError
 False

@stinos , you know how to handle it - pull in known good asinh and others, and skip libc/libm altogether ;-). So, you'd better say of you don't like that (but then you should be ready to move pendulum in the other direction yourself - like, I thought that it would be nice to have either own routine for float printing, or recurse to libc. But as you can see, I just removed printing-via-libc code, because maintaining that "would be nice" is a chore).

@pfalcon
Copy link
Contributor

pfalcon commented Nov 24, 2015

Merged, thanks.

@dpgeorge
Copy link
Member

Note that uPy has some difference with CPy wrt nan: if you do float("-nan") then uPy prints the - while CPy does not.

@stinos stinos deleted the windows-gcc-build-fix branch November 25, 2015 08:43
@stinos
Copy link
Contributor Author

stinos commented Nov 25, 2015

So, you'd better say of you don't like that

I was never planning to very actively support the mingw port: I have no real use for it myself (except that I can build same source tree locally with gcc without needing to ssh to a unix box) so I just try to make sure it keeps on building and running tests with most features working. Which it does apart from apparent corner case asinh and modf behaviour and I don't consider that problematic enough to work on it. On the other hand, on a lazy sunday afternoon I might do it anyway :]

@stinos
Copy link
Contributor Author

stinos commented Nov 25, 2015

@pfalcon
Copy link
Contributor

pfalcon commented Nov 25, 2015

Thanks for submitting those!

I was never planning to very actively support the mingw port:

Ah, right, even if own implementations will be added for mingw, they won't affect msvc build. But then it will be just unneeded discrepancy which may lead to confusion. Anyone, I don't plan to make changes for that any time soon, but then suddenly I can start and make them, so wanted to make sure you're in loop.

tannewt added a commit to tannewt/circuitpython that referenced this pull request Mar 14, 2019
This should allow you to use SWD pins unless a debugger is attached.
You may have trouble connecting to SWD when CircuitPython has already
begun using them.

Fixes micropython#1633
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants