]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use autoconf tests for glibc version in argc/argv/envp search.
authorJulian Seward <jseward@acm.org>
Sun, 24 Mar 2002 12:22:39 +0000 (12:22 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 24 Mar 2002 12:22:39 +0000 (12:22 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@27

coregrind/vg_main.c
vg_main.c

index 99afce78178a050bfc6b1123a0acbd919a637e50..da674106ab0c0c0cca909f14edb2457bbcd3ff8e 100644 (file)
@@ -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));
index 99afce78178a050bfc6b1123a0acbd919a637e50..da674106ab0c0c0cca909f14edb2457bbcd3ff8e 100644 (file)
--- 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));