[erlang-questions] remsh failing silently

Mikael Pettersson <>
Wed Jan 2 14:07:14 CET 2019


On Wed, Jan 2, 2019 at 11:44 AM Ben Hood <> wrote:
>
> On Sun, Dec 30, 2018 at 2:34 PM Mikael Pettersson <> wrote:
> > For the record, I just built OTP 17.5.6.10 natively on
> > powerpc64-unknown-linux-gnu, and ^G works just fine there in the
> > Erlang shell.
> >
> > I'd have to suspect your cross compilation setup.  Could be some
> > ./configure test not doing the right thing in the cross compile case.
>
> That sounds quite plausible.
>
> This is the way that I configured the cross compile for ppc (I'm
> trying to link openssl and ncurses statically, so that these versions
> are independent of the package manager on the target machine).
>
> There seems to be configure options to link openssl statically, but3. If you want ncurses and openssl statically linked I'd build them with --disable-shared in the first place, alternatively (temporarily) remove their .so files from the cross compiler's libs.
> fewer options for ncurses - does this look vaguely sane?
>
> CONFIGURE_ARGS := --host=$(TARGET_ARCH) \
> --disable-hipe \
> --enable-smp-support \
> --enable-threads \
> --enable-kernel-poll \
> --with-termcap \
> --with-ssl=$(OPENSSL_DIST_PATH) \
> --disable-dynamic-ssl-lib \
> --build=$(BUILD_ARCH) \
> --enable-native-libs \
> --enable-static-nifs
> LDFLAGS := "-L$(NCURSES_DIST_PATH)/lib -L$(OPENSSL_DIST_PATH)/lib
> -L/opt/at12.0/$(TARGET_ARCH)/lib64"
> LIBS := $(OPENSSL_STATIC_LIB)3. If you want ncurses and openssl statically linked I'd build them with --disable-shared in the first place, alternatively (temporarily) remove their .so files from the cross compiler's libs.
> CFLAGS := "-D_GNU_SOURCE -I$(NCURSES_DIST_PATH)/include
> -I$(OPENSSL_DIST_PATH)/include -mcpu=$(TARGET_CPU)
> -mtune=$(TARGET_CPU) -O3 -pthread"
>
> $(OTP_SRC_DIR)/make/output.mk: $(SKIP_LIBS) $(NCURSES_STATIC_LIB)
> $(OPENSSL_STATIC_LIB) $(OTP_SRC_DIR)/$(BOOTSTRAP_BEAM)
> cd $(OTP_SRC_DIR) && erl_xcomp_sysroot=$(ERL_TOP) \
> CC=$(CC) \
> CXX=$(CXX) \
> LD=$(LD) \
> LDFLAGS=$(LDFLAGS) \
> CFLAGS=$(CFLAGS) \
> LIBS=$(LIBS) \
> ./configure $(CONFIGURE_ARGS) --prefix=$(OTP_INSTALL_DIR)

This doesn't say how ncurses was build, but I note a few things:
1. --enable-native-libs is meaningless with --disable-hipe
2. All those overrides of LDFLAGS, LIBS, CFLAGS etc look unnecessary.
If I was doing this, I'd build a self-contained cross-compiler with
binutils, gcc, glibc, ncurses, and openssl in $CROSS (e.g.
/opt/cross-ppc64-linux/), put $CROSS/bin first in PATH, then build OTP
following the procedure in HOWTO/INSTALL-CROSS.md section "Building
With configure/make Directly".
3. You might want to build ncurses and openssl with --disable-shared
to ensure that no dynamic linking is attempted.
4. If you `ldd beam.smp` on the target, does it list any unexpected
shared libraries?  And even if say libc is dynamically linked, is it
the same version as used in the cross compilation environment?


More information about the erlang-questions mailing list