[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] mintlib wide character overhaul



Hi,

On perjantai 22 helmikuu 2013, Jeffrey Armstrong wrote:
> Hey folks, I've been working on getting Python up and running on MiNT,
> specifically Python 3.3, the current release.  While Python 2.x is
> relatively simple to build under MiNT, there were a number of problems
> with Python 3.  The most notable issue was related to MiNTLib's
> incomplete wide character support.  Unlike earlier Python versions, the
> 3.x series uses unicode almost exclusively internally.
> 
> I first attempted simply providing some of the missing functions, notably
> wcschr() and wcstok(), but the additions weren't adequate.  The wide
> character support in MiNTLib didn't seem to be functional.  If I'm
> mistaken, please feel free to correct me.

Code comments for previous code state that one should use "DUMB" locale.
Did you try that? :-)


> As a solution, I rolled in multibyte and wide character support from the
> musl standard library (http://www.musl-libc.org/), a small libc
> implementation that is MIT-licensed and specializes in efficient static
> linking.  The code now present seems to be functional within MiNTLib.
>
> I've hosted my code on Github based on a CVS pull 2013-01-15 after the
> malloc() bug was committed.  If anyone is interested, the link to the
> modified code is:
> 
> https://github.com/ArmstrongJ/MiNTLib/tree/py3k-improvements
> 
> The changes also incorporate a relatively dumb implementation of
> nl_langinfo and a stand-in sched_yield implementation.

* 
https://github.com/ArmstrongJ/MiNTLib/commit/ee9bdae3036cde3501aadce931da29fda286cb56

Ok, so nl_langinfo supports just C-locale (English / UTF-8)
and locale specific number separators.   Based on sources,
I'm not sure does it support POSIX dates ("date -I" format),
but support for that's a must, as it's the only sortable
date format.

* 
https://github.com/ArmstrongJ/MiNTLib/commit/f2555bc73d9f03ed12bd18a3a9b7c99da73e8cd7

What's the inline math problem with old GCC?  It doesn't support it at all?

* 
https://github.com/ArmstrongJ/MiNTLib/commit/cb6a350f7ac9f88f692dc1c5db604e21cc9f3ff0

Why -fwrapv is removed from time objects build options?
Based on its description in GCC manual, it can change results.

* 
https://github.com/ArmstrongJ/MiNTLib/commit/6d188b1f756a09382b80477a043f8e4b8749189c

Does usleep(1) sched_yield implementation allow other threads to be
scheduled?  Or is that small loop done in-process in usleep() for
performance reasons?

* 
https://github.com/ArmstrongJ/MiNTLib/commit/e772a4670f5c451a0469437a9775651789959461

Does MiNT support syscall restarts at all?



> Everything compiles fine under GCC 2.95 and one of the MiNT-hosted GCC
> 4.x builds available.
> 
> Additionally, with these changes, Python 3.3 builds and runs fine under
> MiNT (with one pending Python core patch and one committed Python core
> patch) using GCC 2.95.  I'm guessing it'll build fine under 4.x if
> anyone's interested.

Do you just build Python, or also run all of its supplied tests succesfully?
(I've never built Python myself, but I know it has such things.)


 
> I'm hoping people might be interested in pulling in these changes to
> MiNTLib's CVS.  Any comments on the code are welcome!

I'm not MiNTlib maintainer, but in general your patches looked fine. :-)


	- Eero