stap and make/gcc in non standard path

David Smith dsmith@redhat.com
Fri Dec 22 20:08:00 GMT 2006


Michael Obster wrote:
> Hi David,
> 
> first of all, thank you for your fast response.

No problem.

> Geschrieben von David Smith <dsmith@redhat.com>:
>>
>> You are correct, systemtap overrides the path to
>> '/bin:/sbin:/usr/bin:/usr/sbin' for security reasons.
>>
>> My quess is that you are some sort of an embedded environment where the
>> compiler isn't actually there and you are trying to NFS mount it.
>>
> 
> You are correct!
> 
>> If that is the case, one possible solution to your problem would be to
>> build your module on a system where the compiler is installed in the
>> proper place, then transfer the module over and run it with staprun.
>> Note that the compile system doesn't have to be running the same kernel
>> as the target system, but it does have to have the target kernel
>> installed (and then you'd use the stap '-r RELEASE' argument).
>>
>> Another possible solution to your problem is modify main.cxx to add in
>> your special compiler directory to our override of PATH.
>>
> 
> That information helps a lot, but I will need to do the second solution 
> because I cannot install the target kernel on the "compile station".

The second solutions will work, but you'll have to remember to hack the 
path every time you grab a new systemtap release (which could be a 
pain).  Also note that the compiler you use must be the exact same one 
used to compile the target kernel.

BTW, another advantage to the first solution is that you don't have to 
have the kernel-{devel,debuginfo,debuginfo-common} packages installed on 
the target system, only on the build system (I believe this is the case 
- I've never actually done it).  In the case of an embedded system, I'm 
betting getting those packages installed is a pain.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)



More information about the Systemtap mailing list