Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
goatgoose committed Jul 31, 2023
1 parent 0548d07 commit 74adf8d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/BUILD.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# s2n-tls Build Instructions
# Building s2n-tls

## Obtaining s2n-tls

Expand All @@ -8,9 +8,9 @@ git clone https://github.com/aws/s2n-tls.git
cd s2n-tls
```

## Building s2n-tls
## Building

The following commands can be used to build s2n-tls with minimal configuration options:
s2n-tls can be built as follows:

<details open>
<summary>Ubuntu</summary>
Expand Down Expand Up @@ -80,7 +80,7 @@ s2n-tls can be configured with the following CMake options. Each option can be s
- [**`CMAKE_BUILD_TYPE`**](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html): Sets the build type. Some of the possible build types are as follows:
- `Release`: Produce an optimized s2n-tls library artifact with no debug info. This option should be used when building s2n-tls for use in production.
- `Debug`: Produce an unoptimized library artifact with debug info. This option can be used when developing for or with s2n-tls. The debug symbols produced with this build can be used with GDB and other utilities to help with debugging.
- [**`CMAKE_INSTALL_PREFIX`**](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html): Specifies where the s2n-tls library and binary artifacts are placed when installing s2n-tls via `ninja -C build install`.
- [**`CMAKE_INSTALL_PREFIX`**](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html): Specifies where the s2n-tls library and binary artifacts are placed when installing s2n-tls.
- [**`CMAKE_PREFIX_PATH`**](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html): Specifies install locations used by CMake to search for library dependencies. This option can be used to link s2n-tls to a specific libcrypto. See the [Using a specific libcrypto](#using-a-specific-libcrypto) section for more information on building with different libcryptos.
- [**`BUILD_SHARED_LIBS`**](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html): Specifies whether a static or shared s2n-tls library artifact will be produced during the build. Defaults to `OFF`, building a static library. If set to `ON`, a shared library will be produced instead.

Expand All @@ -90,7 +90,7 @@ See the [s2n-tls usage guide](USAGE-GUIDE.md#consuming-s2n-tls-via-cmake) for in

## Building with a specific libcrypto

s2n-tls has a dependency on a libcrypto library. The libcrypto contains cryptographic operations used to negotiate TLS and encrypt/decrypt data. s2n-tls must be linked to a libcrypto library when building. The following libcrypto libraries are currently supported:
s2n-tls has a dependency on a libcrypto library. A supported libcrypto must be linked to s2n-tls when building. The following libcrypto libraries are currently supported:
- [AWS-LC](https://github.com/aws/aws-lc)
- [OpenSSL](https://github.com/openssl/openssl) (versions 1.0.2 - 3.0)
- ChaChaPoly is not supported before Openssl-1.1.1.
Expand Down Expand Up @@ -122,7 +122,7 @@ cd aws-lc

# build and install aws-lc
cmake -GNinja -B build -DCMAKE_INSTALL_PREFIX=./aws-lc-install
ninja -C build
ninja -C build -j $(nproc)
ninja -C build run_tests
ninja -C build install
```
Expand All @@ -141,7 +141,7 @@ cd aws-lc

# build and install aws-lc
cmake -GNinja -B build -DCMAKE_INSTALL_PREFIX=./aws-lc-install
ninja -C build
ninja -C build -j $(sysctl -n hw.ncpu)
ninja -C build run_tests
ninja -C build install
```
Expand All @@ -167,7 +167,7 @@ ninja -C build install
```
</details>

The aws-lc install location specified by `CMAKE_INSTALL_PREFIX` should be set when building s2n-tls with the `CMAKE_PREFIX_PATH`. This will ensure that s2n-tls finds aws-lc when building.
The aws-lc install location specified by `CMAKE_INSTALL_PREFIX` should be set when building s2n-tls with the `CMAKE_PREFIX_PATH` option. This will ensure that s2n-tls finds aws-lc when building.

For more information on building AWS-LC, see the [Building AWS-LC documentation](https://github.com/aws/aws-lc/blob/main/BUILDING.md)

Expand Down Expand Up @@ -232,7 +232,7 @@ s2n-tls also reads this for unit tests. Try setting this environment variable be

## Cross Compiling for 32 Bit Platforms

There is an example toolchain for 32 bit cross-compiling in [`cmake/toolchains/32-bit.toolchain`](https://github.com/aws/s2n-tls/blob/main/cmake/toolchains/32-bit.toolchain).
There is an example toolchain for 32 bit cross-compiling in [`cmake/toolchains/32-bit.toolchain`](../cmake/toolchains/32-bit.toolchain).

First, you will need access to a 32 bit version of libcrypto. Many linux distributions are [multi-arch](https://help.ubuntu.com/community/MultiArch) compatible which allows you to download 32 bit packages on a 64 bit platform. This can be done with the following:

Expand Down

0 comments on commit 74adf8d

Please sign in to comment.