SWDEV-335967 - hipcc fixes for return value and blocking call (#2752)
Change-Id: I8caade13dac2c3cfd540bd683bd46eafb91111c2
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cc96fdec02
Коммит
9af24c0aed
+24
-4
@@ -38,16 +38,36 @@ foreach $arg (@ARGV) {
|
||||
}
|
||||
|
||||
my $SCRIPT_DIR=dirname(__FILE__);
|
||||
|
||||
if ($HIPCC_USE_PERL_SCRIPT) {
|
||||
#Invoke hipcc.pl
|
||||
my $HIPCC_PERL=catfile($SCRIPT_DIR, '/hipcc.pl');
|
||||
exec($^X, $HIPCC_PERL, @ARGV);
|
||||
system($^X, $HIPCC_PERL, @ARGV);
|
||||
} else {
|
||||
#Invoke hipcc.bin
|
||||
my $HIPCC_BIN=catfile($SCRIPT_DIR, '/hipcc.bin');
|
||||
$BIN_NAME="/hipcc.bin";
|
||||
if ($isWindows) {
|
||||
$BIN_NAME="/hipcc.bin.exe";
|
||||
}
|
||||
my $HIPCC_BIN=catfile($SCRIPT_DIR, $BIN_NAME);
|
||||
if ( -e $HIPCC_BIN ) {
|
||||
exec($HIPCC_BIN, @ARGV);
|
||||
#Invoke hipcc.bin
|
||||
system($HIPCC_BIN, @ARGV);
|
||||
} else {
|
||||
print "hipcc.bin not present; Install HIPCC binaries before proceeding";
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
# Because of this wrapper we need to check
|
||||
# the output of the system command for perl and bin
|
||||
# else the failures are ignored and build fails silently
|
||||
if ($? == -1) {
|
||||
exit($?);
|
||||
}
|
||||
elsif ($? & 127) {
|
||||
exit($?);
|
||||
}
|
||||
else {
|
||||
$CMD_EXIT_CODE = $? >> 8;
|
||||
}
|
||||
exit($CMD_EXIT_CODE);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
@set HIPCC="%~dp0/hipcc"
|
||||
@set HIPCC="%~dp0hipcc"
|
||||
@perl %HIPCC% %*
|
||||
|
||||
+25
-6
@@ -22,7 +22,6 @@
|
||||
# Need perl > 5.10 to use logic-defined or
|
||||
use 5.006; use v5.10.1;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use File::Basename;
|
||||
@@ -30,18 +29,38 @@ use File::Spec::Functions 'catfile';
|
||||
|
||||
#TODO: By default select perl script until change incorporated in HIP build script
|
||||
my $HIPCONFIG_USE_PERL_SCRIPT = 1;
|
||||
|
||||
my $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys');
|
||||
my $SCRIPT_DIR=dirname(__FILE__);
|
||||
|
||||
if ($HIPCONFIG_USE_PERL_SCRIPT) {
|
||||
#Invoke hipconfig.pl
|
||||
my $HIPCONFIG_PERL=catfile($SCRIPT_DIR, '/hipconfig.pl');
|
||||
exec($^X, $HIPCONFIG_PERL, @ARGV);
|
||||
system($^X, $HIPCONFIG_PERL, @ARGV);
|
||||
} else {
|
||||
#Invoke hipconfig.bin
|
||||
my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, '/hipconfig.bin');
|
||||
$BIN_NAME="/hipconfig.bin";
|
||||
if ($isWindows) {
|
||||
$BIN_NAME="/hipconfig.bin.exe";
|
||||
}
|
||||
my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, $BIN_NAME);
|
||||
if ( -e $HIPCONFIG_BIN ) {
|
||||
exec($HIPCONFIG_BIN, @ARGV);
|
||||
#Invoke hipconfig.bin
|
||||
system($HIPCONFIG_BIN, @ARGV);
|
||||
} else {
|
||||
print "hipconfig.bin not present; Install HIPCC binaries before proceeding";
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
# Because of this wrapper we need to check
|
||||
# the output of the system command for perl and bin
|
||||
# else the failures are ignored and build fails silently
|
||||
if ($? == -1) {
|
||||
exit($?);
|
||||
}
|
||||
elsif ($? & 127) {
|
||||
exit($?);
|
||||
}
|
||||
else {
|
||||
$CMD_EXIT_CODE = $? >> 8;
|
||||
}
|
||||
exit($CMD_EXIT_CODE);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
@set HIPCONFIG="%~dp0/hipconfig"
|
||||
@set HIPCONFIG="%~dp0hipconfig"
|
||||
@perl %HIPCONFIG% %*
|
||||
|
||||
Ссылка в новой задаче
Block a user