gccinstlib.pl (cdf0e10c) | gccinstlib.pl (a6bbe7ee) |
---|---|
1: 2eval 'exec perl -wS $0 ${1+"$@"}' 3 if 0; 4#************************************************************************* 5# 6# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7# 8# Copyright 2000, 2010 Oracle and/or its affiliates. --- 24 unchanged lines hidden (view full) --- 33$Dest = pop(@ARGV) || die "No destination to copy to"; 34 35$cc = $ENV{'CC'} || die "No CC environment set"; 36 37if ($Dest =~ /--help/ || @ARGV < 1) { 38 print "Syntax:\n gcc-instlib <library-in-libpath ...> <destination-dir>\n"; 39 exit (0); 40} | 1: 2eval 'exec perl -wS $0 ${1+"$@"}' 3 if 0; 4#************************************************************************* 5# 6# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7# 8# Copyright 2000, 2010 Oracle and/or its affiliates. --- 24 unchanged lines hidden (view full) --- 33$Dest = pop(@ARGV) || die "No destination to copy to"; 34 35$cc = $ENV{'CC'} || die "No CC environment set"; 36 37if ($Dest =~ /--help/ || @ARGV < 1) { 38 print "Syntax:\n gcc-instlib <library-in-libpath ...> <destination-dir>\n"; 39 exit (0); 40} |
41 42%SrcAndDest = (); 43 |
|
41foreach $File (@ARGV) { 42 my $string; | 44foreach $File (@ARGV) { 45 my $string; |
43 44 open (GCCOut, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$File|") || die "Failed to exec $cc -print-file-name=$File $!"; | 46 my $normalized_file = $File; 47 $normalized_file =~ s/\.so\.\d+/.so/; 48 open (GCCOut, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$normalized_file|") || die "Failed to exec $cc -print-file-name=$normalized_file $!"; |
45 $string=<GCCOut>; 46 chomp ($string); | 49 $string=<GCCOut>; 50 chomp ($string); |
47 push (@CopySrc, $string); | 51 $SrcAndDest{$string} = "$Dest/$File"; |
48 close (GCCOut); 49} 50 | 52 close (GCCOut); 53} 54 |
51foreach $Src (@CopySrc) { 52 printf "copy $Src to $Dest\n"; 53 system ("/bin/cp $Src $Dest") && die "copy failed: $!"; | 55while (($Src, $FullDest) = each %SrcAndDest) { 56 printf "copy $Src to $FullDest\n"; 57 system ("/bin/cp $Src $FullDest") && die "copy failed: $!"; |
54} 55 56 57foreach $File (@ARGV) { 58 #https://bugzilla.redhat.com/show_bug.cgi?id=149465 59 printf "unprelinking $Dest/$File\n"; 60 #If it's already unprelinked .i.e. no .gnu.prelink_undo section, that's fine 61 #If prelink is not installed, it's massively unlikely that it's prelinked 62 system ("prelink -u $Dest/$File > /dev/null 2>&1"); 63} 64 65exit (0); | 58} 59 60 61foreach $File (@ARGV) { 62 #https://bugzilla.redhat.com/show_bug.cgi?id=149465 63 printf "unprelinking $Dest/$File\n"; 64 #If it's already unprelinked .i.e. no .gnu.prelink_undo section, that's fine 65 #If prelink is not installed, it's massively unlikely that it's prelinked 66 system ("prelink -u $Dest/$File > /dev/null 2>&1"); 67} 68 69exit (0); |