On Thursday, August 08, 2013 01:58:41 PM Jiri Svoboda wrote: > Hi Zbigniew, > > Zbigniew Halas wrote: > > I was thinking of that approach as well. The only drawback is that some > > libm > > > functions (or rather stubs) are implemented as part of HelenOS POSIX > > library > > > and they are required to build some components being part of HelenOS > > (binutils > > > at least). > > These are apparently stubs and there is no reason why math functions should > be in the POSIX library. > > > It could be solved by using proper linking order or by separating libm > > functions from POSIX library which will allow to link POSIX library > > independently from libm. > > If you think it's a proper solution I will do that. > > I don't think that's the way to do it. Why should we have two different > copies of the functions, one working and one non-working?
It's Jakub's idea to keep libm outside of HelenOS, and if we are going to keep binutils inside of HelenOS we still need that stuff. > Clearly the stub > functions in POSIX library were introduced to allow binutils to build. If > you replace them with fully working versions (located elsewhere), there > should be no problem. Yes, but to do that we need to have whole math library in HelenOS. > Can you elaborate? Is the problem Python (core? optional component?) > refusing to compile? compiles but not working properly? Both, there are some functions required for core interpreter and some more for loadable modules (like math). Stubs for all the functions required by core interpreter were introduced in mainline,1793 and there are plenty of them. They are required as there are built in types that use float (float, complex). > "I'm planning to integrate > > > > openlibm (https://github.com/JuliaLang/openlibm/) with Helenos. > > > which is meant to be a standalone math library. It's based on FreeBSD's > > > msun library (which is in turn based on Sun's fdlibm). > > > As it's standalone it should be easier to port than FreeBSD's msun > > > library, > > > and actually I managed to build it for ia32 architecture (with a few > > dirty > > > > hacks) in not too long time and try it with Python. > > > > > > What are you thoughts on integrating openlibm into Helenos?" > > From licensing point of view it seems okay. I am still very wary of > introducing any foreign code in HelenOS (especially for a core component). I > am also dubious that it is strictly necessary to get basic Python up and > running. For example, why would Bazaar running in Python need a working > cos( ) function to work? If it's a build dependency, a stub function would > do the trick.... These are both build and run time dependencies and any non trivial-module will crash without some float point functions being implemented. My port had to have site.py module (the one run automatically during the startup sequence) disabled, because it made Python crash with function not implemented error way before any attempt to run user code. > Even if some specific math functionality was needed, I think implementing it > from scratch wouldn't be too difficult either. We already have softint and > softfloat libraries which provide some of the runtime support needed for > basic int and float operations. They may not be perfect, but they do the > job. Totally don't agree. Writing any usable math library is a very complex task - you need to handle properly many edge cases +/-0, infinities, nans and whatever special values are there, you need to use different methods on different intervals due to accuracy reasons and so on, please just look at fdlibm. And then there is huge amount of testing and debugging. This is probably the reason why I haven't seen any mathematical library not based on fdlibm in the wild. Also I don't see any value added in implementing math library from scratch, especially that math library provides just "pure" functions without side effects that for given input return always the same result, so it's extremely hard to bring any innovation to this area. Cheers, Zbigniew _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
