Skip to content
Permalink
Browse files
postprocess-asm/resolve-asm-file-conflicts.rb build failure after upg…
…rading to F34

https://bugs.webkit.org/show_bug.cgi?id=223136

Reviewed by Michael Catanzaro.

When parsing .file assembler directives (for the purpose of
deduplicating the file slots), also accept

  .file "path/to/CWD" "path/to/include"

that seems to be emitted by GCC in some configurations. This also
uses Pathname.cleanpath on the resulting path to canonicalize the
paths. We could use .realpath, but since we only run this on the
paths in a single compilation unit and the first component is
supposed to be the CWD, this both seems unnecessary and would
complicate our selftests.

* Scripts/resolve-asm-file-conflicts.rb:


Canonical link: https://commits.webkit.org/235293@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aoikonomopoulos committed Mar 15, 2021
1 parent aee80d3 commit 8cd4575f261f6bfe2cce69c79812398b35988d50
Showing 2 changed files with 51 additions and 9 deletions.
@@ -1,3 +1,24 @@
2021-03-15 Angelos Oikonomopoulos <angelos@igalia.com>

postprocess-asm/resolve-asm-file-conflicts.rb build failure after upgrading to F34
https://bugs.webkit.org/show_bug.cgi?id=223136

Reviewed by Michael Catanzaro.

When parsing .file assembler directives (for the purpose of
deduplicating the file slots), also accept

.file "path/to/CWD" "path/to/include"

that seems to be emitted by GCC in some configurations. This also
uses Pathname.cleanpath on the resulting path to canonicalize the
paths. We could use .realpath, but since we only run this on the
paths in a single compilation unit and the first component is
supposed to be the CWD, this both seems unnecessary and would
complicate our selftests.

* Scripts/resolve-asm-file-conflicts.rb:

2021-03-14 Alexey Shvayka <shvaikalesh@gmail.com>

REGRESSION (r274308): Two assertions in JSGlobalObject::defineOwnProperty() are failing
@@ -69,16 +69,24 @@ def parse
@s.skip(/\s*/)

# We require at least one string literal
ret = parse_string_literal
if ret.respond_to?(:error)
return ret
ret1 = parse_string_literal
if ret1.respond_to?(:error)
return ret1
end

@s.skip(/\s*/)
if @s.eos?
return ParseResultSuccess.new(Pathname.new(ret1.str).cleanpath.to_s)
end
# If anything follows, it needs to be a string literal
ret2 = parse_string_literal
if ret2.respond_to?(:error)
return ret2
end
if not @s.eos?
return ParseResultError.new("Expected end of line after #{ret.str}")
return ParseResultError.new("Expected end of line after #{ret2.str}")
end
return ParseResultSuccess.new(ret.str)
return ParseResultSuccess.new((Pathname.new(ret1.str) / ret2.str).cleanpath.to_s)
end
def parse_string_literal
if @s.scan(/"/).nil?
@@ -174,13 +182,26 @@ def selftest
['"/bar/baz"', ['/bar/baz']],

# Can detect stray token
['"foo" bar', "Expected end of line"],
['"foo" bar', "Expected string literal"],

# Can detect stray token without whitespace
['"foo"bar', "Expected end of line"],
['"foo"bar', "Expected string literal"],

# Can parse two string literals
['"working_directory" "path"', ['working_directory/path']],

# Will only accept up to 2 string literals
['"first" "second" "third"', "Expected end of line"],

# Can detect stray token after 2nd string literal
['"foo" "bar" baz', "Expected end of line"],

# Can detect stray token after 2nd string literal without whitespace
['"foo" "bar"baz', "Expected end of line"],

# Can detect unterminated 3rd string literal
['"foo" "bar" "baz', "Expected end of line"]

# Will not accept clang-style .file directives
['"working_directory" "path"', "Expected end of line"]
]
outf = StringIO.new("")
tests.each { |str, res|

0 comments on commit 8cd4575

Please sign in to comment.