This is an archive of the discontinued LLVM Phabricator instance.

[LLD][COFF] Convert file name to lowercase when inserting it into visitedLibs
ClosedPublic

Authored by pzheng on Jun 13 2022, 7:47 PM.

Details

Summary

It seems to be a bug in LinkerDriver::findFile, the file name is not converted
to lowercase when being inserted into visitedLibs. This is the only exception
in the file and all other places always convert file names to lowercase when
inserting them into visitedLibs (or visitedFiles).

Diff Detail

Event Timeline

pzheng created this revision.Jun 13 2022, 7:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 7:47 PM
pzheng requested review of this revision.Jun 13 2022, 7:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 7:47 PM
hans added a comment.Jun 14 2022, 4:19 AM

Looks right to me. Should there be a test for this?

Yep seems correct to me as well - but I think we need a test.

pzheng updated this revision to Diff 436875.Jun 14 2022, 11:59 AM

Add a test case

Thanks for the feedback, @hans and @thieta. I have added a test case which can trigger the bug.

Thanks for the test - but I am not sure it should be a part of nodefaultlib? Is there a reason you didn't add it as it's own test?

I guess it's a little weird to piggyback the test into nodefaultlib.test. :) Will put it into a new test instead.

pzheng updated this revision to Diff 436890.Jun 14 2022, 12:38 PM

Create a new test

pzheng updated this revision to Diff 436894.Jun 14 2022, 12:40 PM

Fix a typo

thieta accepted this revision.Jun 14 2022, 12:51 PM

Thanks for the patch! Wait for Hans to give his approval as well before committing.

This revision is now accepted and ready to land.Jun 14 2022, 12:51 PM
hans accepted this revision.Jun 15 2022, 7:36 AM

lgtm