This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/4186] Cross compiling for sub architectures (e.g. i586 target i686 host) fails


------- Additional Comments From wcohen at redhat dot com  2007-04-10 19:32 -------
Thinking about this some more. The way that c_unparser::emit_module_init()
should check for machine really should be determined by build/make of the
module. There shouldn't be a reason for someone to explicitly set the
architecture. The "-march=" doesn't set a single define for this. Thinking of
having is a function/define in the run time library that generates the
appropriate machine string based on __i486__, __i586__, ___i686___, etc.

static inline char *_stp_target_machine_arch()
{
#if defined(__i386__)
return "i386";
#elseif defined(__i486__)
return "i486";
...
#else
#error "cannot determine target arch"
#endif
}

generate code for for test something like this:

 if (strcmp (machine, _stp_target_machine_arch())) {
  _stp_error ("module machine mismatch (%s vs %s)", machine,
   _stap_target_machine_arch());
   rc = -EINVAL;
 }



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4186

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]