Harden and adjust 'gcc/configure' parsing of '--enable-offload-targets'
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 23 Apr 2020 19:59:07 +0000 (21:59 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Wed, 29 Apr 2020 07:47:34 +0000 (09:47 +0200)
Fix-up for commit d228ee80f8578be474595a517a228111fac26c5e "re PR
bootstrap/92314 (missing omp-device-properties', needed by
's-omp-device-properties-h')".

gcc/
* configure.ac <$enable_offload_targets>: Do parsing as done
elsewhere.
* configure: Regenerate.

gcc/ChangeLog
gcc/configure
gcc/configure.ac

index 85d1c2b6f758868735b8b777fb79519cd124bb77..3df46e498f5795349f7dbff5bee483674df5c2df 100644 (file)
@@ -1,5 +1,9 @@
 2020-04-29  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * configure.ac <$enable_offload_targets>: Do parsing as done
+       elsewhere.
+       * configure: Regenerate.
+
        * configure.ac <$enable_offload_targets>: 'amdgcn' is 'gcn'.
        * configure: Regenerate.
 
index 83101072aea0b940b7d316217ba4248f5c248057..c7bf5d1fdc6bb93c32a48161df706272eba6c4f1 100755 (executable)
@@ -7920,18 +7920,21 @@ for tgt in `echo $enable_offload_targets | sed 's/,/ /g'`; do
   else
     enable_offloading=1
     case "$tgt" in
-      *-intelmicemul-*)
+      *-intelmic-* | *-intelmicemul-*)
        omp_device_property=omp-device-properties-i386
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/i386/t-omp-device"
        ;;
-      amdgcn*-*)
+      amdgcn*)
        omp_device_property=omp-device-properties-gcn
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/gcn/t-omp-device"
        ;;
-      nvptx*-*)
+      nvptx*)
        omp_device_property=omp-device-properties-nvptx
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/nvptx/t-omp-device"
        ;;
+      *)
+       as_fn_error $? "unknown offload target specified" "$LINENO" 5
+       ;;
     esac
     omp_device_properties="${omp_device_properties} ${tgt}=${omp_device_property}"
     omp_device_property_deps="${omp_device_property_deps} ${omp_device_property}"
@@ -18985,7 +18988,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18988 "configure"
+#line 18991 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19091,7 +19094,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19094 "configure"
+#line 19097 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index b604047ae456a928218fc19c00279af12553b2ab..72f79f7ed3223024dd073219c236467d44a332aa 100644 (file)
@@ -1045,18 +1045,21 @@ for tgt in `echo $enable_offload_targets | sed 's/,/ /g'`; do
   else
     enable_offloading=1
     case "$tgt" in
-      *-intelmicemul-*)
+      *-intelmic-* | *-intelmicemul-*)
        omp_device_property=omp-device-properties-i386
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/i386/t-omp-device"
        ;;
-      amdgcn*-*)
+      amdgcn*)
        omp_device_property=omp-device-properties-gcn
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/gcn/t-omp-device"
        ;;
-      nvptx*-*)
+      nvptx*)
        omp_device_property=omp-device-properties-nvptx
        omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/nvptx/t-omp-device"
        ;;
+      *)
+       AC_MSG_ERROR([unknown offload target specified])
+       ;;
     esac
     omp_device_properties="${omp_device_properties} ${tgt}=${omp_device_property}"
     omp_device_property_deps="${omp_device_property_deps} ${omp_device_property}"