Nicholas Riley
2005-Jul-28 04:13 UTC
[LLVMdev] [patch] gccld not properly constructing paths when checking for bytecode
I was getting some weird errors from gccld and traced it to path construction in isBytecodeLPath. If the path doesn't end with a /, then Path just tries to stick filenames onto it, which is not so good. It would be more efficient to just add a "/" to the path once, I guess. Also, I had to touch lib/System/Path.cpp to get my changes to Path.inc noticed; it seems the build system might need a bit of tweaking. Here's a patch: Index: lib/System/Unix/Path.inc ==================================================================RCS file: /var/cvs/llvm/llvm/lib/System/Unix/Path.inc,v retrieving revision 1.43 diff -r1.43 Path.inc 436c436,439 < DIR* direntries = ::opendir(path.c_str()); ---> std::string dirPath = path; > if (dirPath[dirPath.size() - 1] != '/') > dirPath += '/'; > DIR* direntries = ::opendir(dirPath.c_str());444c447 < Path aPath(path + (const char*)de->d_name); ---> Path aPath(dirPath + (const char*)de->d_name);-- Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
Reid Spencer
2005-Jul-28 16:28 UTC
[LLVMdev] [patch] gccld not properly constructing paths when checking for bytecode
Nicholas, Your patch (more or less) was applied today. Thanks for finding this! The patch applied is here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050725/027268.html Thanks, Reid. On Wed, 2005-07-27 at 23:13 -0500, Nicholas Riley wrote:> I was getting some weird errors from gccld and traced it to path > construction in isBytecodeLPath. If the path doesn't end with a /, > then Path just tries to stick filenames onto it, which is not so good. > It would be more efficient to just add a "/" to the path once, I > guess. > > Also, I had to touch lib/System/Path.cpp to get my changes to Path.inc > noticed; it seems the build system might need a bit of tweaking. > > Here's a patch: > > Index: lib/System/Unix/Path.inc > ==================================================================> RCS file: /var/cvs/llvm/llvm/lib/System/Unix/Path.inc,v > retrieving revision 1.43 > diff -r1.43 Path.inc > 436c436,439 > < DIR* direntries = ::opendir(path.c_str()); > --- > > std::string dirPath = path; > > if (dirPath[dirPath.size() - 1] != '/') > > dirPath += '/'; > > DIR* direntries = ::opendir(dirPath.c_str()); > 444c447 > < Path aPath(path + (const char*)de->d_name); > --- > > Path aPath(dirPath + (const char*)de->d_name); >-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050728/903cad7f/attachment.sig>
Seemingly Similar Threads
- New R folder names bring out Windows batch file bug
- How to download any file using send_file() method
- Program won't load fonts when run outside of installed dir
- [LLVMdev] [patch] gccld not passing -export-dynamic to gcc for link
- Strange clang behavior when compiled against musl