aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/libGL/files/patch-configure
blob: 24a359f2eed905a85b1a8d47e9378b71e6457c59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
--- configure.orig  2017-01-05 15:52:21 UTC
+++ configure
@@ -1962,7 +1962,7 @@ Optional Features:
                           Disable writable .text section on x86 (decreases
                           performance) [default=disabled]
   --enable-gallium-llvm   build gallium LLVM support [default=enabled on
-                          x86/x86_64]
+                          x86/amd64]
   --enable-llvm-shared-libs
                           link with LLVM shared libraries [default=enabled]
   --enable-valgrind       Build mesa with valgrind support (default: auto)
@@ -9622,7 +9622,7 @@ mips64*-*linux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+amd64-*kfreebsd*-gnu|amd64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out what ABI is being produced by ac_compile, and set linker
   # options accordingly.  Note that the listed cases only cover the
@@ -9639,13 +9639,13 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
     case `/usr/bin/file conftest.o` in
       *32-bit*)
    case $host in
-     x86_64-*kfreebsd*-gnu)
+     amd64-*kfreebsd*-gnu)
        LD="${LD-ld} -m elf_i386_fbsd"
        ;;
-     x86_64-*linux*)
+     amd64-*linux*)
        case `/usr/bin/file conftest.o` in
          *x86-64*)
-       LD="${LD-ld} -m elf32_x86_64"
+       LD="${LD-ld} -m elf32_amd64"
        ;;
          *)
        LD="${LD-ld} -m elf_i386"
@@ -9668,11 +9668,11 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
    ;;
       *64-bit*)
    case $host in
-     x86_64-*kfreebsd*-gnu)
-       LD="${LD-ld} -m elf_x86_64_fbsd"
+     amd64-*kfreebsd*-gnu)
+       LD="${LD-ld} -m elf_amd64_fbsd"
        ;;
-     x86_64-*linux*)
-       LD="${LD-ld} -m elf_x86_64"
+     amd64-*linux*)
+       LD="${LD-ld} -m elf_amd64"
        ;;
      powerpcle-*linux*)
        LD="${LD-ld} -m elf64lppc"
@@ -9754,8 +9754,8 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*|x86_64-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
+        i?86-*-solaris*|amd64-*-solaris*)
+          LD="${LD-ld} -m elf_amd64"
           ;;
         sparc*-*-solaris*)
           LD="${LD-ld} -m elf64_sparc"
@@ -11464,7 +11464,7 @@ lt_prog_compiler_static=
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64, which still supported -KPIC.
+      # old Intel for amd64, which still supported -KPIC.
       ecc*)
    lt_prog_compiler_wl='-Wl,'
    lt_prog_compiler_pic='-KPIC'
@@ -11907,7 +11907,7 @@ $as_echo_n "checking whether the $compil
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
   inherit_rpath=no
-  link_all_deplibs=unknown
+  link_all_deplibs=no
   module_cmds=
   module_expsym_cmds=
   old_archive_from_new_cmds=
@@ -12206,7 +12206,7 @@ _LT_EOF
    wlarc=
       else
    archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-   archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+   archive_expsym_cmds='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
       fi
       ;;
 
@@ -12225,7 +12225,7 @@ _LT_EOF
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
    archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-   archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+   archive_expsym_cmds='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
       else
    ld_shlibs=no
       fi
@@ -12254,7 +12254,7 @@ _LT_EOF
      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
        hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+       archive_expsym_cmds='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
      else
        ld_shlibs=no
      fi
@@ -12272,7 +12272,7 @@ _LT_EOF
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
    archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-   archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+   archive_expsym_cmds='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
       else
    ld_shlibs=no
       fi
@@ -12920,7 +12920,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >
    hardcode_direct_absolute=yes
    if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-     archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+     archive_expsym_cmds='echo "{ global:" > $lib-ver~      sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-version-script,$lib-ver'
      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
      export_dynamic_flag_spec='$wl-E'
    else
@@ -13769,7 +13769,7 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      library_names_spec='$libname$release$shared_ext$versuffix  $libname$release$shared_ext$major  $libname$shared_ext'            soname_spec='$libname$release$shared_ext$major'
       soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
@@ -14901,7 +14901,7 @@ striplib=
 old_striplib=
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -15153,7 +15153,7 @@ hardcode_automatic_CXX=no
 inherit_rpath_CXX=no
 module_cmds_CXX=
 module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
+link_all_deplibs_CXX=no
 old_archive_cmds_CXX=$old_archive_cmds
 reload_flag_CXX=$reload_flag
 reload_cmds_CXX=$reload_cmds
@@ -15364,7 +15364,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # archiving commands below assume that GNU ld is being used.
       if test yes = "$with_gnu_ld"; then
         archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+        archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~       sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
 
         hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
         export_dynamic_flag_spec_CXX='$wl--export-dynamic'
@@ -16056,7 +16056,7 @@ fi
        case `$CC -V 2>&1` in
          *"Version 7."*)
            archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+       archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
        ;;
          *)  # Version 8.0 or newer
            tmp_idyn=
@@ -16064,7 +16064,7 @@ fi
          ia64*) tmp_idyn=' -i_dynamic';;
        esac
            archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-       archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+       archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
        ;;
        esac
        archive_cmds_need_lc_CXX=no
@@ -16096,7 +16096,7 @@ fi
          ;;
        *) # Version 6 and above use weak symbols
          archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-         archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+         archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~      sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib'
          ;;
        esac
 
@@ -16107,7 +16107,7 @@ fi
      cxx*)
        # Compaq C++
        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+       archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-version-script $wl$lib-ver'
 
        runpath_var=LD_RUN_PATH
        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -16141,7 +16141,7 @@ fi
          # Sun C++ 5.9
          no_undefined_flag_CXX=' -zdefs'
          archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-         archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+         archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~      sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-version-script $wl$lib-ver'
          hardcode_libdir_flag_spec_CXX='-R$libdir'
          whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
          compiler_needs_object_CXX=yes
@@ -16209,7 +16209,7 @@ fi
      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
      hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
-       archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+       archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~        sed -e "s|$|;|" < $export_symbols >> $lib-ver~  echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-version-script,$lib-ver -o $lib'
        export_dynamic_flag_spec_CXX='$wl-E'
        whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
      fi
@@ -16844,7 +16844,7 @@ lt_prog_compiler_static_CXX=
        lt_prog_compiler_pic_CXX='-fPIC'
        ;;
      ecpc* )
-       # old Intel C++ for x86_64, which still supported -KPIC.
+       # old Intel C++ for amd64, which still supported -KPIC.
        lt_prog_compiler_wl_CXX='-Wl,'
        lt_prog_compiler_pic_CXX='-KPIC'
        lt_prog_compiler_static_CXX='-static'
@@ -17731,7 +17731,7 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      library_names_spec='$libname$release$shared_ext$versuffix  $libname$release$shared_ext$major  $libname$shared_ext'            soname_spec='$libname$release$shared_ext$major'
       soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
@@ -20328,7 +20328,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
    for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
     if test -n "$ac_prev"; then
       case $ac_word in
-        i?86 | x86_64 | ppc | ppc64)
+        i?86 | amd64 | ppc | ppc64)
           if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
         ac_arch=$ac_word
           else
@@ -20915,10 +20915,10 @@ asm_arch=""
 $as_echo_n "checking whether to enable assembly... " >&6; }
 test "x$enable_asm" = xno && { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-# disable if cross compiling on x86/x86_64 since we must run gen_matypes
+# disable if cross compiling on x86/amd64 since we must run gen_matypes
 if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then
     case "$host_cpu" in
-    i?86 | x86_64 | amd64)
+    i?86 | amd64 | amd64)
         if test "x$host_cpu" != "x$target_cpu"; then
             enable_asm=no
             { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cross compiling" >&5
@@ -20937,10 +20937,10 @@ if test "x$enable_asm" = xyes; then
             ;;
         esac
         ;;
-    x86_64|amd64)
+    amd64|amd64)
         case "$host_os" in
         linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
-            asm_arch=x86_64
+            asm_arch=amd64
             ;;
         esac
         ;;
@@ -20959,10 +20959,10 @@ if test "x$enable_asm" = xyes; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, x86" >&5
 $as_echo "yes, x86" >&6; }
         ;;
-    x86_64|amd64)
+    amd64|amd64)
         DEFINES="$DEFINES -DUSE_X86_64_ASM"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, x86_64" >&5
-$as_echo "yes, x86_64" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, amd64" >&5
+$as_echo "yes, amd64" >&6; }
         ;;
     sparc)
         DEFINES="$DEFINES -DUSE_SPARC_ASM"
@@ -21955,7 +21955,7 @@ fi
 
 
 case "$host_os" in
-linux*)
+linux*|freebsd*)
     dri3_default=yes
     ;;
 *)
@@ -23968,6 +23968,18 @@ if test "x$enable_dri" = xyes; then
         ;;
     *freebsd* | dragonfly* | *netbsd* | openbsd*)
         DEFINES="$DEFINES -DHAVE_ALIAS"
+        if test "x$enable_dri3" = xyes; then
+            DEFINES="$DEFINES -DHAVE_DRI3"
+        fi
+
+        case "$host_cpu" in
+        powerpc* | sparc*)
+            # Build only the drivers for cards that exist on PowerPC/sparc
+            if test "x$with_dri_drivers" = "xyes"; then
+                with_dri_drivers="r200 radeon swrast"
+            fi
+            ;;
+        esac
         ;;
     gnu*)
         DEFINES="$DEFINES -DHAVE_ALIAS"
