[haiku-development] Fixing pow

  • From: "Mark Hellegers" <mark@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 01 Jun 2014 23:13:25 +0200 CEST

[Repost from HaikuPorts-devs on the advice of Augustin Cavalier]

Hello all,

a while ago I reported ticket #9962 (pow returns nan instead of inf for 
large results) on dev.haiku-os.org, but it hasn't been solved yet. I 
can understand that there are higher priority bugs on everyones list 
than this one, so that is not a problem with me. However, I would like 
to get it resolved as it is (or at least was a few months ago) the last 
roadblock in getting a "make test" run succesful for Postgresql (with 
some patches I have), so I looked into the problem myself.
I donwloaded the latest version of glibc and had a look where the pow 
function was implemented and tried to copy it over the version of 
Haiku.
I'm now (of course) running into a problem with this approach and I 
would like some advice on how to approach it. Apparently, there is an 
assembler optimized version of pow available, so I copied over those 
files, but when I run jam it now fails. Running the gcc command for the 
failed file itself, results in a number of the following error 
messages:
src/system/libroot/posix/glibc/arch/x86/e_pow.S: Assembler messages:
src/system/libroot/posix/glibc/arch/x86/e_pow.S:89: Error: invalid 
character '_' in mnemonic

This error is repeated for a number of lines and seems to point to the 
cfi_adjust_cfa_offset pseudo op that is at each of these lines. I did a 
bit of digging and it seems that this is supported by the gnu 
assembler, but I haven't been able to figure out which version these 
kind of pseudo ops were added and if these ops should work in the 
version used by Haiku.
My investigation into my problem with pow now threatens to escalate a 
bit beyond my understanding of it all, so I would like to get a bit of 
advice here.
Is there a way to get this working with a result in a minimal patch to 
get pow working or is it likely that this will result in upgrading of 
some components of Haiku (gnu assembler and or glibc), which is way 
above my head?

Thanks for any help,

Mark Hellegers


--
Spangalese for beginners:

`Maloya coy hoba huba.'
`My tapeworm washed the car.'



Other related posts: