Get rid of ASM_GLOBAL_DIRECTIVE.
[platform/upstream/glibc.git] / sysdeps / x86_64 / configure
1
2 # as_fn_set_status STATUS
3 # -----------------------
4 # Set $? to STATUS, without forking.
5 as_fn_set_status ()
6 {
7   return $1
8 } # as_fn_set_status
9
10 # as_fn_exit STATUS
11 # -----------------
12 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
13 as_fn_exit ()
14 {
15   set +e
16   as_fn_set_status $1
17   exit $1
18 } # as_fn_exit
19 if expr a : '\(a\)' >/dev/null 2>&1 &&
20    test "X`expr 00001 : '.*\(...\)'`" = X001; then
21   as_expr=expr
22 else
23   as_expr=false
24 fi
25
26 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
27   as_basename=basename
28 else
29   as_basename=false
30 fi
31
32 as_me=`$as_basename -- "$0" ||
33 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
34          X"$0" : 'X\(//\)$' \| \
35          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
36 $as_echo X/"$0" |
37     sed '/^.*\/\([^/][^/]*\)\/*$/{
38             s//\1/
39             q
40           }
41           /^X\/\(\/\/\)$/{
42             s//\1/
43             q
44           }
45           /^X\/\(\/\).*/{
46             s//\1/
47             q
48           }
49           s/.*/./; q'`
50
51
52   as_lineno_1=$LINENO as_lineno_1a=$LINENO
53   as_lineno_2=$LINENO as_lineno_2a=$LINENO
54   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
55   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
56   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
57   sed -n '
58     p
59     /[$]LINENO/=
60   ' <$as_myself |
61     sed '
62       s/[$]LINENO.*/&-/
63       t lineno
64       b
65       :lineno
66       N
67       :loop
68       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
69       t loop
70       s/-\n.*//
71     ' >$as_me.lineno &&
72   chmod +x "$as_me.lineno" ||
73     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
74
75   # Don't try to exec as it changes $[0], causing all sort of problems
76   # (the dirname of $[0] is not the place where we might find the
77   # original and so on.  Autoconf is especially sensitive to this).
78   . "./$as_me.lineno"
79   # Exit status is that of the last command.
80   exit
81 }
82
83
84 # ac_fn_c_try_compile LINENO
85 # --------------------------
86 # Try to compile conftest.$ac_ext, and return whether this succeeded.
87 ac_fn_c_try_compile ()
88 {
89   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
90   rm -f conftest.$ac_objext
91   if { { ac_try="$ac_compile"
92 case "(($ac_try" in
93   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
94   *) ac_try_echo=$ac_try;;
95 esac
96 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
97 $as_echo "$ac_try_echo"; } >&5
98   (eval "$ac_compile") 2>conftest.err
99   ac_status=$?
100   if test -s conftest.err; then
101     grep -v '^ *+' conftest.err >conftest.er1
102     cat conftest.er1 >&5
103     mv -f conftest.er1 conftest.err
104   fi
105   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
106   test $ac_status = 0; } && {
107          test -z "$ac_c_werror_flag" ||
108          test ! -s conftest.err
109        } && test -s conftest.$ac_objext; then :
110   ac_retval=0
111 else
112   $as_echo "$as_me: failed program was:" >&5
113 sed 's/^/| /' conftest.$ac_ext >&5
114
115         ac_retval=1
116 fi
117   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
118   as_fn_set_status $ac_retval
119
120 } # ac_fn_c_try_compile
121
122 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
123 # -------------------------------------------------------
124 # Tests whether HEADER exists and can be compiled using the include files in
125 # INCLUDES, setting the cache variable VAR accordingly.
126 ac_fn_c_check_header_compile ()
127 {
128   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
129   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
130 $as_echo_n "checking for $2... " >&6; }
131 if eval \${$3+:} false; then :
132   $as_echo_n "(cached) " >&6
133 else
134   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
135 /* end confdefs.h.  */
136 $4
137 #include <$2>
138 _ACEOF
139 if ac_fn_c_try_compile "$LINENO"; then :
140   eval "$3=yes"
141 else
142   eval "$3=no"
143 fi
144 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
145 fi
146 eval ac_res=\$$3
147                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
148 $as_echo "$ac_res" >&6; }
149   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
150
151 } # ac_fn_c_check_header_compile
152 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
153  # Local configure fragment for sysdeps/x86_64.
154
155
156 ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "/* No default includes.  */
157 "
158 if test "x$ac_cv_header_cpuid_h" = xyes; then :
159
160 else
161   as_fn_error $? "gcc must provide the <cpuid.h> header" "$LINENO" 5
162 fi
163
164
165
166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -g produces usable source locations for assembler-with-cpp" >&5
167 $as_echo_n "checking if -g produces usable source locations for assembler-with-cpp... " >&6; }
168 if ${libc_cv_cpp_asm_debuginfo+:} false; then :
169   $as_echo_n "(cached) " >&6
170 else
171   cat > conftest.S <<EOF
172 #include "confdefs.h"
173
174 /* comment on
175    two lines */
176         ${libc_cv_dot_text}
177         .globl foo
178 foo:
179         /* Unfortunately this test only works for a real instruction,
180            not for any of the machine-independent pseudo-ops.
181            So we just have to assume everybody has a "nop".  */
182         nop
183         /* comment */
184         nop
185         /* comment */
186         nop
187 EOF
188 if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&5'
189   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
190   (eval $ac_try) 2>&5
191   ac_status=$?
192   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
193   test $ac_status = 0; }; } && {
194    ac_pattern='conftest\.S'
195    { ac_try='readelf --debug-dump=line conftest.o |
196                    grep $ac_pattern 1>&5'
197   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
198   (eval $ac_try) 2>&5
199   ac_status=$?
200   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
201   test $ac_status = 0; }; }
202   }; then
203   libc_cv_cpp_asm_debuginfo=yes
204 else
205   libc_cv_cpp_asm_debuginfo=no
206 fi
207 rm -f conftest*
208 fi
209 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cpp_asm_debuginfo" >&5
210 $as_echo "$libc_cv_cpp_asm_debuginfo" >&6; }
211 if test $libc_cv_cpp_asm_debuginfo = yes; then
212   $as_echo "#define HAVE_CPP_ASM_DEBUGINFO 1" >>confdefs.h
213
214 fi
215
216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
217 $as_echo_n "checking for SSE4 support... " >&6; }
218 if ${libc_cv_cc_sse4+:} false; then :
219   $as_echo_n "(cached) " >&6
220 else
221   if { ac_try='${CC-cc} -msse4 -xc /dev/null -S -o /dev/null'
222   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
223   (eval $ac_try) 2>&5
224   ac_status=$?
225   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
226   test $ac_status = 0; }; }; then :
227   libc_cv_cc_sse4=yes
228 else
229   libc_cv_cc_sse4=no
230 fi
231
232 fi
233 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse4" >&5
234 $as_echo "$libc_cv_cc_sse4" >&6; }
235 if test $libc_cv_cc_sse4 = yes; then
236   $as_echo "#define HAVE_SSE4_SUPPORT 1" >>confdefs.h
237
238 fi
239
240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5
241 $as_echo_n "checking for AVX support... " >&6; }
242 if ${libc_cv_cc_avx+:} false; then :
243   $as_echo_n "(cached) " >&6
244 else
245   if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null'
246   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
247   (eval $ac_try) 2>&5
248   ac_status=$?
249   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
250   test $ac_status = 0; }; }; then :
251   libc_cv_cc_avx=yes
252 else
253   libc_cv_cc_avx=no
254 fi
255
256 fi
257 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5
258 $as_echo "$libc_cv_cc_avx" >&6; }
259 if test $libc_cv_cc_avx = yes; then
260   $as_echo "#define HAVE_AVX_SUPPORT 1" >>confdefs.h
261
262 fi
263
264 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5
265 $as_echo_n "checking for AVX encoding of SSE instructions... " >&6; }
266 if ${libc_cv_cc_sse2avx+:} false; then :
267   $as_echo_n "(cached) " >&6
268 else
269   if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null'
270   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
271   (eval $ac_try) 2>&5
272   ac_status=$?
273   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
274   test $ac_status = 0; }; }; then :
275   libc_cv_cc_sse2avx=yes
276 else
277   libc_cv_cc_sse2avx=no
278 fi
279
280 fi
281 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
282 $as_echo "$libc_cv_cc_sse2avx" >&6; }
283 if test $libc_cv_cc_sse2avx = yes; then
284   $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h
285
286 fi
287
288 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5
289 $as_echo_n "checking for FMA4 support... " >&6; }
290 if ${libc_cv_cc_fma4+:} false; then :
291   $as_echo_n "(cached) " >&6
292 else
293   if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null'
294   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
295   (eval $ac_try) 2>&5
296   ac_status=$?
297   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
298   test $ac_status = 0; }; }; then :
299   libc_cv_cc_fma4=yes
300 else
301   libc_cv_cc_fma4=no
302 fi
303
304 fi
305 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5
306 $as_echo "$libc_cv_cc_fma4" >&6; }
307 if test $libc_cv_cc_fma4 = yes; then
308   $as_echo "#define HAVE_FMA4_SUPPORT 1" >>confdefs.h
309
310 fi
311
312 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5
313 $as_echo_n "checking for -mno-vzeroupper support... " >&6; }
314 if ${libc_cv_cc_novzeroupper+:} false; then :
315   $as_echo_n "(cached) " >&6
316 else
317   if { ac_try='${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null'
318   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
319   (eval $ac_try) 2>&5
320   ac_status=$?
321   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
322   test $ac_status = 0; }; }; then :
323   libc_cv_cc_novzeroupper=yes
324 else
325   libc_cv_cc_novzeroupper=no
326 fi
327
328 fi
329 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
330 $as_echo "$libc_cv_cc_novzeroupper" >&6; }
331
332 # Check for support of thread-local storage handling in assembler and linker.
333 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86-64 TLS support" >&5
334 $as_echo_n "checking for x86-64 TLS support... " >&6; }
335 if ${libc_cv_x86_64_tls+:} false; then :
336   $as_echo_n "(cached) " >&6
337 else
338   cat > conftest.s <<\EOF
339         .section ".tdata", "awT", @progbits
340         .globl foo
341 foo:    .quad   1
342         .section ".tbss", "awT", @nobits
343         .globl bar
344 bar:    .skip   8
345         .text
346 baz:    leaq    bar@TLSLD(%rip), %rdi
347         leaq    bar@DTPOFF(%rax), %rcx
348         addq    foo@GOTTPOFF(%rip), %rax
349         movq    $bar@TPOFF, %rdx
350 EOF
351 if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
352   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
353   (eval $ac_try) 2>&5
354   ac_status=$?
355   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
356   test $ac_status = 0; }; }; then
357   libc_cv_x86_64_tls=yes
358 else
359   libc_cv_x86_64_tls=no
360 fi
361 rm -f conftest*
362 fi
363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_64_tls" >&5
364 $as_echo "$libc_cv_x86_64_tls" >&6; }
365 if test $libc_cv_x86_64_tls = no; then
366   as_fn_error $? "the assembler must support TLS" "$LINENO" 5
367 fi
368
369 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
370
371 # work around problem with autoconf and empty lines at the end of files