libgomp: Use sizeof(void*) based checks instead of looking through $CC $CFLAGS for -m32/-mx32
Some gcc configurations default to -m32 but support -m64 too. This patch just makes the ILP32 tests more reliable by following what e.g. libsanitizer configury does. 2021-03-04 Jakub Jelinek <jakub@redhat.com> * configure.ac: Add AC_CHECK_SIZEOF([void *]). * plugin/configfrag.ac: Check $ac_cv_sizeof_void_p value instead of checking of -m32 or -mx32 options on the command line. * config.h.in: Regenerated. * configure: Regenerated.
This commit is contained in:
parent
d259ab1576
commit
f65e551f73
|
@ -183,6 +183,9 @@
|
|||
/* Define if all infrastructure, needed for plugins, is supported. */
|
||||
#undef PLUGIN_SUPPORT
|
||||
|
||||
/* The size of `void *', as computed by sizeof. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
|
|
|
@ -2058,60 +2058,6 @@ fi
|
|||
|
||||
} # ac_fn_c_check_header_mongrel
|
||||
|
||||
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
|
||||
# -------------------------------------------
|
||||
# Tests whether TYPE exists after having included INCLUDES, setting cache
|
||||
# variable VAR accordingly.
|
||||
ac_fn_c_check_type ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
|
||||
$as_echo_n "checking for $2... " >&6; }
|
||||
if eval \${$3+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
eval "$3=no"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof ($2))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof (($2)))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
else
|
||||
eval "$3=yes"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_type
|
||||
|
||||
# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
|
||||
# --------------------------------------------
|
||||
# Tries to find the compile-time value of EXPR in a program that includes
|
||||
|
@ -2294,6 +2240,60 @@ rm -f conftest.val
|
|||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_compute_int
|
||||
|
||||
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
|
||||
# -------------------------------------------
|
||||
# Tests whether TYPE exists after having included INCLUDES, setting cache
|
||||
# variable VAR accordingly.
|
||||
ac_fn_c_check_type ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
|
||||
$as_echo_n "checking for $2... " >&6; }
|
||||
if eval \${$3+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
eval "$3=no"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof ($2))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof (($2)))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
else
|
||||
eval "$3=yes"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_type
|
||||
cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
@ -11421,7 +11421,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11434 "configure"
|
||||
#line 11424 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -11527,7 +11527,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11540 "configure"
|
||||
#line 11530 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -14251,16 +14251,6 @@ freebsd* | dragonfly*)
|
|||
esac
|
||||
;;
|
||||
|
||||
gnu*)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
|
||||
soname_spec='${libname}${release}${shared_ext}$major'
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
hardcode_into_libs=yes
|
||||
;;
|
||||
|
||||
haiku*)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
|
@ -14382,7 +14372,7 @@ linux*oldld* | linux*aout* | linux*coff*)
|
|||
# project, but have not yet been accepted: they are GCC-local changes
|
||||
# for the time being. (See
|
||||
# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
|
@ -15005,9 +14995,43 @@ $as_echo "#define LIBGOMP_OFFLOADED_ONLY 1" >>confdefs.h
|
|||
|
||||
fi
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
# This bug is HP SR number 8606223364.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
|
||||
$as_echo_n "checking size of void *... " >&6; }
|
||||
if ${ac_cv_sizeof_void_p+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
|
||||
|
||||
else
|
||||
if test "$ac_cv_type_void_p" = yes; then
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error 77 "cannot compute sizeof (void *)
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_cv_sizeof_void_p=0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
|
||||
$as_echo "$ac_cv_sizeof_void_p" >&6; }
|
||||
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
# Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2014-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2014-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Mentor Embedded.
|
||||
#
|
||||
|
@ -15274,8 +15298,8 @@ if test x"$enable_offload_targets" != x; then
|
|||
nvptx*)
|
||||
case "${target}" in
|
||||
aarch64*-*-* | powerpc64le-*-* | x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "* | *" -mx32 "*)
|
||||
case "$ac_cv_sizeof_void_p" in
|
||||
4)
|
||||
# PR libgomp/65099: Currently, we only support offloading in
|
||||
# 64-bit configurations.
|
||||
PLUGIN_NVPTX=0
|
||||
|
@ -15343,8 +15367,8 @@ rm -f core conftest.err conftest.$ac_objext \
|
|||
amdgcn*)
|
||||
case "${target}" in
|
||||
x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "*|*" -mx32 "*)
|
||||
case "$ac_cv_sizeof_void_p" in
|
||||
4)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -221,6 +221,8 @@ if test x$libgomp_offloaded_only = xyes; then
|
|||
[Define to 1 if building libgomp for an accelerator-only target.])
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF([void *])
|
||||
|
||||
m4_include([plugin/configfrag.ac])
|
||||
|
||||
# Check for functions needed.
|
||||
|
|
|
@ -160,8 +160,8 @@ if test x"$enable_offload_targets" != x; then
|
|||
nvptx*)
|
||||
case "${target}" in
|
||||
aarch64*-*-* | powerpc64le-*-* | x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "* | *" -mx32 "*)
|
||||
case "$ac_cv_sizeof_void_p" in
|
||||
4)
|
||||
# PR libgomp/65099: Currently, we only support offloading in
|
||||
# 64-bit configurations.
|
||||
PLUGIN_NVPTX=0
|
||||
|
@ -218,8 +218,8 @@ if test x"$enable_offload_targets" != x; then
|
|||
amdgcn*)
|
||||
case "${target}" in
|
||||
x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "*|*" -mx32 "*)
|
||||
case "$ac_cv_sizeof_void_p" in
|
||||
4)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Reference in New Issue