diff options
author | Mike Frysinger <vapier@gentoo.org> | 2024-01-10 22:25:51 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2024-01-10 22:37:03 -0500 |
commit | 08a7937f3a7301254e0ee98a93d94010e4ce5c5a (patch) | |
tree | a811637e83fc126ccfd8ee86927d7ff9d21d9390 /sim/configure | |
parent | dbd4aebe5ba95f95735e333e5483ad4a80726a08 (diff) | |
download | binutils-08a7937f3a7301254e0ee98a93d94010e4ce5c5a.zip binutils-08a7937f3a7301254e0ee98a93d94010e4ce5c5a.tar.gz binutils-08a7937f3a7301254e0ee98a93d94010e4ce5c5a.tar.bz2 |
sim: m32r: fixup some of the int<->pointer casts
The m32r trap code was written for a 32-bit Linux host (and really, one
whose Linux ABI matched pretty exactly). This has lead to conversions
between integers and pointers which breaks down hard on 64-bit hosts.
Clean up some of the functions where possible to avoid unnecessary
conversions, use uintptr_t to cast 32-bit target pointers to host
pointers in some places, and just stub out a few functions that can't
easily be salvaged currently when sizeof(void*) is not 32-bits. This
is a bit ugly, but lets us enable warnings for the whole file.
Diffstat (limited to 'sim/configure')
-rwxr-xr-x | sim/configure | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/sim/configure b/sim/configure index 36cadce..4ea5083 100755 --- a/sim/configure +++ b/sim/configure @@ -8882,6 +8882,40 @@ _ACEOF 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 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct statfs" >&5 $as_echo_n "checking for struct statfs... " >&6; } if ${sim_cv_struct_statfs+:} false; then : @@ -12858,7 +12892,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12861 "configure" +#line 12895 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12964,7 +12998,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12967 "configure" +#line 13001 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13961,7 +13995,6 @@ fi - ac_fn_c_check_decl "$LINENO" "ffs" "ac_cv_have_decl_ffs" "$ac_includes_default" if test "x$ac_cv_have_decl_ffs" = xyes; then : ac_have_decl=1 |