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

BaseTools/AutoGen: GenMake response file quotes strings #10697

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdkinney
Copy link
Member

Description

If command line options are moved into a response file of a GCC family build, then the file path separators are converted from '\' to '/'. However, this can corrupt command line options that are quoted strings.

Update GenMake to no convert '\' to '/' in quoted strings.

  • Breaking change?
  • Impacts security?
  • Includes tests?

How This Was Tested

Added CC_FLAGS to EmulatorPkg build to increase line length to force response file generation and added additional command line parameters with various file paths and quoted strings:

Input Before Change Correct After Change
"Hello" "Hello" YES "Hello"
L\"Hello\" L/"Hello/" NO L\"Hello\"
"a/b/c/d" "a/b/c/d" YES "a/b/c/d"
"a\b\c\d" "a/b/c/d" NO "a\b\c\d"
L\"a/b/c/d\" L/"a/b/c/d/" NO L\"a/b/c/d\"
L\"a\b\c\d\" L/"a/b/c/d/" NO L\"a\b\c\d\"
a/b/c/d a/b/c/d YES a/b/c/d
a\b\c\d a/b/c/d YES a/b/c/d

Integration Instructions

N/A

If command line options are moved into a response file
of a GCC family build, then the file path separators are
converted from '\' to '/'. However, this can corrupt
command line options that are quoted strings.

Update GenMake to no convert '\' to '/' in quoted strings.

Signed-off-by: Michael D Kinney <[email protected]>
@mdkinney mdkinney marked this pull request as ready for review January 31, 2025 01:44
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.

1 participant