From: Julian Seward Date: Mon, 2 May 2005 10:33:44 +0000 (+0000) Subject: Initial cleanups based on target-specific defines. X-Git-Tag: svn/VALGRIND_3_0_0~726 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ab9dd1d31c8b8048f112844504e83cc0484512e;p=thirdparty%2Fvalgrind.git Initial cleanups based on target-specific defines. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3592 --- diff --git a/coregrind/m_debuglog.c b/coregrind/m_debuglog.c index 940d1881e0..f7467f9b9e 100644 --- a/coregrind/m_debuglog.c +++ b/coregrind/m_debuglog.c @@ -55,9 +55,7 @@ /* ----- 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 ) { @@ -94,7 +92,7 @@ static UInt local_sys_getpid ( void ) return __res; } -#elif defined(__x86_64__) && defined(__linux__) +#elif defined(VGP_amd64_linux) static UInt local_sys_write_stderr ( HChar* buf, Int n ) { @@ -128,7 +126,7 @@ static UInt local_sys_getpid ( void ) } #else -#error Unknown VG_PLATFORM +# error Unknown platform #endif diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index c16bb00a7a..84b0c091d9 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -1081,7 +1081,7 @@ static Addr setup_client_stack(void* init_sp, // 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) ); @@ -1629,7 +1629,7 @@ static void process_cmd_line_options( UInt* client_auxv, const char* toolname ) "./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) { @@ -2672,7 +2672,7 @@ int main(int argc, char **argv, char **envp) 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...] @@ -2681,12 +2681,13 @@ int main(int argc, char **argv, char **envp) 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