-
Notifications
You must be signed in to change notification settings - Fork 3.5k
PRINTF_LONG_DOUBLE option #11130
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
PRINTF_LONG_DOUBLE option #11130
Conversation
|
One option would be to make a separate |
|
How would that get built @sbc100 ? |
|
It could be a new library just includes Then the main libc could be unchanged/shared. |
|
I see, thanks @sbc100 - rewritten to be that way now, much better I think! |
tools/system_libs.py
Outdated
|
|
||
| # to override the normal libc printf, we must come before it | ||
| if shared.Settings.PRINTF_LONG_DOUBLE: | ||
| libs_to_link = [(system_libs_map['libprintf_long_double'].get_path(), True)] + libs_to_link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can, I would put this on line 1577 right before libc (using the same add_library helper)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that same goes for jsmath too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow? Line 1577 is
for haz in has_syms:
if haz in need_syms:
# remove symbols that are supplied by another of the inputs
need_syms.remove(haz) # This is 1577..?
if shared.Settings.VERBOSE:
logger.debug('considering %s: we need %s and have %s' % (lib.name, str(need_syms), str(has_syms)))So I'm not sure where you are suggesting to put this. But maybe the bigger issue is that this can't be moved earlier - it has to be after the sort operation on line 1641.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need to sync to head?
This line should come just before: add_library(system_libs_map['libc']).. order is important for all of the add_library function here.
The sort operations are are only for specific cases.. they won't apply to libc or this library (I will try to remove them.. they are porbably not needed anymore since that most recent changes here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
(Oh, I assumed when you said line numbers they were relative to this PR... otherwise which HEAD would I look at..? it can keep changing outside. Is there a convention I'm not aware of?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just just been lazy to looking at my local line numbers... Your are right its not a very accurate way to communicate file positions :)
sbc100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
sbc100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
Add a libc variation that supports full long double precision printing.
It turns out that adding this is not that hard, building on the existing
work we've already done there.
One thing I dislike here is that an additional libc variation means we
double the number of libc builds, and the size of the libc builds in
the emsdk, I believe? I wonder if maybe this should not be built by
embuilder by default or something like that.