From: Julian Seward Date: Sun, 24 Mar 2002 12:22:39 +0000 (+0000) Subject: Use autoconf tests for glibc version in argc/argv/envp search. X-Git-Tag: svn/VALGRIND_1_0_3~419 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe84217f781bd63bb389a5b263b3d269b250065e;p=thirdparty%2Fvalgrind.git Use autoconf tests for glibc version in argc/argv/envp search. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@27 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 99afce7817..da674106ab 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -737,6 +737,7 @@ static void process_cmd_line_options ( void ) } # endif +# if defined(GLIBC_2_2) /* These offsets (5,6,7) are right for my RedHat 7.2 (glibc-2.2.4) box. */ @@ -766,6 +767,9 @@ static void process_cmd_line_options ( void ) (Addr)VG_(client_envp) >= 0x8000000) goto argc_argv_envp_OK; +# endif /* defined(GLIBC_2_2) */ + +# if defined(GLIBC_2_1) /* Doesn't look promising. Try offsets for RedHat 6.2 (glibc-2.1.3) instead. In this case, the argv and envp vectors are actually on the stack (bizarrely). */ @@ -793,6 +797,11 @@ static void process_cmd_line_options ( void ) (Addr)VG_(client_argv) >= 0x8000000 && (Addr)VG_(client_envp) >= 0x8000000) goto argc_argv_envp_OK; +# endif /* defined(GLIBC_2_1) */ + +# if !defined(GLIBC_2_2) && !defined(GLIBC_2_1) + config_error("autoconf/configure detected neither glibc 2.1.X nor 2.2.X"); +# endif /* VG_(printf)("%d %p %p\n", VG_(client_argc), VG_(client_argv), VG_(client_envp)); diff --git a/vg_main.c b/vg_main.c index 99afce7817..da674106ab 100644 --- a/vg_main.c +++ b/vg_main.c @@ -737,6 +737,7 @@ static void process_cmd_line_options ( void ) } # endif +# if defined(GLIBC_2_2) /* These offsets (5,6,7) are right for my RedHat 7.2 (glibc-2.2.4) box. */ @@ -766,6 +767,9 @@ static void process_cmd_line_options ( void ) (Addr)VG_(client_envp) >= 0x8000000) goto argc_argv_envp_OK; +# endif /* defined(GLIBC_2_2) */ + +# if defined(GLIBC_2_1) /* Doesn't look promising. Try offsets for RedHat 6.2 (glibc-2.1.3) instead. In this case, the argv and envp vectors are actually on the stack (bizarrely). */ @@ -793,6 +797,11 @@ static void process_cmd_line_options ( void ) (Addr)VG_(client_argv) >= 0x8000000 && (Addr)VG_(client_envp) >= 0x8000000) goto argc_argv_envp_OK; +# endif /* defined(GLIBC_2_1) */ + +# if !defined(GLIBC_2_2) && !defined(GLIBC_2_1) + config_error("autoconf/configure detected neither glibc 2.1.X nor 2.2.X"); +# endif /* VG_(printf)("%d %p %p\n", VG_(client_argc), VG_(client_argv), VG_(client_envp));