components/curl/patches/011-runtests.pl.patch
author Rich Burridge <rich.burridge@oracle.com>
Mon, 17 Mar 2014 13:28:32 -0700
branchs11u1-sru
changeset 2988 83fae5048c6c
permissions -rw-r--r--
17335413 problem in LIBRARY/CURL 15941200 curl "gmake test" failures 16658714 problem in LIBRARY/CURL 17799440 problem in LIBRARY/CURL 18183059 problem in LIBRARY/CURL

The various curl NTLM tests try to LD_PRELOAD a test library
called .../tests/libtest/.libs/libhostname.so that's been
created as a pre-requisite to running the numerous Perl tests.

This patch adjusts LD_PRELOAD to be LD_PRELOAD_32 or LD_PRELOAD_64
depending upon whether we are running the 32 or 64 bit tests.

As this is Solaris specific, this patch will not be pushed upstream.

--- tests/runtests.pl.orig	2013-11-18 07:12:48.748872794 -0800
+++ tests/runtests.pl	2013-11-18 07:15:32.604982653 -0800
@@ -2405,10 +2405,21 @@
                     delete $ENV{$var} if($ENV{$var});
                 }
                 else {
-                    if(($var =~ /^LD_PRELOAD/) &&
-                       ($debug_build || ($has_shared ne "yes"))) {
-                        # print "Skipping LD_PRELOAD due to no release shared build\n";
-                        next;
+                    if($var =~ /^LD_PRELOAD/) {
+                        if(exe_ext() && (exe_ext() eq '.exe')) {
+                            # print "Skipping LD_PRELOAD due to lack of OS support\n";
+                            next;
+                        }
+                        if($debug_build || ($has_shared ne "yes")) {
+                            # print "Skipping LD_PRELOAD due to no release shared build\n";
+                            next;
+                        }
+                        # make this LD_PRELOAD_{bits}
+                        open(FP, "/bin/file $content |");
+                        my $bits = <FP>;
+                        if ($bits =~ /^.+ELF\s(\d\d)-bit.+$/) {
+                            $var .= '_'.$1;
+                        }
                     }
                     $ENV{$var} = "$content";
                 }