diff options
author | Mike Sperber <[email protected]> | 2012-03-22 18:00:31 +0100 |
---|---|---|
committer | Mike Sperber <[email protected]> | 2012-03-23 09:15:19 +0100 |
commit | 933e701dac1936c6f15c765b5687fbc623464ec7 (patch) | |
tree | 95bef4a51a14f512c23348e39cbfb336bc22475b /xcomp | |
parent | 3087769515ea9bfc75f7d7b8897bc897c7f13931 (diff) | |
download | otp-933e701dac1936c6f15c765b5687fbc623464ec7.tar.gz otp-933e701dac1936c6f15c765b5687fbc623464ec7.tar.bz2 otp-933e701dac1936c6f15c765b5687fbc623464ec7.zip |
Unbreak floating point on middle-endian machines.
On some ARMs (and maybe other platforms), doubles are stored with the
the two 32-bit words reversed with respect to more common
architectures.
The symptom is this:
> io_lib:write(1.0).
"0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005299808824"
Detect that and account for it when decoding floats.
Diffstat (limited to 'xcomp')
-rw-r--r-- | xcomp/README.md | 8 | ||||
-rw-r--r-- | xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf | 9 | ||||
-rw-r--r-- | xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf | 9 | ||||
-rw-r--r-- | xcomp/erl-xcomp-mips-linux.conf | 9 | ||||
-rw-r--r-- | xcomp/erl-xcomp-vars.sh | 2 | ||||
-rw-r--r-- | xcomp/erl-xcomp-vxworks_ppc32.conf | 9 | ||||
-rw-r--r-- | xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf | 9 | ||||
-rw-r--r-- | xcomp/erl-xcomp.conf.template | 9 |
8 files changed, 63 insertions, 1 deletions
diff --git a/xcomp/README.md b/xcomp/README.md index 2d79107283..98e71d5962 100644 --- a/xcomp/README.md +++ b/xcomp/README.md @@ -430,6 +430,14 @@ When a variable has been set, no warning will be issued. `configure` will fail unless this variable is set. Since no default value is used, `configure` will try to figure this out automatically. +* `erl_xcomp_double_middle` - `yes|no`. No default. If `yes`, the + target system must have doubles in "middle-endian" format. If + `no`, it has "regular" endianness. This can often be automatically + detected, but not always. If not automatically detected, + `configure` will fail unless this variable is set. Since no + default value is used, `configure` will try to figure this out + automatically. + * `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`, the target system must have a working `clock_gettime()` implementation that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf index f9fff0fa8e..287cb787d9 100644 --- a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf +++ b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf @@ -187,6 +187,15 @@ erl_xcomp_sysroot="$TILERA_ROOT/tile" # value is used, `configure' will try to figure this out automatically. #erl_xcomp_bigendian= +# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf index 31f5306c1a..9e553e6217 100644 --- a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf +++ b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf @@ -190,6 +190,15 @@ erl_xcomp_sysroot="$ATMEL_SYSROOT_AVR32" # value is used, `configure' will try to figure this out automatically. #erl_xcomp_bigendian= +# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp-mips-linux.conf b/xcomp/erl-xcomp-mips-linux.conf index 3ac057bb4c..2195b7d6e9 100644 --- a/xcomp/erl-xcomp-mips-linux.conf +++ b/xcomp/erl-xcomp-mips-linux.conf @@ -187,6 +187,15 @@ CFLAGS=-Os # value is used, `configure' will try to figure this out automatically. #erl_xcomp_bigendian= +# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp-vars.sh b/xcomp/erl-xcomp-vars.sh index d9972eb3db..168b25262a 100644 --- a/xcomp/erl-xcomp-vars.sh +++ b/xcomp/erl-xcomp-vars.sh @@ -26,4 +26,4 @@ # and precious variables in $ERL_TOP/erts/aclocal.m4. # -erl_xcomp_vars="erl_xcomp_sysroot erl_xcomp_isysroot erl_xcomp_bigendian erl_xcomp_linux_clock_gettime_correction erl_xcomp_linux_nptl erl_xcomp_linux_usable_sigusrx erl_xcomp_linux_usable_sigaltstack erl_xcomp_poll erl_xcomp_kqueue erl_xcomp_putenv_copy erl_xcomp_reliable_fpe erl_xcomp_getaddrinfo erl_xcomp_gethrvtime_procfs_ioctl erl_xcomp_clock_gettime_cpu_time erl_xcomp_after_morecore_hook erl_xcomp_dlsym_brk_wrappers" +erl_xcomp_vars="erl_xcomp_sysroot erl_xcomp_isysroot erl_xcomp_bigendian erl_xcomp_double_middle_endian erl_xcomp_linux_clock_gettime_correction erl_xcomp_linux_nptl erl_xcomp_linux_usable_sigusrx erl_xcomp_linux_usable_sigaltstack erl_xcomp_poll erl_xcomp_kqueue erl_xcomp_putenv_copy erl_xcomp_reliable_fpe erl_xcomp_getaddrinfo erl_xcomp_gethrvtime_procfs_ioctl erl_xcomp_clock_gettime_cpu_time erl_xcomp_after_morecore_hook erl_xcomp_dlsym_brk_wrappers" diff --git a/xcomp/erl-xcomp-vxworks_ppc32.conf b/xcomp/erl-xcomp-vxworks_ppc32.conf index ed8305ea93..bea4b3e374 100644 --- a/xcomp/erl-xcomp-vxworks_ppc32.conf +++ b/xcomp/erl-xcomp-vxworks_ppc32.conf @@ -187,6 +187,15 @@ AR="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc" # value is used, `configure' will try to figure this out automatically. erl_xcomp_bigendian=yes +# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf index f645ddbd96..de9118ae30 100644 --- a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf +++ b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf @@ -187,6 +187,15 @@ erl_xcomp_after_morecore_hook=yes # value is used, `configure' will try to figure this out automatically. #erl_xcomp_bigendian= +# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. diff --git a/xcomp/erl-xcomp.conf.template b/xcomp/erl-xcomp.conf.template index eb331ffe92..c215f0fb13 100644 --- a/xcomp/erl-xcomp.conf.template +++ b/xcomp/erl-xcomp.conf.template @@ -187,6 +187,15 @@ # value is used, `configure' will try to figure this out automatically. #erl_xcomp_bigendian= +# * `erl_xcomp_double_middle` - `yes|no`. No default. If `yes`, the +# target system must have doubles in "middle-endian" format. If +# `no`, it has "regular" endianness. This can often be automatically +# detected, but not always. If not automatically detected, +# `configure` will fail unless this variable is set. Since no +# default value is used, `configure` will try to figure this out +# automatically. +#erl_xcomp_double_middle_endian + # * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes', # the target system must have a working `clock_gettime()' implementation # that can be used for retrieving process CPU time. |