summaryrefslogtreecommitdiff
path: root/HOWTO
diff options
context:
space:
mode:
Diffstat (limited to 'HOWTO')
-rw-r--r--HOWTO/INSTALL-ANDROID.md58
-rw-r--r--HOWTO/INSTALL.md2
-rw-r--r--HOWTO/TESTING.md47
3 files changed, 104 insertions, 3 deletions
diff --git a/HOWTO/INSTALL-ANDROID.md b/HOWTO/INSTALL-ANDROID.md
index 24e8b0d658..7d5af0b0ec 100644
--- a/HOWTO/INSTALL-ANDROID.md
+++ b/HOWTO/INSTALL-ANDROID.md
@@ -27,22 +27,76 @@ to generate the configure scripts.
$ ./otp_build autoconf
-Use the following when compiling a 64-bit version.
+Use the following commands when compiling a 64-bit version.
$ export NDK_ABI_PLAT=android21 # When targeting Android 5.0 Lollipop
+
+
+ $ # Either without OpenSSL support:
+ $
$ ./otp_build configure \
--xcomp-conf=./xcomp/erl-xcomp-arm64-android.conf \
--without-ssl
-Use the following instead when compiling a 32-bit version.
+ $ # Or with OpenSSL linked statically:
+ $
+ $ cd /path/to/OpenSSL/source/dir/built/for/android-arm64
+ $ # First follow the NOTES.ANDROID build instructions from OpenSSL
+ $
+ $ # Then to avoid the full installation of this cross-compiled build,
+ $ # manually create a 'lib' directory at the root of the OpenSSL directory
+ $ # (at the same level as 'include') and link 'libcrypto.a' inside it.
+ $
+ $ mkdir lib
+ $ ln -s ../libcrypto.a lib/libcrypto.a
+ $ cd - # Return to the Erlang/OTP directory
+ $
+ $ # This previous step is needed for the OpenSSL static linking to work as
+ $ # the --with-ssl option expects a path with both the 'lib' and 'include'
+ $ # directories. Otherwise the Erlang/OTP build will fallback to dynamic
+ $ # linking if it doesn't find 'libcrypto.a' in its expected location.
+ $ ./otp_build configure \
+ --xcomp-conf=./xcomp/erl-xcomp-arm64-android.conf \
+ --with-ssl=/path/to/OpenSSL/source/dir/built/for/android-arm64 \
+ --disable-dynamic-ssl-lib
+
+
+Use the following commands instead when compiling a 32-bit version.
$ export NDK_ABI_PLAT=androideabi16 # When targeting Android 4.1 Jelly Bean
+
+
+ $ # Either without OpenSSL support:
+ $
$ ./otp_build configure \
--xcomp-conf=./xcomp/erl-xcomp-arm-android.conf \
--without-ssl
+ $ # Or with OpenSSL linked statically:
+ $
+ $ cd /path/to/OpenSSL/source/dir/built/for/android-arm
+ $ # First follow the NOTES.ANDROID build instructions from OpenSSL
+ $
+ $ # Then to avoid the full installation of this cross-compiled build,
+ $ # manually create a 'lib' directory at the root of the OpenSSL directory
+ $ # (at the same level as 'include') and link 'libcrypto.a' inside it.
+ $
+ $ mkdir lib
+ $ ln -s ../libcrypto.a lib/libcrypto.a
+ $ cd - # Return to the Erlang/OTP directory
+ $
+ $ # This previous step is needed for the OpenSSL static linking to work as
+ $ # the --with-ssl option expects a path with both the 'lib' and 'include'
+ $ # directories. Otherwise the Erlang/OTP build will fallback to dynamic
+ $ # linking if it doesn't find 'libcrypto.a' in its expected location.
+ $ ./otp_build configure \
+ --xcomp-conf=./xcomp/erl-xcomp-arm-android.conf \
+ --with-ssl=/path/to/OpenSSL/source/dir/built/for/android-arm \
+ --disable-dynamic-ssl-lib
+
+
### Compile Erlang/OTP ###
$ make noboot [-j4]
diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md
index b3d30761e2..3bf6be8c89 100644
--- a/HOWTO/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -604,7 +604,7 @@ using the similar steps just described.
$ (cd $ERL_TOP/erts/emulator && make $TYPE)
-where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, or `lcnt`.
+where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, `asan` or `lcnt`.
These different beam types are useful for debugging and profiling
purposes.
diff --git a/HOWTO/TESTING.md b/HOWTO/TESTING.md
index 020be0309c..7a7f6982f2 100644
--- a/HOWTO/TESTING.md
+++ b/HOWTO/TESTING.md
@@ -185,6 +185,52 @@ examine the results so far for the currently executing test suite (in R14B02 and
later you want to open the `release/tests/test_server/all_runs.html` file to
get to the currently running test)
+
+Run tests with Address Sanitizer
+--------------------------------
+
+First build emulator with `asan` build target.
+See [$ERL_TOP/HOWTO/INSTALL.md][].
+
+Set environment variable `ASAN_LOG_DIR` to the directory
+where the error logs will be generated.
+
+ export ASAN_LOG_DIR=$TESTROOT/test_server/asan_logs
+ mkdir $ASAN_LOG_DIR
+
+Set environment variable `TS_RUN_EMU` to `asan`.
+
+ export TS_RUN_EMU=asan
+
+Then run the tests you want with `ts:run` as described above. Either
+inspect the log files directly or use the script at
+`$ERL_TOP/erts/emulator/asan/asan_logs_to_html` to read all log files
+in `$ASAN_LOG_DIR` and distill them into one html page
+`asan_summary.html`. Repeated reports from the same memory leak will
+for example be ignored by the script and make it easier to analyze.
+
+
+Run tests with Valgrind
+-----------------------
+
+First make sure [valgrind][] is installed, then build OTP from source
+and build the emulator with `valgrind` build target. See
+[$ERL_TOP/HOWTO/INSTALL.md][].
+
+Set environment variable `VALGRIND_LOG_DIR` to the directory
+where the valgrind error logs will be generated.
+
+ export VALGRIND_LOG_DIR=$TESTROOT/test_server/vg_logs
+ mkdir $VALGRIND_LOG_DIR
+
+Set environment variable `TS_RUN_EMU` to `valgrind`.
+
+ export TS_RUN_EMU=valgrind
+
+Then run the tests you want with `ts:run` as described above and
+inspect the log file(s) in `$VALGRIND_LOG_DIR`.
+
+
[ct_run]: http://www.erlang.org/doc/man/ct_run.html
[ct hook]: http://www.erlang.org/doc/apps/common_test/ct_hooks_chapter.html
[$ERL_TOP/HOWTO/INSTALL.md]: INSTALL.md
@@ -192,5 +238,6 @@ get to the currently running test)
[common_test]: http://www.erlang.org/doc/man/ct.html
[data_dir]: http://www.erlang.org/doc/apps/common_test/write_test_chapter.html#data_priv_dir
[configuring the tests]: #configuring-the-test-environment
+ [valgrind]: https://valgrind.org
[?TOC]: true