• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This has a new binding scheme in building OpenSSL-3.0.0 library with
2Node.js. OpenSSL-3.0.0 uses a new build system with `Perl` for various
3supported platforms. See `openssl/Configurations/README` and
4`openssl/Configurations/README-design.md` in the OpenSSL source for
5details.
6
7In order to build OpenSSL library without `Perl` in the build of Node.js
8for various supported platforms, platform dependent files (e.g. asm
9and header files ) are pre-generated and stored into the
10`config/archs` directory.
11
12- `config/Makefile` and `config/generate_gypi.pl`
13
14  Makefile has supported platform list and generates and copies
15  platform dependent files (e.g. asm files) into arch directory with
16  `generate_gypi.pl`.  Platform dependent gypi files are also created
17  obtaining build information from `configdata.pm` that is generated
18  with `Configure` in the OpenSSL build system.
19
20  For Windows, `Configure` generates `makefile` that is only available
21  to `nmake` command.  `config/Makefile_VC-WIN32` and
22  `config/Makefile_VC-WIN64A` are made by hand for the use of GNU
23  make. If `makefile` rules or targets are changed in the version up
24  of OpenSSL, they should be also updated.
25
26- gyp and gypi files (`openssl*.{gyp,gypi}`)
27
28  `openssl.gyp` has two targets of openssl and openssl-cli referred
29  from `node.gyp`. They include asm and no_asm gypi files with arch
30  dependent gypi according to its build options and platforms. The
31  gyp data which is common with asm and no_asm are stored in
32  `openssl_common.gypi`.
33
34- header files (`config/*.{h,h.tmpl}`)
35
36  `bn_conf.h`, `dso_conf.h` and `opensslconf.h` are platform dependent
37  in the OpenSSL sources. They are replaced with `config/*.h.tmpl`
38  files to include the file in the `../../../config/` and referred to
39  each arch file that depends on asm and no-asm option. These headers are
40  generated by the make target `generate_headers`.
41
42### Supported architectures for use of ASM
43
44Here is a list of supported architectures for use of ASM in OpenSSL.
45
46  | --dest-os | --dest-cpu | OpenSSL target arch  | CI  |
47  | --------- | ---------- | -------------------- | --- |
48  | aix       | ppc64      | aix64-gcc            | o   |
49  | linux     | ia32       | linux-elf            | o   |
50  | linux     | x32        | linux-x32            | -   |
51  | linux     | x64        | linux-x86_64         | o   |
52  | linux     | arm        | linux-armv4          | o   |
53  | linux     | arm64      | linux-aarch64        | o   |
54  | linux     | ppc64(*1)  | linux-ppc64le        | o   |
55  | linux     | s390       | linux32-s390x        | o   |
56  | linux     | s390x      | linux64-s390x        | o   |
57  | mac       | ia32       | darwin-i386-cc       | -   |
58  | mac       | x64        | darwin64-x86-cc      | o   |
59  | win       | ia32       | VC-WIN32             | -   |
60  | win       | x64        | VC-WIN64A            | o   |
61  | solaris   | ia32       | solaris-x86-gcc      | o   |
62  | solaris   | x64        | solaris64-x86_64-gcc | o   |
63  | freebsd   | ia32       | BSD-x86              | -   |
64  | freebsd   | x64        | BSD-x86_64           | o   |
65  | openbsd   | ia32       | BSD-x86              | -   |
66  | openbsd   | x64        | BSD-x86_64           | -   |
67  | others    | others     | linux-elf            | -   |
68
69(*1: This needs to be configured with the variable of node_byteorder:
70little)
71
72These are listed in [config/Makefile](config/Makefile).
73Please refer [config/opensslconf_asm.h](config/opensslconf_asm.h) for details.
74
75To remove or add an architecture the templates need to be updated for which
76there are two:
77* include_asm.h.tmpl
78* include_no-asm.h.tmpl
79
80Remove the architecture in question from these files and then run:
81```console
82$ make generate-headers
83```
84Also remove the architecture from the list of supported ASM architectures in
85[README.md](../README.md#supported-architectures-for-use-of-asm)
86
87### Upgrading OpenSSL
88
89Please refer to [maintaining-openssl](../../doc/contributing/maintaining/maintaining-openssl.md).
90