11cb0ef41Sopenharmony_ciThis has a new binding scheme in building OpenSSL-3.0.0 library with 21cb0ef41Sopenharmony_ciNode.js. OpenSSL-3.0.0 uses a new build system with `Perl` for various 31cb0ef41Sopenharmony_cisupported platforms. See `openssl/Configurations/README` and 41cb0ef41Sopenharmony_ci`openssl/Configurations/README-design.md` in the OpenSSL source for 51cb0ef41Sopenharmony_cidetails. 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciIn order to build OpenSSL library without `Perl` in the build of Node.js 81cb0ef41Sopenharmony_cifor various supported platforms, platform dependent files (e.g. asm 91cb0ef41Sopenharmony_ciand header files ) are pre-generated and stored into the 101cb0ef41Sopenharmony_ci`config/archs` directory. 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci- `config/Makefile` and `config/generate_gypi.pl` 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci Makefile has supported platform list and generates and copies 151cb0ef41Sopenharmony_ci platform dependent files (e.g. asm files) into arch directory with 161cb0ef41Sopenharmony_ci `generate_gypi.pl`. Platform dependent gypi files are also created 171cb0ef41Sopenharmony_ci obtaining build information from `configdata.pm` that is generated 181cb0ef41Sopenharmony_ci with `Configure` in the OpenSSL build system. 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci For Windows, `Configure` generates `makefile` that is only available 211cb0ef41Sopenharmony_ci to `nmake` command. `config/Makefile_VC-WIN32` and 221cb0ef41Sopenharmony_ci `config/Makefile_VC-WIN64A` are made by hand for the use of GNU 231cb0ef41Sopenharmony_ci make. If `makefile` rules or targets are changed in the version up 241cb0ef41Sopenharmony_ci of OpenSSL, they should be also updated. 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci- gyp and gypi files (`openssl*.{gyp,gypi}`) 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci `openssl.gyp` has two targets of openssl and openssl-cli referred 291cb0ef41Sopenharmony_ci from `node.gyp`. They include asm and no_asm gypi files with arch 301cb0ef41Sopenharmony_ci dependent gypi according to its build options and platforms. The 311cb0ef41Sopenharmony_ci gyp data which is common with asm and no_asm are stored in 321cb0ef41Sopenharmony_ci `openssl_common.gypi`. 331cb0ef41Sopenharmony_ci 341cb0ef41Sopenharmony_ci- header files (`config/*.{h,h.tmpl}`) 351cb0ef41Sopenharmony_ci 361cb0ef41Sopenharmony_ci `bn_conf.h`, `dso_conf.h` and `opensslconf.h` are platform dependent 371cb0ef41Sopenharmony_ci in the OpenSSL sources. They are replaced with `config/*.h.tmpl` 381cb0ef41Sopenharmony_ci files to include the file in the `../../../config/` and referred to 391cb0ef41Sopenharmony_ci each arch file that depends on asm and no-asm option. These headers are 401cb0ef41Sopenharmony_ci generated by the make target `generate_headers`. 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ci### Supported architectures for use of ASM 431cb0ef41Sopenharmony_ci 441cb0ef41Sopenharmony_ciHere is a list of supported architectures for use of ASM in OpenSSL. 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci | --dest-os | --dest-cpu | OpenSSL target arch | CI | 471cb0ef41Sopenharmony_ci | --------- | ---------- | -------------------- | --- | 481cb0ef41Sopenharmony_ci | aix | ppc64 | aix64-gcc | o | 491cb0ef41Sopenharmony_ci | linux | ia32 | linux-elf | o | 501cb0ef41Sopenharmony_ci | linux | x32 | linux-x32 | - | 511cb0ef41Sopenharmony_ci | linux | x64 | linux-x86_64 | o | 521cb0ef41Sopenharmony_ci | linux | arm | linux-armv4 | o | 531cb0ef41Sopenharmony_ci | linux | arm64 | linux-aarch64 | o | 541cb0ef41Sopenharmony_ci | linux | ppc64(*1) | linux-ppc64le | o | 551cb0ef41Sopenharmony_ci | linux | s390 | linux32-s390x | o | 561cb0ef41Sopenharmony_ci | linux | s390x | linux64-s390x | o | 571cb0ef41Sopenharmony_ci | mac | ia32 | darwin-i386-cc | - | 581cb0ef41Sopenharmony_ci | mac | x64 | darwin64-x86-cc | o | 591cb0ef41Sopenharmony_ci | win | ia32 | VC-WIN32 | - | 601cb0ef41Sopenharmony_ci | win | x64 | VC-WIN64A | o | 611cb0ef41Sopenharmony_ci | solaris | ia32 | solaris-x86-gcc | o | 621cb0ef41Sopenharmony_ci | solaris | x64 | solaris64-x86_64-gcc | o | 631cb0ef41Sopenharmony_ci | freebsd | ia32 | BSD-x86 | - | 641cb0ef41Sopenharmony_ci | freebsd | x64 | BSD-x86_64 | o | 651cb0ef41Sopenharmony_ci | openbsd | ia32 | BSD-x86 | - | 661cb0ef41Sopenharmony_ci | openbsd | x64 | BSD-x86_64 | - | 671cb0ef41Sopenharmony_ci | others | others | linux-elf | - | 681cb0ef41Sopenharmony_ci 691cb0ef41Sopenharmony_ci(*1: This needs to be configured with the variable of node_byteorder: 701cb0ef41Sopenharmony_cilittle) 711cb0ef41Sopenharmony_ci 721cb0ef41Sopenharmony_ciThese are listed in [config/Makefile](config/Makefile). 731cb0ef41Sopenharmony_ciPlease refer [config/opensslconf_asm.h](config/opensslconf_asm.h) for details. 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ciTo remove or add an architecture the templates need to be updated for which 761cb0ef41Sopenharmony_cithere are two: 771cb0ef41Sopenharmony_ci* include_asm.h.tmpl 781cb0ef41Sopenharmony_ci* include_no-asm.h.tmpl 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ciRemove the architecture in question from these files and then run: 811cb0ef41Sopenharmony_ci```console 821cb0ef41Sopenharmony_ci$ make generate-headers 831cb0ef41Sopenharmony_ci``` 841cb0ef41Sopenharmony_ciAlso remove the architecture from the list of supported ASM architectures in 851cb0ef41Sopenharmony_ci[README.md](../README.md#supported-architectures-for-use-of-asm) 861cb0ef41Sopenharmony_ci 871cb0ef41Sopenharmony_ci### Upgrading OpenSSL 881cb0ef41Sopenharmony_ci 891cb0ef41Sopenharmony_ciPlease refer to [maintaining-openssl](../../doc/contributing/maintaining/maintaining-openssl.md). 90