@@ -25849,9 +25861,19 @@ if test "x$enable_opencl" = xyes; then
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
     fi
 
+    if test "x$acv_mesa_CLANG" = xno; then
+
+    GCC_VERSION=`$CC -dumpversion`
+    if test $? -eq 0; then
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
+    fi
+
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
         as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5
     fi
+# end of clang test.
+    fi
 
     if test "x$have_libclc" = xno; then
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
@@ -26375,26 +26397,26 @@ fi
 strip_unwanted_llvm_flags() {
     # Use \> (marks the end of the word)
     echo `$1` | sed \
-   -e 's/-march=\S*//g' \
-   -e 's/-mtune=\S*//g' \
-   -e 's/-mcpu=\S*//g' \
-   -e 's/-DNDEBUG\>//g' \
-   -e 's/-D_GNU_SOURCE\>//g' \
-   -e 's/-pedantic\>//g' \
-   -e 's/-Wcovered-switch-default\>//g' \
-   -e 's/-O.\>//g' \
-   -e 's/-g\>//g' \
-   -e 's/-Wall\>//g' \
-   -e 's/-Wcast-qual\>//g' \
-   -e 's/-Woverloaded-virtual\>//g' \
-   -e 's/-fcolor-diagnostics\>//g' \
-   -e 's/-fdata-sections\>//g' \
-   -e 's/-ffunction-sections\>//g' \
-   -e 's/-fno-exceptions\>//g' \
-   -e 's/-fomit-frame-pointer\>//g' \
-   -e 's/-fvisibility-inlines-hidden\>//g' \
-   -e 's/-fPIC\>//g' \
-   -e 's/-fstack-protector-strong\>//g'
+   -e 's/-march=[:graph:]* //g' \
+   -e 's/-mtune=[:graph:]* //g' \
+   -e 's/-mcpu=[:graph:]* //g' \
+   -e 's/-DNDEBUG[[:>:]]//g' \
+   -e 's/-D_GNU_SOURCE[[:>:]]//g' \
+   -e 's/-pedantic[[:>:]]//g' \
+   -e 's/-Wcovered-switch-default[[:>:]]//g' \
+   -e 's/-O.[[:>:]]//g' \
+   -e 's/-g[[:>:]]//g' \
+   -e 's/-Wall[[:>:]]//g' \
+   -e 's/-Wcast-qual[[:>:]]//g' \
+   -e 's/-Woverloaded-virtual[[:>:]]//g' \
+   -e 's/-fcolor-diagnostics[[:>:]]//g' \
+   -e 's/-fdata-sections[[:>:]]//g' \
+   -e 's/-ffunction-sections[[:>:]]//g' \
+   -e 's/-fno-exceptions[[:>:]]//g' \
+   -e 's/-fomit-frame-pointer[[:>:]]//g' \
+   -e 's/-fvisibility-inlines-hidden[[:>:]]//g' \
+   -e 's/-fPIC[[:>:]]//g' \
+   -e 's/-fstack-protector-strong[[:>:]]//g'
 }
 
 llvm_check_version_for() {
@@ -26410,7 +26432,7 @@ if test -z "$with_gallium_drivers"; then
 fi
 if test "x$enable_gallium_llvm" = xauto; then
     case "$host_cpu" in
-    i*86|x86_64|amd64) enable_gallium_llvm=yes;;
+    i*86|amd64|amd64) enable_gallium_llvm=yes;;
     esac
 fi
 if test "x$enable_gallium_llvm" = xyes || test "x$HAVE_RADEON_VULKAN" = xyes; then
@@ -26670,9 +26692,6 @@ fi
                 CLANG_LIBDIR=${LLVM_LIBDIR}
             fi
             CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
-            if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
-  as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
-fi
         fi
     else
         MESA_LLVM=0
@@ -26752,7 +26771,7 @@ gallium_require_llvm() {
     if test "x$MESA_LLVM" = x0; then
         case "$host" in *gnux32) return;; esac
         case "$host_cpu" in
-        i*86|x86_64|amd64) as_fn_error $? "LLVM is required to build $1 on x86 and x86_64" "$LINENO" 5;;
+        i*86|amd64|amd64) as_fn_error $? "LLVM is required to build $1 on x86 and amd64" "$LINENO" 5;;
         esac
     fi
 }
@@ -28207,7 +28226,7 @@ else
 fi
 
 
- if test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64; then
+ if test "x$asm_arch" = xx86 -o "x$asm_arch" = xamd64; then
   HAVE_X86_ASM_TRUE=
   HAVE_X86_ASM_FALSE='#'
 else
@@ -28215,7 +28234,7 @@ else
   HAVE_X86_ASM_FALSE=
 fi
 
- if test "x$asm_arch" = xx86_64; then
+ if test "x$asm_arch" = xamd64; then
   HAVE_X86_64_ASM_TRUE=
   HAVE_X86_64_ASM_FALSE='#'
 else