Why does my erlang build fail with a core dump on Solaris Sparc? -
(i have answer already; i'm going answer own question can share i've learned , save else trouble in future)
when attempt build erlang on solaris 10 sparcv9, build fails partway through:
cd lib && \ erl_top=/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221 path=/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/bootstrap/bin:${path} \ make opt secondary_bootstrap=true make[1]: entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib' make[2]: entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe' === entering application hipe make[3]: entering directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe/misc' erlc -w +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_consttab.erl make[3]: *** [../ebin/hipe_consttab.beam] bus error (core dumped) make[3]: leaving directory `/var/tmp/pkgbuild-0/erlang/sparcv9/erlang-otp-73b4221/lib/hipe/misc' why , can complete erlang build?
the reason build fails due broken build environment.
in specific case sun gcc build being used. particular version of gcc compiled use mixture of the gnu assembler , sun linker.
the sparc platform highly sensitive alignment of code , fault (for example, bus error) if unaligned code executed.
the gnu assembler used stock gcc build on sparc solaris 10 doesn't work hard automatically align functions generated compiler, leading unaligned code.
the solution build own gcc , make sure use system assembler , linker; can achieve using following options gcc's configure script:
--with-as=/usr/ccs/bin/as \ --without-gnu-as \ --without-gnu-ld \ --with-ld=/usr/ccs/bin/ld \ the resultant gcc build generated aligned code , allow build erlang successfully.
Comments
Post a Comment