Displaying 20 results from an estimated 26 matches for "getmainexecut".
2010 Sep 02
2
[LLVMdev] Some fixes for the GetMainExecutable function
Hi,
The attached patch ensures that GetMainExecutable function in llvm-trunk/lib/System/Unix/Path.inc also works on Minix. I'm not sure it should be applied unmodified, because there may be controversial changes in it.
In particular, one of the things it changes is this:
- snprintf(buf, PATH_MAX, "%s//%s", dir, bin);
+ snprintf(...
2010 Sep 02
0
[LLVMdev] Some fixes for the GetMainExecutable function
On Sep 2, 2010, at 10:03 AM, Kees van Reeuwijk wrote:
> - snprintf(buf, PATH_MAX, "%s//%s", dir, bin);
There's no comment, and no mention in the commit message.
It seems pretty safe to fix.
> Also, the if-all-else-fails return value of GetMainExecutable is an empty path, but since the users of this function don't test for that, this choice leads to rather obscure errors. Wouldn't it be better to give an explicit error in such cases,
Issuing an error is hard to do right here, since it's in such a low-level
library. However, it does...
2010 Sep 06
1
[LLVMdev] Some fixes for the GetMainExecutable function
...>
> On Sep 2, 2010, at 10:03 AM, Kees van Reeuwijk wrote:
>
>> - snprintf(buf, PATH_MAX, "%s//%s", dir, bin);
>
> There's no comment, and no mention in the commit message.
> It seems pretty safe to fix.
>
>> Also, the if-all-else-fails return value of GetMainExecutable is an empty path, but since the users of this function don't test for that, this choice leads to rather obscure errors. Wouldn't it be better to give an explicit error in such cases,
>
> Issuing an error is hard to do right here, since it's in such a low-level
> library. Ho...
2008 Mar 11
3
[LLVMdev] Subversion head: build problem on cygwin?
...when I try make, I
almost immediately get the following error:
make[1]: Entering directory `/cygdrive/i/Projects/llvm/lib/System'
llvm[1]: Compiling Path.cpp for Debug build
In file included from Path.cpp:201:
Unix/Path.inc: In static member function `static llvm::sys::Path
llvm::sys::Path::GetMainExecutable(const char*, void*)':
Unix/Path.inc:256: error: `Dl_info' undeclared (first use this function)
Unix/Path.inc:256: error: (Each undeclared identifier is reported only
once for each function it appears in.)
Unix/Path.inc:256: error: expected `;' before "DLInfo"
Unix/Path.in...
2010 Aug 22
2
[LLVMdev] Error Building LLVM on AIX 6
...cpp:262:
Unix/Path.inc: In static member function 'static llvm::sys::Path
llvm::sys::Path::GetTemporaryDirectory(std::string*)':
Unix/Path.inc:142: error: 'mkdtemp' was not declared in this scope
Unix/Path.inc: In static member function 'static llvm::sys::Path
llvm::sys::Path::GetMainExecutable(const char*, void*)':
Unix/Path.inc:365: error: 'Dl_info' was not declared in this scope
Unix/Path.inc:365: error: expected `;' before 'DLInfo'
Unix/Path.inc:366: error: 'DLInfo' was not declared in this scope
Unix/Path.inc:366: error: 'dladdr' was not de...
2009 Jul 02
2
[LLVMdev] llvmc for PIC16
...i Sanjiv,
On Wed, Jul 1, 2009 at 7:02 PM, Sanjiv Gupta<sanjiv.gupta at microchip.com> wrote:
> I found out the problem. Looks like I can not rely on argv[0] to contain the
> full path of the executable always.
Yeah, that's what I was thinking.
> Can I rely on:
> static Path GetMainExecutable(const char *argv0, void *MainAddr);
Clang relies on it. According to
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp
MainAddr can be any symbol in the binary.
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachment...
2008 Mar 13
1
[LLVMdev] Subversion head: build problem on cygwin?
...atches as attachments (and name the file ".patch" just
> in case). Mail readers commonly munge them (e.g. by removing trailing
> whitespace) if not, which prevents the patch from applying.
Hmm... What you got was the result of me telling Thunderbird to attach
a file called cygwin-getmainexecutable-impl.patch. You can see here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-March/013029.html
All of my previous patches have been sent using SquirrelMail. It looks
like I'll keep doing that...
Thanks,
Sam
2009 Jul 01
0
[LLVMdev] llvmc for PIC16
I found out the problem. Looks like I can not rely on argv[0] to contain
the full path of the executable always.
Can I rely on:
static Path GetMainExecutable(const char *argv0, void *MainAddr);
is it Cross-platform?
What to pass for second parameter here. C++ forbids taking address of
"main", and the "Main" of CompilerDriver is in a shared object here.
- Sanjiv
Sanjiv Gupta wrote:
> The driver behaves differently when I ru...
2012 Jul 14
0
[LLVMdev] [llvm-commits] Dealing with a corrupted /proc/self/exe link
...ections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000
[Thread debugging using libthread_db enabled]
Breakpoint 1, 0x0000003d61e01710 in dladdr () from /lib64/libdl.so.2
(gdb) bt
#0 0x0000003d61e01710 in dladdr () from /lib64/libdl.so.2
#1 0x00000000019d554d in llvm::sys::Path::GetMainExecutable(char const*, void*) ()
#2 0x00000000005d8882 in main ()
On your linux system you would set the breakpoint at 'readlink', but you
would see the same backtrace.
Thanks for your ideas,
cheers,
Gabor
2013 Oct 03
0
[LLVMdev] libclang JIT frontend
...quot;llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
using namespace clang::driver;
// This function isn't referenced outside its translation unit, but it
// can't use the "static" keyword because its address is used for
// GetMainExecutable (since some platforms don't support taking the
// address of main, and some platforms can't implement GetMainExecutable
// without being given the address of a function in the main executable).
llvm::sys::Path GetExecutablePath(const char *Argv0) {
// This just needs to be some symbol...
2008 Mar 11
0
[LLVMdev] Subversion head: build problem on cygwin?
...his is the first time I've built
> LLVM on Cygwin, but I can't get a working compile.
Last I checked, LLVM-on-Cygwin has at least two problems, and you've hit
one of them. Working around them isn't too bad, though patches to fix
them would be appreciated.
> llvm::sys::Path::GetMainExecutable(const char*, void*)':
> Unix/Path.inc:256: error: `Dl_info' undeclared (first use this function)
> Unix/Path.inc:256: error: (Each undeclared identifier is reported only
> once for each function it appears in.)
> Unix/Path.inc:256: error: expected `;' before "DLInfo...
2009 Jul 01
2
[LLVMdev] llvmc for PIC16
The driver behaves differently when I run it by specifying absolute path
than when I run it with relative path.
See example
Relative:
i00202 at ubuntu:/tmp$ mcc16 --save-temps -dry-run hello.c./clang-cc -I
./include -triple=pic16- -emit-llvm-bc hello.c -o hello.bc-pqDR1Y
llvm-ld -link-as-library hello.bc-pqDR1Y -o tmp.bc-M1Rwip
llc -march=pic16 -f tmp.bc-M1Rwip -o tmp.s-DcVczP
gpasm -I ./inc
2010 Aug 22
0
[LLVMdev] Error Building LLVM on AIX 6
...nc: In static member function 'static llvm::sys::Path
> llvm::sys::Path::GetTemporaryDirectory(std::string*)':
> Unix/Path.inc:142: error: 'mkdtemp' was not declared in this scope
> Unix/Path.inc: In static member function 'static llvm::sys::Path
> llvm::sys::Path::GetMainExecutable(const char*, void*)':
> Unix/Path.inc:365: error: 'Dl_info' was not declared in this scope
> Unix/Path.inc:365: error: expected `;' before 'DLInfo'
> Unix/Path.inc:366: error: 'DLInfo' was not declared in this scope
> Unix/Path.inc:366: error: 'dl...
2008 Mar 12
3
[LLVMdev] Subversion head: build problem on cygwin?
...odified the 32-bit typedefs in my
> /usr/include/stdint.h file. I've chosen to fight other battles. :)
LLVM compiles fine with my stdint.h changes, for what that's worth.
Sam
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin-getmainexecutable-impl.patch
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080311/9cd79853/attachment.ksh>
2012 Jul 13
2
[LLVMdev] [llvm-commits] Dealing with a corrupted /proc/self/exe link
On Fri, Jul 13, 2012 at 1:40 PM, Benjamin Kramer <benny.kra at gmail.com>wrote:
>
> On 13.07.2012, at 21:39, Gabor Greif <gabor.greif at alcatel-lucent.com>
> wrote:
>
> > Benjamin Kramer wrote:
> >> On 13.07.2012, at 09:46, Gabor Greif <gabor.greif at alcatel-lucent.com>
> wrote:
> >>
> >>> Hi all,
> >>>
>
2010 Aug 23
1
[LLVMdev] Error Building LLVM on AIX 6
...mber function 'static llvm::sys::Path
>> llvm::sys::Path::GetTemporaryDirectory(std::string*)':
>> Unix/Path.inc:142: error: 'mkdtemp' was not declared in this scope
>> Unix/Path.inc: In static member function 'static llvm::sys::Path
>> llvm::sys::Path::GetMainExecutable(const char*, void*)':
>> Unix/Path.inc:365: error: 'Dl_info' was not declared in this scope
>> Unix/Path.inc:365: error: expected `;' before 'DLInfo'
>> Unix/Path.inc:366: error: 'DLInfo' was not declared in this scope
>> Unix/Path.inc:366...
2012 Oct 23
2
[LLVMdev] Error building llvm on AIX 7.1
...uild
llvm[1]: Compiling MemoryObject.cpp for Release+Asserts build
llvm[1]: Compiling Mutex.cpp for Release+Asserts build
llvm[1]: Compiling Path.cpp for Release+Asserts build
In file included from Path.cpp:289:0:
Unix/Path.inc: In static member function 'static llvm::sys::Path
llvm::sys::Path::GetMainExecutable(const char*, void*)':
Unix/Path.inc:345:3: error: 'Dl_info' was not declared in this scope
Unix/Path.inc:345:11: error: expected ';' before 'DLInfo'
Unix/Path.inc:346:31: error: 'DLInfo' was not declared in this scope
Unix/Path.inc:346:37: error: 'dladdr&...
2009 Jul 02
0
[LLVMdev] llvmc for PIC16
...sanjiv.gupta at microchip.com> wrote:
>
>> I found out the problem. Looks like I can not rely on argv[0] to contain the
>> full path of the executable always.
>>
>
> Yeah, that's what I was thinking.
>
>
>> Can I rely on:
>> static Path GetMainExecutable(const char *argv0, void *MainAddr);
>>
>
> Clang relies on it. According to
>
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp
>
> MainAddr can be any symbol in the binary.
>
>
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
...f(stderr, "yipee!");
return 1;
}
llvm::sys::Path GetExecutablePath(const char *Argv0) {
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
void *MainAddr = (void*) (intptr_t) GetExecutablePath;
return llvm::sys::Path::GetMainExecutable(Argv0, MainAddr);
}
int Execute(llvm::Module *Mod, char * const *envp) {
llvm::InitializeNativeTarget();
std::string Error;
llvm::OwningPtr<llvm::ExecutionEngine> EE(
llvm::ExecutionEngine::createJIT(Mod, &Error));
if (!EE) {
llvm::errs() << "unable to make execut...
2008 Mar 13
0
[LLVMdev] Subversion head: build problem on cygwin?
On Mar 11, 2008, at 8:10 PM, Sam Bishop wrote:
> Sam Bishop wrote:
>> What LLVM is trying to do here is determine its own path. I don't
>> know
>> if the approach being used will work on Cygwin. (The code is very
>> new,
>> and it's never worked on Cygwin.) You could try reading the
>> /proc/$$/exe symlink. I don't know how long Cygwin