Skip to content

Defer linker input unused and no input files warnings to clang. NFC #20905

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
Dec 12, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 12, 2023

Rather than removing any linker-only flags early on, we now allow those to be
passed onto clang so that:

(a) clang can take care of reporting warning about them so we don't have to
(b) we can exit early, paving the way for the use of os.execv when we run clang

Split out from #20884

@sbc100 sbc100 requested review from kripken and dschuff December 12, 2023 18:03
@sbc100 sbc100 changed the title Defer 'linker' input unused warnings to clang. NFC Defer 'linker' input unused and no input files warnings to clang. NFC Dec 12, 2023
@sbc100 sbc100 changed the title Defer 'linker' input unused and no input files warnings to clang. NFC Defer linker input unused and no input files warnings to clang. NFC Dec 12, 2023
@sbc100 sbc100 enabled auto-merge (squash) December 12, 2023 18:04
@sbc100 sbc100 force-pushed the early_exit_compile branch 2 times, most recently from b260667 to 1e0b354 Compare December 12, 2023 20:46
@@ -764,33 +759,24 @@ def phase_setup(options, state, newargs):
input_files.append((i, arg))
elif arg.startswith('-L'):
state.add_link_flag(i, arg)
newargs[i] = ''
Copy link
Member

Choose a reason for hiding this comment

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

trying to understand what this part of the change is for...
previously we were removing the flag from the list and now aren't, so that it gets passed through to clang and clang can warn?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes exactly. If we simply allow all these flags to pass through to clang then clang can take care of issuing the warning instead of us. . which simplifies the code and paves that way for os.execv to be used.

Copy link
Member

Choose a reason for hiding this comment

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

ok thanks, can you put something to that effect in the commit message?

@sbc100 sbc100 force-pushed the early_exit_compile branch from 1e0b354 to 378a0aa Compare December 12, 2023 21:00
@sbc100 sbc100 disabled auto-merge December 12, 2023 21:02
@sbc100 sbc100 enabled auto-merge (squash) December 12, 2023 21:02
@sbc100 sbc100 force-pushed the early_exit_compile branch 2 times, most recently from a89a69b to 64bbd67 Compare December 12, 2023 22:29
@sbc100 sbc100 force-pushed the early_exit_compile branch from 64bbd67 to 3f0eabc Compare December 12, 2023 23:40
@sbc100 sbc100 disabled auto-merge December 12, 2023 23:40
@sbc100 sbc100 merged commit 569e4fa into emscripten-core:main Dec 12, 2023
@sbc100 sbc100 deleted the early_exit_compile branch December 12, 2023 23:50
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 21, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 21, 2024
sbc100 added a commit that referenced this pull request Jan 22, 2024
This change partially reverts #20905.

Fixes: #21116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants