[cfe-dev] test/Sema/typedef-redef.c failure

Sam Bishop sbishop at micron.com
Thu Jun 26 15:27:48 PDT 2008


Holger Schurig wrote:
> Seo Sanghyeon already proposed a way to solve this:
> 
>> "GetMainExecutable" is a tricky function to implement in
>> cross-platform way. The standard Linux method is to resolve
>> symlink /proc/self/exe. On Windows, you call GetModuleFileName.
>> See http://autopackage.org/docs/binreloc/ for extensive
>> discussion. 

I added support for the /proc/self/exe method a few months ago, but only 
for Cygwin.  I didn't switch Linux to using it because I didn't want to 
break something that I assumed was working.

All that's really required is a #define change, but the attached patch 
also uses /proc/self/exe instead of /proc/$$/exe.  (/me slaps forehead.)

Sam Bishop
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-GetMainExecutable-on-Linux.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080626/9832c445/attachment.bin>


More information about the cfe-dev mailing list