Skip to content

Exclude scalbnf.c from LTO #20215

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

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ jobs:
title: "core3+extras"
test_targets: "
lto2.test_dylink_syslibs_all
lto2.test_float_builtins
lto0.test_exceptions_allowed_uncaught
core3
core2g.test_externref
Expand Down
1 change: 1 addition & 0 deletions test/core/test_float_builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ int test_builtins() {
TEST(fmin)
TEST(fmod)
TEST(scalbn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalbn was already in this test it seems, so I was wondering why didn't we see an error before, and looks like we don't run the test in LTO mode. Maybe we should add a variation on the test for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do run the entire lto2 test suite on the emscripten-releases builder.

But I will add this specific test to the github CI too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lto2.test_float_builtins passes fine on main .. so I guess its not enough to just reference scaldnf. This is why the repo cases requires ldexp.. I'm not 100% why this is.. but something to do with the fact the symbol gets indirectly pulled in...

TEST(ldexp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add ldexp in this PR specifically?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that is reproducer of this the failure. See #19781 (comment)


TEST(pow)
TESTI(powi)
Expand Down
1 change: 1 addition & 0 deletions test/core/test_float_builtins.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __builtin_fmax 0.567800 : 1.010100 : 12.012300
__builtin_fmin 0.123400 : 0.101010 : 3.320100
__builtin_fmod 0.123400 : 0.101010 : 2.052000
__builtin_scalbn 0.123400 : 1.010100 : 96.098400
__builtin_ldexp 0.123400 : 1.010100 : 96.098400
__builtin_pow 0.304824 : 1.001016 : 3841.199350
__builtin_powi 0.000000 : 2.421390 : 101648962858951235671184182497867417669061891127967232769386628692937206561802464554722378383360.000000
inf : 3.091515 : 3.091515 : 1
Expand Down
3 changes: 2 additions & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,8 @@ def get_libcall_files(self):
'__math_oflow.c', '__math_oflowf.c',
'__math_uflow.c', '__math_uflowf.c',
'__math_invalid.c', '__math_invalidf.c', '__math_invalidl.c',
'pow.c', 'pow_data.c', 'log.c', 'log_data.c', 'log2.c', 'log2_data.c'
'pow.c', 'pow_data.c', 'log.c', 'log_data.c', 'log2.c', 'log2_data.c',
'scalbnf.c',
]
math_files = files_in_path(path='system/lib/libc/musl/src/math', filenames=math_files)

Expand Down