tce-load -i compiletc gdbm-dev openssl-dev readline-dev tk-dev gmp-dev

wget http://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.7.tar.xz

cd ruby-2.5.7

CC="gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe" CXX="g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --disable-static --localstatedir=/var --enable-shared --disable-install-doc --disable-install-rdoc --disable-install-capi

find . -name Makefile -type f -exec sed -i 's/-O3//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-ggdb3//g' {} \;
find . -name config.status -type f -exec sed -i 's/-O3//g' {} \;
find . -name config.status -type f -exec sed -i 's/-ggdb3//g' {} \;

make [11m 34.61s]
sudo make install

Configuration summary for ruby version 2.5.7

   * Installation prefix: /usr/local
   * exec prefix:         ${prefix}
   * arch:                aarch64-linux
   * site arch:           ${arch}
   * RUBY_BASE_NAME:      ruby
   * enable shared:       yes
   * ruby lib prefix:     ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path:         ${rubylibprefix}/vendor_ruby
   * target OS:           linux
   * compiler:            gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe
   * with pthread:        yes
   * enable shared libs:  yes
   * dynamic library ext: so
   * CFLAGS:              ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS:             -L. -fstack-protector -rdynamic \
                          -Wl,-export-dynamic
   * optflags:            -O3
   * debugflags:          -ggdb3
   * warnflags:           -Wall -Wextra -Wno-unused-parameter \
                          -Wno-parentheses -Wno-long-long \
                          -Wno-missing-field-initializers \
                          -Wno-tautological-compare \
                          -Wno-parentheses-equality \
                          -Wno-constant-logical-operand -Wno-self-assign \
                          -Wunused-variable -Wimplicit-int -Wpointer-arith \
                          -Wwrite-strings -Wdeclaration-after-statement \
                          -Wimplicit-function-declaration \
                          -Wdeprecated-declarations \
                          -Wmisleading-indentation \
                          -Wno-packed-bitfield-compat \
                          -Wsuggest-attribute=noreturn \
                          -Wsuggest-attribute=format \
                          -Wimplicit-fallthrough=0 -Wduplicated-cond \
                          -Wrestrict
   * strip command:       strip -S -x
   * install doc:         no
   * man page type:       man
