cs: repair for 32-bit ELF
This commit is contained in:
parent
8e85441410
commit
9c0a3abfdb
219
racket/src/cs/c/configure
vendored
219
racket/src/cs/c/configure
vendored
|
@ -1811,6 +1811,189 @@ $as_echo "$ac_res" >&6; }
|
|||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_header_compile
|
||||
|
||||
# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
|
||||
# --------------------------------------------
|
||||
# Tries to find the compile-time value of EXPR in a program that includes
|
||||
# INCLUDES, setting VAR accordingly. Returns whether the value could be
|
||||
# computed
|
||||
ac_fn_c_compute_int ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
if test "$cross_compiling" = yes; then
|
||||
# Depending upon the size, compute the lo and hi bounds.
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) >= 0)];
|
||||
test_array [0] = 0;
|
||||
return test_array [0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_lo=0 ac_mid=0
|
||||
while :; do
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
return test_array [0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_hi=$ac_mid; break
|
||||
else
|
||||
as_fn_arith $ac_mid + 1 && ac_lo=$as_val
|
||||
if test $ac_lo -le $ac_mid; then
|
||||
ac_lo= ac_hi=
|
||||
break
|
||||
fi
|
||||
as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) < 0)];
|
||||
test_array [0] = 0;
|
||||
return test_array [0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_hi=-1 ac_mid=-1
|
||||
while :; do
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
return test_array [0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_lo=$ac_mid; break
|
||||
else
|
||||
as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
|
||||
if test $ac_mid -le $ac_hi; then
|
||||
ac_lo= ac_hi=
|
||||
break
|
||||
fi
|
||||
as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
else
|
||||
ac_lo= ac_hi=
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
# Binary search between lo and hi bounds.
|
||||
while test "x$ac_lo" != "x$ac_hi"; do
|
||||
as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
return test_array [0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_hi=$ac_mid
|
||||
else
|
||||
as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
case $ac_lo in #((
|
||||
?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
|
||||
'') ac_retval=1 ;;
|
||||
esac
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
static long int longval () { return $2; }
|
||||
static unsigned long int ulongval () { return $2; }
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
FILE *f = fopen ("conftest.val", "w");
|
||||
if (! f)
|
||||
return 1;
|
||||
if (($2) < 0)
|
||||
{
|
||||
long int i = longval ();
|
||||
if (i != ($2))
|
||||
return 1;
|
||||
fprintf (f, "%ld", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned long int i = ulongval ();
|
||||
if (i != ($2))
|
||||
return 1;
|
||||
fprintf (f, "%lu", i);
|
||||
}
|
||||
/* Do not output a trailing newline, as this causes \r\n confusion
|
||||
on some platforms. */
|
||||
return ferror (f) || fclose (f) != 0;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"; then :
|
||||
echo >>conftest.val; read $3 <conftest.val; ac_retval=0
|
||||
else
|
||||
ac_retval=1
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
rm -f conftest.val
|
||||
|
||||
fi
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_compute_int
|
||||
cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
@ -5082,6 +5265,42 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
############## other inferred machine properties ################
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
############## final output ################
|
||||
|
||||
# Pass certain configure args on to rktio
|
||||
|
|
|
@ -651,6 +651,10 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
############## other inferred machine properties ################
|
||||
|
||||
AC_CHECK_SIZEOF([void *])
|
||||
|
||||
############## final output ################
|
||||
|
||||
# Pass certain configure args on to rktio
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
|
||||
/* The size of a `void *', as computed by sizeof. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "cs_config.h"
|
||||
|
||||
#ifndef WIN32
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
@ -136,8 +138,13 @@ static char *get_self_path(char *exec_file)
|
|||
static long find_boot_section(char *me)
|
||||
{
|
||||
int fd, i;
|
||||
#if SIZEOF_VOID_P == 4
|
||||
Elf32_Ehdr e;
|
||||
Elf32_Shdr s;
|
||||
#else
|
||||
Elf64_Ehdr e;
|
||||
Elf64_Shdr s;
|
||||
#endif
|
||||
char *strs;
|
||||
|
||||
fd = open(me, O_RDONLY, 0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user