This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Fix flaky test
ClosedPublic

Authored by jhenderson on Sep 11 2017, 7:41 AM.

Details

Summary

'@' is a valid character in file paths, but the linker script tokenizer treats it as a separate token. I have quoted the path to prevent this happening.

An alternative would have been to add '@' to the list of "unquoted tokens" in ScriptLexer.cpp, but I checked and ld.bfd has the same behaviour as the current LLD, so I have changed the test instead.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Sep 11 2017, 7:41 AM
ruiu edited edge metadata.Sep 11 2017, 8:21 AM

I don't think I understand this patch.

echo "foo bar"

and

echo foo bar

print out the same string "foo bar" (without quotes).

Do you mean

echo "INCLUDE \"%t1.script\"" > %t1.script

?

(Also, where did your '@' character come from? This test doesn't contain '@'.)

Oops. Should have paid more attention!

The '@' comes from the %t. In our build system, there is sometimes an '@' in the workspace where this is run, causing the problem.

ruiu accepted this revision.Sep 11 2017, 8:46 AM

LGTM

Please mention that this patch fixes the issue when your build path contains '@' character, instead of saying that this is flaky.

This revision is now accepted and ready to land.Sep 11 2017, 8:46 AM
This revision was automatically updated to reflect the committed changes.