/* ----- x86-linux specifics ----- */
-/* Arse! Really I want to test VG_PLATFORM, but this does not
- seem to be possible. */
-#if defined(__i386__) && defined(__linux__)
+#if defined(VGP_x86_linux)
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
return __res;
}
-#elif defined(__x86_64__) && defined(__linux__)
+#elif defined(VGP_amd64_linux)
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
}
#else
-#error Unknown VG_PLATFORM
+# error Unknown platform
#endif
// XXX: what architectures is this necessary for? x86 yes, PPC no, others ?
// Perhaps a per-arch VGA_NEEDS_TRAMPOLINE constant is necessary?
-#if defined(__i386__) || defined(__amd64__)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
/* --- trampoline page --- */
VG_(memcpy)( (void *)VG_(client_trampoline_code),
&VG_(trampoline_code_start), VG_(trampoline_code_length) );
"./configure --prefix=... or --libdir=...");
// XXX: what architectures is this necessary for? x86 yes, PPC no, others ?
-#ifdef __x86__
+#if defined(VGP_x86_linux)
{
UInt* auxp;
for (auxp = client_auxv; auxp[0] != AT_NULL; auxp += 2) {
VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everything */
sp_at_startup___global_arg = 0;
-#if defined(__i386__) || defined(__amd64__)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
//--------------------------------------------------------------
// Protect client trampoline page (which is also sysinfo stuff)
// p: segment stuff [otherwise get seg faults...]
Segment *seg;
VG_(mprotect)( (void *)VG_(client_trampoline_code),
VG_(trampoline_code_length), VKI_PROT_READ|VKI_PROT_EXEC );
-#endif
+
/* Make sure this segment isn't treated as stack */
seg = VG_(find_segment)(VG_(client_trampoline_code));
if (seg)
seg->flags &= ~(SF_STACK | SF_GROWDOWN);
}
+#endif
//==============================================================
// Can use VG_(map)() after segments set up