diff --git a/openmp/runtime/cmake/LibompMicroTests.cmake b/openmp/runtime/cmake/LibompMicroTests.cmake index 825d231b8f80..76bc5503a11c 100644 --- a/openmp/runtime/cmake/LibompMicroTests.cmake +++ b/openmp/runtime/cmake/LibompMicroTests.cmake @@ -150,8 +150,8 @@ add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success) add_custom_command( OUTPUT test-execstack/.success COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-execstack - COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-execstack.pl --os=${LIBOMP_PERL_SCRIPT_OS} - --arch=${LIBOMP_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} + COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-execstack.pl + --arch=${LIBOMP_PERL_SCRIPT_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} COMMAND ${CMAKE_COMMAND} -E touch test-execstack/.success DEPENDS omp ) @@ -162,7 +162,7 @@ add_custom_command( OUTPUT test-instr/.success COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-instr COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-instruction-set.pl --os=${LIBOMP_PERL_SCRIPT_OS} - --arch=${LIBOMP_ARCH} --show --mic-arch=${LIBOMP_MIC_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} + --arch=${LIBOMP_PERL_SCRIPT_ARCH} --show --mic-arch=${LIBOMP_MIC_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} COMMAND ${CMAKE_COMMAND} -E touch test-instr/.success DEPENDS omp ${LIBOMP_TOOLS_DIR}/check-instruction-set.pl ) @@ -219,7 +219,7 @@ add_custom_command( OUTPUT test-deps/.success COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-deps COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-depends.pl --os=${LIBOMP_PERL_SCRIPT_OS} - --arch=${LIBOMP_ARCH} --expected="${libomp_expected_library_deps}" ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} + --arch=${LIBOMP_PERL_SCRIPT_ARCH} --expected="${libomp_expected_library_deps}" ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} COMMAND ${CMAKE_COMMAND} -E touch test-deps/.success DEPENDS omp ${LIBOMP_TOOLS_DIR}/check-depends.pl ) diff --git a/openmp/runtime/cmake/config-ix.cmake b/openmp/runtime/cmake/config-ix.cmake index 6a78a7aebc53..b6e4e4ced514 100644 --- a/openmp/runtime/cmake/config-ix.cmake +++ b/openmp/runtime/cmake/config-ix.cmake @@ -144,8 +144,8 @@ endif() # Find perl executable # Perl is used to create omp.h (and other headers) along with kmp_i18n_id.inc and kmp_i18n_default.inc find_package(Perl REQUIRED) -# The perl scripts take the --os= flag which expects a certain format for operating systems. Until the -# perl scripts are removed, the most portable way to handle this is to have all operating systems that +# The perl scripts take the --os=/--arch= flags which expect a certain format for operating systems and arch's. +# Until the perl scripts are removed, the most portable way to handle this is to have all operating systems that # are neither Windows nor Mac (Most Unix flavors) be considered lin to the perl scripts. This is rooted # in that all the Perl scripts check the operating system and will fail if it isn't "valid". This # temporary solution lets us avoid trying to enumerate all the possible OS values inside the Perl modules. @@ -156,6 +156,15 @@ elseif(APPLE) else() set(LIBOMP_PERL_SCRIPT_OS lin) endif() +if(IA32) + set(LIBOMP_PERL_SCRIPT_ARCH 32) +elseif(MIC) + set(LIBOMP_PERL_SCRIPT_ARCH mic) +elseif(INTEL64) + set(LIBOMP_PERL_SCRIPT_ARCH 32e) +else() + set(LIBOMP_PERL_SCRIPT_ARCH ${LIBOMP_ARCH}) +endif() # Checking features # Check if version symbol assembler directives are supported diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 35899fcfff98..91a8336b495d 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -20,13 +20,13 @@ endif() add_custom_command( OUTPUT kmp_i18n_id.inc COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/message-converter.pl --os=${LIBOMP_PERL_SCRIPT_OS} - --arch=${LIBOMP_ARCH} --prefix=kmp_i18n --enum=kmp_i18n_id.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt + --prefix=kmp_i18n --enum=kmp_i18n_id.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt DEPENDS ${LIBOMP_SRC_DIR}/i18n/en_US.txt ${LIBOMP_TOOLS_DIR}/message-converter.pl ) add_custom_command( OUTPUT kmp_i18n_default.inc COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/message-converter.pl --os=${LIBOMP_PERL_SCRIPT_OS} - --arch=${LIBOMP_ARCH} --prefix=kmp_i18n --default=kmp_i18n_default.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt + --prefix=kmp_i18n --default=kmp_i18n_default.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt DEPENDS ${LIBOMP_SRC_DIR}/i18n/en_US.txt ${LIBOMP_TOOLS_DIR}/message-converter.pl ) diff --git a/openmp/runtime/tools/check-depends.pl b/openmp/runtime/tools/check-depends.pl index 02a7ddd9e92d..48e312aa0105 100755 --- a/openmp/runtime/tools/check-depends.pl +++ b/openmp/runtime/tools/check-depends.pl @@ -18,9 +18,10 @@ use FindBin; use lib "$FindBin::Bin/lib"; use tools; -use Platform ":vars"; our $VERSION = "0.005"; +my $target_os; +my $target_arch; # -------------------------------------------------------------------------------------------------- # Ouput parse error. @@ -331,7 +332,8 @@ my $expected; my $bare; Getopt::Long::Configure( "permute" ); get_options( - Platform::target_options(), + "os=s" => \$target_os, + "arch=s" => \$target_arch, "bare" => \$bare, "expected=s" => \$expected, ); diff --git a/openmp/runtime/tools/check-execstack.pl b/openmp/runtime/tools/check-execstack.pl index 43c2bb23a704..cf247425a1bc 100755 --- a/openmp/runtime/tools/check-execstack.pl +++ b/openmp/runtime/tools/check-execstack.pl @@ -18,9 +18,9 @@ use FindBin; use lib "$FindBin::Bin/lib"; use tools; -use Platform ":vars"; our $VERSION = "0.002"; +my $target_arch; sub execstack($) { my ( $file ) = @_; @@ -56,7 +56,7 @@ sub execstack($) { }; # sub execstack get_options( - Platform::target_options(), + "arch=s" => \$target_arch, ); foreach my $file ( @ARGV ) { diff --git a/openmp/runtime/tools/check-instruction-set.pl b/openmp/runtime/tools/check-instruction-set.pl index b77e207ab8da..b505e486e138 100755 --- a/openmp/runtime/tools/check-instruction-set.pl +++ b/openmp/runtime/tools/check-instruction-set.pl @@ -17,10 +17,12 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Platform ":vars"; use tools; our $VERSION = "0.004"; +my $target_os; +my $target_arch; +my $target_mic_arch; my $hex = qr{[0-9a-f]}i; # hex digit. @@ -182,17 +184,20 @@ sub check_file($;$$) { my $max_instructions; my $show_instructions; get_options( + "os=s" => \$target_os, + "arch=s" => \$target_arch, + "mic-arch=s" => \$target_mic_arch, "max-instructions=i" => \$max_instructions, "show-instructions!" => \$show_instructions, - Platform::target_options(), ); +my $target_platform = $target_os . "_" . $target_arch; if ( "$target_os" eq "lin" and "$target_mic_arch" eq "knf" ) { $mic_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmpxchg16b|clevict[12])}i; } else { $mic_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmov|cmpxchg16b|clevict[12])}i; }; if ( 0 ) { -} elsif ( $target_os eq "lin" and $target_arch eq "mic" ) { +} elsif ( $target_platform eq "lin_mic" ) { *bad_instr = \*bad_mic_instr; *bad_fmt = \*bad_mic_fmt; } elsif ( $target_platform eq "lin_32" ) { diff --git a/openmp/runtime/tools/message-converter.pl b/openmp/runtime/tools/message-converter.pl index f4f4b998e6bf..e22c928a5826 100755 --- a/openmp/runtime/tools/message-converter.pl +++ b/openmp/runtime/tools/message-converter.pl @@ -21,11 +21,11 @@ use FindBin; use lib "$FindBin::Bin/lib"; use tools; -use Platform ":vars"; our $VERSION = "0.04"; my $escape = qr{%}; my $placeholder = qr{(\d)\$(s|l?[du])}; +my $target_os; my $sections = { @@ -467,7 +467,7 @@ my $message_file; my $id; my $prefix = ""; get_options( - Platform::target_options(), + "os=s" => \$target_os, "enum-file=s" => \$enum_file, "signature-file=s" => \$signature_file, "default-file=s" => \$default_file,