aboutsummaryrefslogtreecommitdiffstats
path: root/HOWTO
diff options
context:
space:
mode:
Diffstat (limited to 'HOWTO')
-rw-r--r--HOWTO/BOOTSTRAP.md3
-rw-r--r--HOWTO/DTRACE.md345
-rw-r--r--HOWTO/INSTALL-CROSS.md24
-rw-r--r--HOWTO/INSTALL-RASPBERRYPI3.md328
-rw-r--r--HOWTO/INSTALL-WIN32.md30
-rw-r--r--HOWTO/INSTALL.md185
-rw-r--r--HOWTO/TESTING.md2
7 files changed, 367 insertions, 550 deletions
diff --git a/HOWTO/BOOTSTRAP.md b/HOWTO/BOOTSTRAP.md
index 59e31165cf..6f5f417d51 100644
--- a/HOWTO/BOOTSTRAP.md
+++ b/HOWTO/BOOTSTRAP.md
@@ -14,8 +14,7 @@ Primary bootstrap
The two types of version controlled code are fundamentally
different. The primary bootstrap is code compiled from source files in
-the lib/{kernel,stdlib,compiler} (and header files from
-lib/orber/include. They are checked in in the version control system
+the lib/{kernel,stdlib,compiler} (They are checked in in the version control system
to make it possible to build directly from the code base tree without
the need for an earlier version of the compiler. When a new version of
OTP is released, these files are updated manually (or rather, by using
diff --git a/HOWTO/DTRACE.md b/HOWTO/DTRACE.md
index 90f4addefd..28712dab88 100644
--- a/HOWTO/DTRACE.md
+++ b/HOWTO/DTRACE.md
@@ -44,348 +44,13 @@ Status
As of R15B01, the dynamic trace code is included in the OTP source distribution,
although it's considered experimental. The main development of the dtrace code
still happens outside of Ericsson, but there is no need to fetch a patched
-version of the OTP source to get the basic funtionality.
+version of the OTP source to get the basic functionality.
-Implementation summary
-----------------------
+DTrace probe specifications
+---------------------------
-So far, most effort has been focused on the `efile_drv.c` code,
-which implements most file I/O on behalf of the Erlang virtual
-machine. This driver also presents a big challenge: its use of an I/O
-worker pool (enabled by using the `erl +A 8` flag, for example) makes
-it much more difficult to trace I/O activity because each of the
-following may be executed in a different Pthread:
-
-* I/O initiation (Erlang code)
-* I/O proxy process handling, e.g. read/write when file is not opened
- in `raw` mode, operations executed by the code & file server processes.
- (Erlang code)
-* `efile_drv` command setup (C code)
-* `efile_drv` command execution (C code)
-* `efile_drv` status return (C code)
-
-Example output from `lib/runtime_tools/examples/efile_drv.d` while executing
-`file:rename("old-name", "new-name")`:
-
- efile_drv enter tag={3,84} user tag some-user-tag | RENAME (12) | args: old-name new-name ,\
- 0 0 (port #Port<0.59>)
- async I/O worker tag={3,83} | RENAME (12) | efile_drv-int_entry
- async I/O worker tag={3,83} | RENAME (12) | efile_drv-int_return
- efile_drv return tag={3,83} user tag | RENAME (12) | errno 2
-
-... where the following key can help decipher the output:
-
-* `{3,83}` is the Erlang scheduler thread number (3) and operation
- counter number (83) assigned to this I/O operation. Together,
- these two numbers form a unique ID for the I/O operation.
-* `12` is the command number for the rename operation. See the
- definition for `FILE_RENAME` in the source code file `efile_drv.c`
- or the `BEGIN` section of the D script `lib/runtime_tools/examples/efile_drv.d`.
-* `old-name` and `new-name` are the two string arguments for the
- source and destination of the `rename(2)` system call.
- The two integer arguments are unused; the simple formatting code
- prints the arguments anyway, 0 and 0.
-* The worker pool code was called on behalf of Erlang port `#Port<0.59>`.
-* The system call failed with a POSIX errno value of 2: `ENOENT`,
- because the path `old-name` does not exist.
-* The `efile_drv-int_entry` and `efile_drv_int_return` probes are
- provided in case the user is
- interested in measuring only the latency of code executed by
- `efile_drv` asynchronous functions by I/O worker pool threads
- and the OS system call that they encapsulate.
-
-So, where does the `some-user-tag` string come from?
-
-At the moment, the user tag comes from code like the following:
-
- dyntrace:put_tag("some-user-tag"),
- file:rename("old-name", "new-name"),
-
-This method of tagging I/O at the Erlang level is subject to change.
-
-Example DTrace probe specification
-----------------------------------
-
- /**
- * Fired when a message is sent from one local process to another.
- *
- * NOTE: The 'size' parameter is in machine-dependent words and
- * that the actual size of any binary terms in the message
- * are not included.
- *
- * @param sender the PID (string form) of the sender
- * @param receiver the PID (string form) of the receiver
- * @param size the size of the message being delivered (words)
- * @param token_label for the sender's sequential trace token
- * @param token_previous count for the sender's sequential trace token
- * @param token_current count for the sender's sequential trace token
- */
- probe message__send(char *sender, char *receiver, uint32_t size,
- int token_label, int token_previous, int token_current);
-
- /**
- * Fired when a message is sent from a local process to a remote process.
- *
- * NOTE: The 'size' parameter is in machine-dependent words and
- * that the actual size of any binary terms in the message
- * are not included.
- *
- * @param sender the PID (string form) of the sender
- * @param node_name the Erlang node name (string form) of the receiver
- * @param receiver the PID/name (string form) of the receiver
- * @param size the size of the message being delivered (words)
- * @param token_label for the sender's sequential trace token
- * @param token_previous count for the sender's sequential trace token
- * @param token_current count for the sender's sequential trace token
- */
- probe message__send__remote(char *sender, char *node_name, char *receiver,
- uint32_t size,
- int token_label, int token_previous, int token_current);
-
- /**
- * Fired when a message is queued to a local process. This probe
- * will not fire if the sender's pid == receiver's pid.
- *
- * NOTE: The 'size' parameter is in machine-dependent words and
- * that the actual size of any binary terms in the message
- * are not included.
- *
- * @param receiver the PID (string form) of the receiver
- * @param size the size of the message being delivered (words)
- * @param queue_len length of the queue of the receiving process
- * @param token_label for the sender's sequential trace token
- * @param token_previous count for the sender's sequential trace token
- * @param token_current count for the sender's sequential trace token
- */
- probe message__queued(char *receiver, uint32_t size, uint32_t queue_len,
- int token_label, int token_previous, int token_current);
-
- /**
- * Fired when a message is 'receive'd by a local process and removed
- * from its mailbox.
- *
- * NOTE: The 'size' parameter is in machine-dependent words and
- * that the actual size of any binary terms in the message
- * are not included.
- *
- * @param receiver the PID (string form) of the receiver
- * @param size the size of the message being delivered (words)
- * @param queue_len length of the queue of the receiving process
- * @param token_label for the sender's sequential trace token
- * @param token_previous count for the sender's sequential trace token
- * @param token_current count for the sender's sequential trace token
- */
- probe message__receive(char *receiver, uint32_t size, uint32_t queue_len,
- int token_label, int token_previous, int token_current);
-
- /* ... */
-
- /* Async driver pool */
-
- /**
- * Show the post-add length of the async driver thread pool member's queue.
- *
- * NOTE: The port name is not available: additional lock(s) must
- * be acquired in order to get the port name safely in an SMP
- * environment. The same is true for the aio__pool_get probe.
- *
- * @param port the Port (string form)
- * @param new queue length
- */
- probe aio_pool__add(char *, int);
-
- /**
- * Show the post-get length of the async driver thread pool member's queue.
- *
- * @param port the Port (string form)
- * @param new queue length
- */
- probe aio_pool__get(char *, int);
-
- /* Probes for efile_drv.c */
-
- /**
- * Entry into the efile_drv.c file I/O driver
- *
- * For a list of command numbers used by this driver, see the section
- * "Guide to probe arguments" in ../../../README.md. That section
- * also contains explanation of the various integer and string
- * arguments that may be present when any particular probe fires.
- *
- * TODO: Adding the port string, args[10], is a pain. Making that
- * port string available to all the other efile_drv.c probes
- * will be more pain. Is the pain worth it? If yes, then
- * add them everywhere else and grit our teeth. If no, then
- * rip it out.
- *
- * @param thread-id number of the scheduler Pthread arg0
- * @param tag number: {thread-id, tag} uniquely names a driver operation
- * @param user-tag string arg2
- * @param command number arg3
- * @param string argument 1 arg4
- * @param string argument 2 arg5
- * @param integer argument 1 arg6
- * @param integer argument 2 arg7
- * @param integer argument 3 arg8
- * @param integer argument 4 arg9
- * @param port the port ID of the busy port args[10]
- */
- probe efile_drv__entry(int, int, char *, int, char *, char *,
- int64_t, int64_t, int64_t, int64_t, char *);
-
- /**
- * Entry into the driver's internal work function. Computation here
- * is performed by a async worker pool Pthread.
- *
- * @param thread-id number
- * @param tag number
- * @param command number
- */
- probe efile_drv__int_entry(int, int, int);
-
- /**
- * Return from the driver's internal work function.
- *
- * @param thread-id number
- * @param tag number
- * @param command number
- */
- probe efile_drv__int_return(int, int, int);
-
- /**
- * Return from the efile_drv.c file I/O driver
- *
- * @param thread-id number arg0
- * @param tag number arg1
- * @param user-tag string arg2
- * @param command number arg3
- * @param Success? 1 is success, 0 is failure arg4
- * @param If failure, the errno of the error. arg5
- */
- probe efile_drv__return(int, int, char *, int, int, int);
-
-Guide to efile_drv.c probe arguments
-------------------------------------
-
- /* Driver op code: used by efile_drv-entry arg3 */
- /* used by efile_drv-int_entry arg3 */
- /* used by efile_drv-int_return arg3 */
- /* used by efile_drv-return arg3 */
-
- #define FILE_OPEN 1 (probe arg3)
- probe arg6 = C driver dt_i1 = flags;
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_READ 2 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = size;
-
- #define FILE_LSEEK 3 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = offset;
- probe arg8 = C driver dt_i3 = origin;
-
- #define FILE_WRITE 4 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = size;
-
- #define FILE_FSTAT 5 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
-
- #define FILE_PWD 6 (probe arg3)
- none
-
- #define FILE_READDIR 7 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_CHDIR 8 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_FSYNC 9 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
-
- #define FILE_MKDIR 10 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_DELETE 11 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_RENAME 12 (probe arg3)
- probe arg4 = C driver dt_s1 = old_name;
- probe arg5 = C driver dt_s2 = new_name;
-
- #define FILE_RMDIR 13 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_TRUNCATE 14 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
-
- #define FILE_READ_FILE 15 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_WRITE_INFO 16 (probe arg3)
- probe arg6 = C driver dt_i1 = mode;
- probe arg7 = C driver dt_i2 = uid;
- probe arg8 = C driver dt_i3 = gid;
-
- #define FILE_LSTAT 19 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_READLINK 20 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_LINK 21 (probe arg3)
- probe arg4 = C driver dt_s1 = existing_path;
- probe arg5 = C driver dt_s2 = new_path;
-
- #define FILE_SYMLINK 22 (probe arg3)
- probe arg4 = C driver dt_s1 = existing_path;
- probe arg5 = C driver dt_s2 = new_path;
-
- #define FILE_CLOSE 23 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
-
- #define FILE_PWRITEV 24 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = size;
-
- #define FILE_PREADV 25 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = size;
-
- #define FILE_SETOPT 26 (probe arg3)
- probe arg6 = C driver dt_i1 = opt_name;
- probe arg7 = C driver dt_i2 = opt_specific_value;
-
- #define FILE_IPREAD 27 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = offsets[0];
- probe arg9 = C driver dt_i4 = size;
-
- #define FILE_ALTNAME 28 (probe arg3)
- probe arg4 = C driver dt_s1 = path;
-
- #define FILE_READ_LINE 29 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = flags;
- probe arg8 = C driver dt_i3 = read_offset;
- probe arg9 = C driver dt_i4 = read_ahead;
-
- #define FILE_FDATASYNC 30 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
-
- #define FILE_FADVISE 31 (probe arg3)
- probe arg6 = C driver dt_i1 = fd;
- probe arg7 = C driver dt_i2 = offset;
- probe arg8 = C driver dt_i3 = length;
- probe arg9 = C driver dt_i4 = advise_type;
+Probe specifications can be found in `erts/emulator/beam/erlang_dtrace.d`, and
+a few example scripts can be found under `lib/runtime_tools/examples/`.
[1]: http://www.erlang.org/euc/08/
[$ERL_TOP/HOWTO/SYSTEMTAP.md]: SYSTEMTAP.md
diff --git a/HOWTO/INSTALL-CROSS.md b/HOWTO/INSTALL-CROSS.md
index 29614966b8..0fb58cd4af 100644
--- a/HOWTO/INSTALL-CROSS.md
+++ b/HOWTO/INSTALL-CROSS.md
@@ -521,27 +521,9 @@ When a variable has been set, no warning will be issued.
`posix_memalign` implementation that accepts larger than page size
alignment.
-Copyright and License
----------------------
-
-%CopyrightBegin%
-
-Copyright Ericsson AB 2009-2014. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-%CopyrightEnd%
-
+* `erl_xcomp_code_model_small` - `yes|no`. Default to `no`. If `yes`, the target
+ system must place the beam.smp executable in the lower 2 GB of memory. That is it
+ should not use position independent executable.
[$ERL_TOP/HOWTO/INSTALL.md]: INSTALL.md
diff --git a/HOWTO/INSTALL-RASPBERRYPI3.md b/HOWTO/INSTALL-RASPBERRYPI3.md
new file mode 100644
index 0000000000..b9cffbe0c5
--- /dev/null
+++ b/HOWTO/INSTALL-RASPBERRYPI3.md
@@ -0,0 +1,328 @@
+# Cross Compiling Erlang/OTP - Raspberry Pi 3
+
+
+## Introduction
+
+This document describes how to build a toolchain and cross compile Erlang/OTP
+to Raspberry Pi 3 on macOS Mojave. It is recommended to consult
+[Building and Installing Erlang/OTP](https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md) and [Cross Compiling Erlang/OTP](https://github.com/erlang/otp/blob/master/HOWTO/INSTALL-CROSS.md) before attempting to follow the instructions in this guide.
+
+The whole process takes several hours and depending on the package versions different problems may arise that require additional
+fixes not described in this document. In other words, it is not fun to build a toolchain. I assume that you have a Mac and would
+like to develop Erlang/OTP applications based on the latest OTP release (or master) that not yet released as a binary for
+Raspberry Pi 3.
+
+The first and most time consuming step is building the toolchain from scratch. Once your cross compiler is ready you cross compile
+all library dependencies and create the sysroot file system. In the last step you cross compile Erlang/OTP using the new
+toolchain and sysroot.
+
+#### Tested Configuration
+
+macOS Mojave 10.14.3<br>
+Raspberry Pi Model B Rev 1.2<br>
+Crosstools-NG 1.23.0_3
+
+```
+build = x86_64-apple-darwin18.2.0
+host = x86_64-apple-darwin18.2.0
+target = armv8-rpi3-linux-gnueabihf
+```
+
+> Note: /proc/device/tree/model contains model information of your
+> Raspberry Pi.
+
+
+#### Install Crosstool NG
+
+ (1)
+
+ $ brew install crosstool-ng
+ $ brew install grep --default-names # needed by crosstools-ng scripts
+ $ brew install md5sha1sum # needed by crosstools-ng populate script
+
+ (2)
+
+ $ chmod 744 /usr/local/Cellar/crosstool-ng/1.23.0_3/lib/crosstool-ng-1.23.0/scripts/crosstool-NG.sh
+
+#### Create case-sensitive disk images
+
+ (3)
+
+Create two case-sensitive disk images using Disk Utility:
+
+`File -> New Image -> Blank Image...`
+
+Format: `Mac OS Extended (Case-sensitive, Journaled)`
+
+```
+/Volumes/xtools-build-env 15 GB
+/Volumes/xtools 500 MB
+```
+
+> The first image holds all source and object files while building the toolchain. The second image houses the compiled
+toolchain.
+
+
+## Building the Toolchain
+
+### Environment settings
+
+ (4)
+
+ $ ulimit -n 1024
+
+### Inspect target system
+
+ (5)
+
+ $ uname -a
+ Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
+ $ ld -v
+ GNU ld (GNU Binutils for Raspbian) 2.25
+ $ ldd --version
+ ldd (Debian GLIBC 2.19-18+deb8u10) 2.19
+ Copyright (C) 2014 Free Software Foundation, Inc.
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ Written by Roland McGrath and Ulrich Drepper.
+
+> Use the versions available on your target system!
+
+> See https://wiki.osdev.org/Cross-Compiler_Successful_Builds
+
+### Configure crosstool-ng
+
+ (6)
+
+ $ cd /Volumes/xtools-build-env
+ $ ct-ng armv8-rpi3-linux-gnueabihf
+ $ ct-ng menuconfig
+
+#### Path and misc options
+
+##### crosstool-NG behavior
+
+ (7)
+
+```
+[*] Use obsolete features
+
+[*] Debug crosstool-NG
+[ ] Pause between every steps
+[*] Save intermediate steps
+[*] gzip saved states
+[*] Interactive shell on failed commands
+```
+
+> Should the build break at a particular build step, you can fix the problem and continue the build from where it broke.
+
+##### Paths
+
+ (8)
+
+* Local tarballs directory: `/Volumes/xtools-build-env/src`
+* Working directory: `/Volumes/xtools-build-env/.build`
+* Prefix directory: `/Volumes/xtools/${CT_TARGET}`
+
+##### Extracting
+
+ (9)
+
+`[*] Stop after extracting tarballs`
+
+> Stop the build process right after the tarballs have been extracted. This can be handy to fix known source code problems before the actual build process is started.
+
+#### Operating System
+
+ (10)
+
+`Linux kernel version (4.9.20)`
+
+#### Binary utilities
+
+ (11)
+
+`bintutils version (2.28)`
+
+#### C-library
+
+ (12)
+
+`glibc version (2.19 (OBSOLETE))`
+
+#### Sample `ct-ng` commands:
+
+* List all build steps
+
+```
+ $ ct-ng list-steps
+
+ Available build steps, in order:
+ - companion_tools_for_build
+ - companion_libs_for_build
+ - binutils_for_build
+ - companion_tools_for_host
+ - companion_libs_for_host
+ - binutils_for_host
+ - cc_core_pass_1
+ - kernel_headers
+ - libc_start_files
+ - cc_core_pass_2
+ - libc
+ - cc_for_build
+ - cc_for_host
+ - libc_post_cc
+ - companion_libs_for_target
+ - binutils_for_target
+ - debug
+ - test_suite
+ - finish
+```
+
+* Re-run step `companion_libs_for_host`
+
+```
+ $ ct-ng companion_libs_for_host
+```
+
+* Restart from `companion_libs_for_host`
+
+```
+ $ ct-ng companion_libs_for_host+
+```
+
+* Run until step `companion_libs_for_host`
+
+```
+ $ ct-ng +companion_libs_for_host
+```
+
+### Build
+
+ (13)
+
+ $ ct-ng build
+
+> Build process stops just after the tarballs have been extracted.
+
+#### Fix source files
+
+ (14)
+
+ $ pushd .build/src/gettext-0.19.8.1/
+ $ autoreconf
+ $ popd
+
+#### Update configuration
+
+ (15)
+
+ $ ct-ng menuconfig
+
+Uncheck option:
+
+`[ ] Stop after extracting tarballs`
+
+#### Continue build
+
+ (16)
+
+ $ ct-ng build
+
+> Restart build process from where it previously stopped.
+
+ (17)
+
+ $ export PATH=/Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin:$PATH
+
+### Test
+
+ (18)
+
+ $ cat > test.c
+ $ int main() { printf("Hello, world!\n"); return 0; }
+ <CTRL+D>
+ $ armv8-rpi3-linux-gnueabihf-gcc -o test test.c
+
+
+## Cross compiling dependencies
+
+ (19)
+
+ $ mkdir local # prefix directory
+ $ mkdir 3pps # OTP dependencies
+ $ cd 3pps
+
+#### zlib
+
+ (20)
+
+ $ wget http://zlib.net/zlib-1.2.11.tar.gz
+ $ tar xf zlib-1.2.11.tar.gz
+ $ pushd zlib-1.2.11
+ $ CHOST=armv8-rpi3-linux-gnueabihf ./configure --prefix=/Volumes/xtools-build-env/local
+ $ make
+ $ make install
+ $ popd
+
+#### openssl
+
+ (21)
+
+ $ wget http://openssl.org/source/openssl-1.1.1b.tar.gz
+ $ tar xf openssl-1.1.1b.tar.gz
+ $ pushd openssl-1.1.1b
+ $ ./Configure linux-generic32 --prefix=/Volumes/xtools-build-env/local \
+ --openssldir=/Volumes/xtools-build-env/local/openssl \
+ --cross-compile-prefix=armv8-rpi3-linux-gnueabihf-
+ $ make
+ $ make install
+ $ popd
+
+> A compatible openssl library shall be available on the target system!
+
+#### ncurses
+
+ (22)
+
+ $ wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
+ $ tar xf ncurses-5.9.tar.gz
+ $ pushd ncurses-5.9
+ $ wget https://gist.githubusercontent.com/peterdmv/1068b2f9e1fec6e1330ad62ed87461ad/\
+ raw/065597b63654ed6a9f28d02fdfbca844413847ad/ncurses-5.9.patch
+ $ patch -p0 < ncurses-5.9.patch
+ $ ./configure --build=x86_64-apple-darwin18.2.0 --host=armv8-rpi3-linux-gnueabihf \
+ --without-ada --without-cxx --without-cxx-binding --without-manpages \
+ --without-progs --without-tests --prefix=/usr --libdir=/lib \
+ --with-build-cc="gcc -D_GNU_SOURCE" --with-shared
+ $ make
+ $ make DESTDIR=/Volumes/xtools-build-env/local install
+ $ popd
+
+
+## Populating sysroot
+
+ (23)
+
+ $ chmod 755 /Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin
+ $ chmod 755 /Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin/armv8-rpi3-linux-gnueabihf-populate
+ $ gsed -i 's/"sed"/"gsed"/g' \
+ /Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin/armv8-rpi3-linux-gnueabihf-populate
+ $ chmod 555 /Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin
+ $ chmod 555 /Volumes/xtools/armv8-rpi3-linux-gnueabihf/bin/armv8-rpi3-linux-gnueabihf-populate
+
+ (24)
+
+ $ armv8-rpi3-linux-gnueabihf-populate -s /Volumes/xtools-build-env/local \
+ -d /Volumes/xtools-build-env/sysroot
+ $ export RPI_SYSROOT=/Volumes/xtools-build-env/sysroot
+
+
+## Cross compiling Erlang/OTP
+
+ (25)
+
+ $ LC_CTYPE=C && LANG=C && ./otp_build autoconf
+ $ ./otp_build configure --xcomp-conf=./xcomp/erl-xcomp-armv8-rpi3-linux-gnueabihf.conf
+ $ ./otp_build boot -a
+ $ ./otp_build release -a /Volumes/xtools-build-env/otp_22.0
diff --git a/HOWTO/INSTALL-WIN32.md b/HOWTO/INSTALL-WIN32.md
index c74107d749..98c608060d 100644
--- a/HOWTO/INSTALL-WIN32.md
+++ b/HOWTO/INSTALL-WIN32.md
@@ -612,7 +612,7 @@ tools:
We would recommend using 1.0.2d.
-* Building with wxWidgets. Download wxWidgets-3.0.2 or higher.
+* Building with wxWidgets. Download wxWidgets-3.0.3 or higher.
Install or unpack it to the pgm folder:
Cygwin:
@@ -622,19 +622,19 @@ tools:
MSYS2:
`DRIVE:/PATH/msys<32/64>/opt/local/pgm`
- If the `wxUSE_POSTSCRIPT` isn't enabled in `<path\to\pgm>\wxMSW-3.0.2\include\wx\msw\setup.h`,
+ If the `wxUSE_POSTSCRIPT` isn't enabled in `<path\to\pgm>\wxMSW-3.0.3\include\wx\msw\setup.h`,
enable it.
build: From a command prompt with the VC tools available (See the
instructions for OpenSSL build above for help on starting the
proper command prompt in RELEASE mode):
- C:\...\> cd <path\to\pgm>\wxMSW-3.0.2\build\msw
+ C:\...\> cd <path\to\pgm>\wxMSW-3.0.3\build\msw
C:\...\> nmake BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f makefile.vc
Or - if building a 64bit version:
- C:\...\> cd <path\to\pgm>\wxMSW-3.0.2\build\msw
+ C:\...\> cd <path\to\pgm>\wxMSW-3.0.3\build\msw
C:\...\> nmake TARGET_CPU=amd64 BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f makefile.vc
* Get the Erlang source distribution (from <http://www.erlang.org/download.html>).
@@ -884,28 +884,6 @@ to a common MSYS command prompt for building. Also all test suites
cannot be built as MsysGIT/MSYS does not handle symbolic links.
-Copyright and License
----------------------
-
-%CopyrightBegin%
-
-Copyright Ericsson AB 2003-2015. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-%CopyrightEnd%
-
-
[1]: http://www.erlang.org/static/doc/mailinglist.html
[2]: http://bugs.erlang.org
[3]: https://github.com/erlang/otp
diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md
index 447a23128f..674454bc8e 100644
--- a/HOWTO/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -18,9 +18,6 @@ Required Utilities
These are the tools you need in order to unpack and build Erlang/OTP.
-> *WARNING*: Please have a look at the [Known platform issues][] chapter
-> before you start.
-
### Unpacking ###
* GNU unzip, or a modern uncompress.
@@ -75,13 +72,11 @@ also find the utilities needed for building the documentation.
as the binary command program `openssl`. At least version 0.9.8 of OpenSSL is required.
Read more and download from <http://www.openssl.org>.
* Oracle Java SE JDK -- The Java Development Kit (Standard Edition).
- Required for building the application `jinterface` and parts of `ic` and `orber`.
+ Required for building the application `jinterface`.
At least version 1.6.0 of the JDK is required.
Download from <http://www.oracle.com/technetwork/java/javase/downloads>.
We have also tested with IBM's JDK 1.6.0.
-* X Windows -- Development headers and libraries are needed
- to build the Erlang/OTP application `gs` on Unix/Linux.
* `flex` -- Headers and libraries are needed to build the flex
scanner for the `megaco` application on Unix/Linux.
* wxWidgets -- Toolkit for GUI applications.
@@ -343,10 +338,8 @@ use the `--prefix` argument like this: `./configure --prefix=<Dir>`.
Some of the available `configure` options are:
* `--prefix=PATH` - Specify installation prefix.
-
-* `--{enable,disable}-threads` - Thread support. This is enabled by default if possible.
-* `--{enable,disable}-smp-support` - SMP support (enabled by default if
- a usable POSIX thread library or native Windows threads is found)
+* `--disable-parallel-configure` - Disable parallel execution of
+ `configure` scripts (parallel execution is enabled by default)
* `--{enable,disable}-kernel-poll` - Kernel poll support (enabled by
default if possible)
* `--{enable,disable}-hipe` - HiPE support (enabled by default on supported
@@ -424,15 +417,6 @@ Some of the available `configure` options are:
and scalability compared to the default clock sources chosen.
* `--disable-saved-compile-time` - Disable saving of compile date and time
in the emulator binary.
-* `--enable-dirty-schedulers` - Enable the **experimental** dirty schedulers
- functionality. Note that the dirty schedulers functionality is experimental,
- and **not supported**. This functionality **will** be subject to backward
- incompatible changes. Note that you should **not** enable the dirty scheduler
- functionality on production systems. It is only provided for testing.
- This switch also imply `--enable-new-purge-strategy` (see below).
-* `--enable-new-purge-strategy` - Enable the purge strategy that will be
- introduced in ERTS version 9.0 (OTP 20). Note that this switch will be
- removed in OTP 20.
If you or your system has special requirements please read the `Makefile` for
additional configuration information.
@@ -522,12 +506,26 @@ If you have Xcode 4.3, or later, you will also need to download
#### Building with wxErlang ####
If you want to build the `wx` application, you will need to get wxWidgets-3.0
-(`wxWidgets-3.0.0.tar.bz2` from <http://sourceforge.net/projects/wxwindows/files/3.0.0/>) or get it from github with bug fixes:
+(`wxWidgets-3.0.3.tar.bz2` from <https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3/wxWidgets-3.0.3.tar.bz2>) or get it from github with bug fixes:
$ git clone --branch WX_3_0_BRANCH [email protected]:wxWidgets/wxWidgets.git
-Be aware that the wxWidgets-3.0 is a new release of wxWidgets, it is not as
-mature as the old releases and the OS X port still lags behind the other ports.
+The wxWidgets-3.1 version should also work if 2.8 compatibility is enabled,
+add `--enable-compat28` to configure commands below.
+
+Configure and build wxWidgets (shared library on linux):
+
+ $ ./configure --prefix=/usr/local
+ $ make && sudo make install
+ $ export PATH=/usr/local/bin:$PATH
+
+Configure and build wxWidgets (static library on linux):
+
+ $ export CFLAGS=-fPIC
+ $ export CXXFLAGS=-fPIC
+ $ ./configure --prefix=/usr/local --disable-shared
+ $ make && sudo make install
+ $ export PATH=/usr/local/bin:$PATH
Configure and build wxWidgets (on Mavericks - 10.9):
@@ -577,16 +575,12 @@ as before, but the build process will take a much longer time.
After completing all the normal building steps described above a debug
enabled runtime system can be built. To do this you have to change
-directory to `$ERL_TOP/erts/emulator`.
+directory to `$ERL_TOP/erts/emulator` and execute:
-In this directory execute:
+ $ (cd $ERL_TOP/erts/emulator && make debug)
- $ make debug FLAVOR=$FLAVOR
-
-where `$FLAVOR` is either `plain` or `smp`. The flavor options will
-produce a beam.debug and beam.smp.debug executable respectively. The
-files are installed along side with the normal (opt) versions `beam.smp`
-and `beam`.
+This will produce a beam.smp.debug executable. The
+file are installed along side with the normal (opt) version `beam.smp`.
To start the debug enabled runtime system execute:
@@ -600,7 +594,7 @@ using appropriate configure options.
There are other types of runtime systems that can be built as well
using the similar steps just described.
- $ make $TYPE FLAVOR=$FLAVOR
+ $ (cd $ERL_TOP/erts/emulator && make $TYPE)
where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, or `lcnt`.
These different beam types are useful for debugging and profiling
@@ -782,134 +776,6 @@ Use `hipe:help_options/0` to print out the available options.
1> hipe:help_options().
-#### Running with GS ####
-
-The `gs` application requires the GUI toolkit Tcl/Tk to run. At least
-version 8.4 is required.
-
-Known platform issues
----------------------
-
-* Suse linux 9.1 is shipped with a patched GCC version 3.3.3, having the
- rpm named `gcc-3.3.3-41`. That version has a serious optimization bug
- that makes it unusable for building the Erlang emulator. Please
- upgrade GCC to a newer version before building on Suse 9.1. Suse Linux
- Enterprise edition 9 (SLES9) has `gcc-3.3.3-43` and is not affected.
-
-* `gcc-4.3.0` has a serious optimizer bug. It produces an Erlang emulator
- that will crash immediately. The bug is supposed to be fixed in
- `gcc-4.3.1`.
-
-* FreeBSD had a bug which caused `kqueue`/`poll`/`select` to fail to detect
- that a `writev()` on a pipe has been made. This bug should have been fixed
- in FreeBSD 6.3 and FreeBSD 7.0. NetBSD and DragonFlyBSD probably have or
- have had the same bug. More information can be found at:
-
- * <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c>
- * <http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html>
-
-* `getcwd()` on Solaris 9 can cause an emulator crash. If you have
- async-threads enabled you can increase the stack size of the
- async-threads as a temporary workaround. See the `+a` command-line
- argument in the documentation of `erl(1)`. Without async-threads the
- emulator is not as vulnerable to this bug, but if you hit it without
- async-threads the only workaround available is to enable async-threads
- and increase the stack size of the async-threads. Oracle has however
- released patches that fixes the issue:
-
- > Problem Description: 6448300 large mnttab can cause stack overrun
- > during Solaris 9 getcwd
-
- More information can be found at:
- * <https://getupdates.oracle.com/readme/112874-40>
- * <https://getupdates.oracle.com/readme/114432-29>
-
-* `sed` on Solaris seem to have some problems. For example on
- Solaris 8, the BSD `sed` and XPG4 `sed` should be avoided.
- Make sure `/bin/sed` or `/usr/bin/sed` is used on the Solaris
- platform.
-
-
-Daily Build and Test
---------------------
-
-At Ericsson we have a "Daily Build and Test" that runs on:
-
-* Solaris 8, 9
- * Sparc32
- * Sparc64
-* Solaris 10
- * Sparc32
- * Sparc64
- * x86
-* SuSE Linux/GNU 9.4, 10.1
- * x86
-* SuSE Linux/GNU 10.0, 10.1, 11.0
- * x86
- * x86\_64
-* openSuSE 11.4 (Celadon)
- * x86\_64 (valgrind)
-* Fedora 7
- * PowerPC
-* Fedora 16
- * x86\_64
-* Gentoo Linux/GNU 1.12.11.1
- * x86
-* Ubuntu Linux/GNU 7.04, 10.04, 10.10, 11.04, 12.04
- * x86\_64
-* MontaVista Linux/GNU 4.0.1
- * PowerPC
-* FreeBSD 10.0
- * x86
-* OpenBSD 5.4
- * x86\_64
-* OS X 10.5.8 (Leopard), 10.7.5 (Lion), 10.9.1 (Mavericks)
- * x86
-* Windows XP SP3, 2003, Vista, 7
- * x86
-* Windows 7
- * x86\_64
-
-We also have the following "Daily Cross Builds":
-
-* SuSE Linux/GNU 10.1 x86 -> SuSE Linux/GNU 10.1 x86\_64
-* SuSE Linux/GNU 10.1 x86\_64 -> Linux/GNU TILEPro64
-
-and the following "Daily Cross Build Tests":
-
-* SuSE Linux/GNU 10.1 x86\_64
-
-
-Authors
--------
-
-Authors are mostly listed in the application's `AUTHORS` files,
-that is `$ERL_TOP/lib/*/AUTHORS` and `$ERL_TOP/erts/AUTHORS`,
-not in the individual source files.
-
-
-Copyright and License
----------------------
-
-%CopyrightBegin%
-
-Copyright Ericsson AB 1998-2015. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-%CopyrightEnd%
-
-
@@ -924,7 +790,6 @@ limitations under the License.
[man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-VSN%.tar.gz
[the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-VSN%.tar.gz
[System Principles]: ../system_principles/system_principles
- [Known platform issues]: #Known-platform-issues
[native build]: #How-to-Build-and-Install-ErlangOTP
[cross build]: INSTALL-CROSS.md
[Required Utilities]: #Required-Utilities
diff --git a/HOWTO/TESTING.md b/HOWTO/TESTING.md
index 34eaa68df8..ad59319efa 100644
--- a/HOWTO/TESTING.md
+++ b/HOWTO/TESTING.md
@@ -80,7 +80,7 @@ To configure and run the tests `ts` is used. `ts` is a wrapper module to
[common_test][] which takes care of configuration and build issues before
[common_test][] is started.
-`ts` has a lot of special options and functions which can be usefull when
+`ts` has a lot of special options and functions which can be useful when
testing Erlang/OTP. For a full listing issue `ts:help()` in the erlang shell.
### Configuring the test environment