Skip to content
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

cc link puts target_linkflags into rspfile to resolve --whole-archive input exceed maximal length of bash #1049

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

noanswer
Copy link
Contributor

Based on fix: exceed maximal length of bash when linking #927, put the target_linkflags parameters into rspfile

If the target depends on too many proto_library or use too many link_all_symbols on purpose, the --whole-archive may be too long to break the max length of bash single argument.

Ninja will start any command with /bin/sh -c "{command}". The command will act as a single argument in bash.

Query single argument max length: printf %d $((32 * $(getconf PAGE_SIZE) ))

@chen3feng
Copy link
Owner

UT failed. You can remove the failed tests or try to run tests in the non-rspfile mode.

@noanswer noanswer changed the title put target_linkflags into rspfile to resolve --whole-archive input exceed maximal length of bash cc link put target_linkflags into rspfile to resolve --whole-archive input exceed maximal length of bash Dec 19, 2024
@noanswer noanswer changed the title cc link put target_linkflags into rspfile to resolve --whole-archive input exceed maximal length of bash cc link puts target_linkflags into rspfile to resolve --whole-archive input exceed maximal length of bash Dec 19, 2024
@chen3feng chen3feng merged commit de255d4 into chen3feng:master Dec 27, 2024
7 checks passed
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