-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soft floating-point emulation routines leaking into aarch64 #20
Comments
This patch should fix the issue (at least temporarly):
|
@mohamed-karaoui That did the trick. Maybe submit that as a patch via pull request? Thanks!! |
I know this patch fixes this particular problem for EP, but it's not very robust (plus having gigantic alignment directives all over the place balloons the size of the binary). @olivierpierre is there a way we can accumulate the architecture-specific & blacklisted symbol sizes in order to safely align the next section to the correct page across all architectures? |
I'll have to look at this, can we attach the sources for a test case here? In the meantime, I recommend using Mohamed solution, some ideas to make it lighter:
|
@olivierpierre Any program will do, but here's a simple hello world program for fun :) More accurately, anything compiled with Popcorn's |
I believe I've found a better (?) fix that eliminates the soft float libraries altogether. Based on a comment on a StackOverflow question I asked and a post on the llvm-dev listserv, I tracked down the following code in
By changing the last two lines here, I was able to force the
This removed all reference to So far, I've tested this by:
I believe further testing is probably needed (I'll be working with this modified version of the compiler for a while to see if any bugs pop up), but as of right now it's looking promising. |
This is awesome, thanks! Once you verify that it works, you can submit a pull request or let me know if you want me to implement. Just a couple of mental notes here that I don't want to forget:
|
@rlyerly I'm going to test it for another day or two, but I'll try to put together a pull request for at least the ARM changes. |
Additional note: requires modifying |
GCC soft float library routines are leaking into
musl
, which can causeunhandled level 3 translation fault
s in programs. E.g., NPB's EP:Running
objdump
shows:As for where this gets called -- one call-chain (there may be others) is through
pop_arg
inmusl-1.18/src/stdio/vfprintf.c
at line 128:This line appears to get executed whenever
printf
(or related functions) gets called with the%lf
conversion specifier (based on a gdb trace I performed). I tried removing the long modifier (l
), but that didn't seem to change the behavior.I've been investigating how to address this -- ideally, we could eliminate quad precision (128-bit floating point) types and force
long double
s to be the same size asdouble
s (which is allowed by the C standard). That said, I have no idea how to achieve that as of right now.The text was updated successfully, but these errors were encountered: