diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-03-22 23:26:32 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-03-22 23:26:32 +0000 |
commit | cbe1e7e5659d2f84aa47f9bada20fa3738ebcda9 (patch) | |
tree | 7f1b6209f7fd73256c8b7acb6dc5d9daabbd7514 | |
parent | f7d4c0431e423fbeaa46b95a46cd4d3d7d106e2a (diff) |
Replace calls to 'system' with an error message and abort.
Summary:
'system' is unavailable on iOS, which causes build failures. These
execution paths are probably never taken anyway (if we hit the abort,
then we'll need to revert this and disable it only on certain
platforms.)
Reviewers: cmatthews
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D44551
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@328269 91177308-0d34-0410-b5e6-96231b3b80d8
10 files changed, 54 insertions, 27 deletions
diff --git a/MultiSource/Applications/lua/loslib.c b/MultiSource/Applications/lua/loslib.c index da06a572..5108e6a2 100644 --- a/MultiSource/Applications/lua/loslib.c +++ b/MultiSource/Applications/lua/loslib.c @@ -36,7 +36,9 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { static int os_execute (lua_State *L) { - lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); return 1; } diff --git a/MultiSource/Applications/siod/slibu.c b/MultiSource/Applications/siod/slibu.c index 3ed13aa5..849fc837 100644 --- a/MultiSource/Applications/siod/slibu.c +++ b/MultiSource/Applications/siod/slibu.c @@ -119,7 +119,10 @@ LISP lsystem(LISP args) {int retval; long iflag; iflag = no_interrupt(1); - retval = system(get_c_string(string_append(args))); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + retval = 0; +// retval = system(get_c_string(string_append(args))); no_interrupt(iflag); if (retval < 0) return(cons(flocons(retval),llast_c_errmsg(-1))); diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt b/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt index 7aec587c..226b10f4 100644 --- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt +++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt @@ -1,4 +1,5 @@ set(PROG HPCCG) +list(APPEND CXXFLAGS -DREDSTORM) # -DREDSTORM for mkdir list(APPEND LDFLAGS -lm) set(RUN_OPTIONS 50 50 50) llvm_multisource() diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt b/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt index 91df906d..00c3337f 100644 --- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt +++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt @@ -1,5 +1,5 @@ set(PROG miniFE) -list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX) +list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX -DREDSTORM) # -DREDSTORM for mkdir list(APPEND LDFLAGS -lm) set(RUN_OPTIONS -nx 64 -ny 64 -nz 64) llvm_multisource() diff --git a/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c b/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c index da93a8f8..47ba1d4f 100644 --- a/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c +++ b/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c @@ -844,7 +844,9 @@ OBJECT *full_name, FILE_POS *xfpos, BOOLEAN *compressed) } else { - system(buff); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// system(buff); fp = fopen(LOUT_EPS, READ_TEXT); *compressed = TRUE; } diff --git a/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c b/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c index e953ddd4..7fcee9ad 100644 --- a/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c +++ b/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c @@ -149,7 +149,10 @@ OBJECT FilterExecute(OBJECT x, FULL_CHAR *command, OBJECT env) else { /* execute the command, echo error messages, and exit if status problem */ - status = system( (char *) command); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + status = 0; +// status = system( (char *) command); err_fp = StringFOpen(FILTER_ERR, READ_TEXT); if( err_fp != NULL ) { while( fgets(line, MAX_LINE, err_fp) != NULL ) diff --git a/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c b/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c index 8ea8eac8..51c4e3ac 100644 --- a/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c +++ b/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c @@ -109,10 +109,12 @@ if( doCompaction > 0 ) { redoFlag = 0 ; addpins() ; + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); sprintf( command , "cp %s.cfs cfss1", cktName ) ; - system( command ) ; +// system( command ) ; sprintf( command , "cp %s.cfb cfbb1", cktName ) ; - system( command ) ; +// system( command ) ; for( c = 1 ; c <= doCompaction ; c++ ) { @@ -206,10 +208,12 @@ if( doCompaction > 0 ) { rmain() ; redoFlag = 0 ; + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); sprintf( command , "cp %s.cfs cfss%d", cktName , c + 1) ; - system( command ) ; +// system( command ) ; sprintf( command , "cp %s.cfb cfbb%d", cktName , c + 1) ; - system( command ) ; +// system( command ) ; } subpins() ; fprintf(fpo,"\n\nCORE Bounding Box: l:%d r:%d b:%d t:%d\n\n", diff --git a/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c b/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c index 5561db49..9eaf0da9 100644 --- a/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c +++ b/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c @@ -86,20 +86,12 @@ int main(int argc,char **argv) /* -------------------------------- Delete the temporary output file */ if (!DEBUG_FLAG_1) { - char *TEMP; - TEMP = (char *) malloc((unsigned int) - (4+strlen(TEMP_OUTPUT_FILE_NAME))); - (void) sprintf(TEMP,"rm %s",TEMP_OUTPUT_FILE_NAME); - (void) system(TEMP); + (void) remove(TEMP_OUTPUT_FILE_NAME); } /* -------------------------------- If errors, delete the object file */ if (ERROR) { - char *TEMP; - TEMP = (char *) malloc((unsigned int) - (4+strlen(OBJECT_FILE))); - (void) sprintf(TEMP,"rm %s",OBJECT_FILE); - (void) system(TEMP); + (void) remove(OBJECT_FILE); (void) printf("Errors detected. Deleted object file.\n"); } } diff --git a/MultiSource/Benchmarks/mafft/pairlocalalign.c b/MultiSource/Benchmarks/mafft/pairlocalalign.c index 5245477c..7c5c5afd 100644 --- a/MultiSource/Benchmarks/mafft/pairlocalalign.c +++ b/MultiSource/Benchmarks/mafft/pairlocalalign.c @@ -118,7 +118,10 @@ static void callfoldalign( int nseq, char **mseq ) fclose( fp ); sprintf( com, "env PATH=%s foldalign210 %s _foldalignin > _foldalignout ", whereispairalign, foldalignopt ); - res = system( com ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + res = 0; +// res = system( com ); if( res ) { fprintf( stderr, "Error in foldalign\n" ); @@ -152,7 +155,10 @@ static void calllara( int nseq, char **mseq, char *laraarg ) // fprintf( stderr, "calling LaRA\n" ); sprintf( com, "env PATH=%s:/bin:/usr/bin mafft_lara -i _larain -w _laraout -o _lara.params %s", whereispairalign, laraarg ); - res = system( com ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + res = 0; +// res = system( com ); if( res ) { fprintf( stderr, "Error in lara\n" ); @@ -306,7 +312,9 @@ static float callmxscarna_giving_bpp( char **mseq1, char **mseq2, char **bpp1, c fprintf( fp, *bpp2++ ); fclose( fp ); - system( "tr -d '\\r' < _bpporg > _bpp" ); // for cygwin, wakaran + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// system( "tr -d '\\r' < _bpporg > _bpp" ); // for cygwin, wakaran t2u( *mseq1 ); t2u( *mseq2 ); @@ -324,10 +332,15 @@ static float callmxscarna_giving_bpp( char **mseq1, char **mseq2, char **bpp1, c write1seq( fp, *mseq2 ); fclose( fp ); - system( "tr -d '\\r' < _mxscarnainorg > _mxscarnain" ); // for cygwin, wakaran + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// system( "tr -d '\\r' < _mxscarnainorg > _mxscarnain" ); // for cygwin, wakaran sprintf( com, "env PATH=%s mxscarnamod -readbpp _mxscarnain > _mxscarnaout 2>_dum", whereispairalign ); - res = system( com ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + res = 0; +// res = system( com ); if( res ) { fprintf( stderr, "Error in mxscarna\n" ); @@ -379,7 +392,10 @@ static float callmxscarna_slow( char **mseq1, char **mseq2, int alloclen ) fclose( fp ); sprintf( com, "env PATH=%s mxscarnamod _mxscarnain > _mxscarnaout 2>_dum", whereispairalign ); - res = system( com ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); + res = 0; +// res = system( com ); if( res ) { fprintf( stderr, "Error in mxscarna\n" ); diff --git a/MultiSource/Benchmarks/mafft/rna.c b/MultiSource/Benchmarks/mafft/rna.c index 33610974..33cf9c5c 100644 --- a/MultiSource/Benchmarks/mafft/rna.c +++ b/MultiSource/Benchmarks/mafft/rna.c @@ -220,7 +220,9 @@ void rnaalifoldcall( char **seq, int nseq, RNApair **pairprob ) fclose( fp ); sprintf( cmd, "RNAalifold -p %s", fnamein ); - system( cmd ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// system( cmd ); fp = fopen( "alifold.out", "r" ); if( !fp ) @@ -280,7 +282,9 @@ void rnaalifoldcall( char **seq, int nseq, RNApair **pairprob ) } fclose( fp ); sprintf( cmd, "rm -f %s", fnamein ); - system( cmd ); + fprintf(stderr, "Cannot execute system calls!\n"); + abort(); +// system( cmd ); for( i=0; i<lgth; i++ ) { |