[erlang-bugs] R19-rc2 compilation error on FreeBSD 10.3-p4 in unix_efile
Mikael Pettersson
mikpelinux@REDACTED
Sun Jun 5 11:05:39 CEST 2016
Garret Smith writes:
> Going back, this error was present in rc1 as well.
> I'm on FreeBSD 10.3-p4, trying to compile with both GCC 4.8 and clang
> 3.4. I get the same error with both compilers
>
> compile command (clang)
>
> ./otp_build setup -a --prefix=/home/gsmith
> --with-wx-config=/usr/local/bin/wxgtk2u-3.0-config
>
> compile command (gcc)
>
> env CC=gcc48 CXX=g++48 ./otp_build setup -a --prefix=/home/gsmith
> --with-wx-config=/usr/local/bin/wxgtk2u-3.0-config
>
> error message:
>
> In file included from beam/sys.h:105:0,
> from drivers/unix/unix_efile.c:32:
> sys/unix/erl_unix_sys.h: In function 'erts_check_fpe_thorough':
> sys/unix/erl_unix_sys.h:424:5: error: implicit declaration of function
> 'finite' [-Werror=implicit-function-declaration]
> return erts_check_fpe(fp_exception, f) || !isfinite(f);
> ^
There is a configuration-time check for having isfinite() or finite(),
and I'd be very surprised of a recent FreeBSD didn't have at least one
of them.
However, the check is a linkage check, so it's possible that finite()
isn't declared, which would trigger the above warning.
The code in erts/emulator/sys/unix/erl_unix_sys.h to choose which one to
use (finite or isfinite) is a bit convoluted, and it's possible it makes
the wrong choice sometimes.
> In file included from beam/erl_threads.h:268:0,
> from beam/erl_smp.h:28,
> from beam/sys.h:467,
> from drivers/unix/unix_efile.c:32:
> beam/erl_term.h: At top level:
> beam/erl_term.h:57:8: error: #error Hipe on 64-bit needs a real mmap
> as it does not support the literal tag
> # error Hipe on 64-bit needs a real mmap as it does not support
> the literal tag
> ^
This means that ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION isn't set in your
environment. Can you check if FreeBSD's <sys/mman.h> has MAP_FIXED and
MAP_NORESERVE, perhaps with slightly different names?
As far as I can tell from git log, this change is due to some changes in
erts and not directly caused by HiPE (as the messages would imply).
> cc1: some warnings being treated as errors
> x86_64-unknown-freebsd10.3/Makefile:697: recipe for target
> 'obj/x86_64-unknown-freebsd10.3/opt/smp/unix_efile.o' failed
>
> I'll be happy to assist in testing out patches if necessary.
You may be able to silence both errors by configuring with --disable-hipe,
but the real problem isn't in HiPE but in the areas I described above.
More information about the erlang-bugs
mailing list