mirror of https://github.com/nodejs/node.git
Page:
Statically linked executable
Pages
API changes between v0.10 and v0.12
API changes between v0.10 and v4
API changes between v0.4 and v0.6
API changes between v0.6 and v0.8
API changes between v0.8 and v0.10
Breaking Changes
Breaking changes between Node 7 and 8
Breaking changes between v4 LTS and v6 LTS
Breaking changes between v4 and v5
Breaking changes between v5 and v6
Breaking changes between v6 LTS and v8 LTS
Breaking changes between v6 and v7
CITGM Status
CITGM known flakes
CITGM results table
Creating a CTC Meeting Issue
ES6 Module Detection in Node
Flaky tests
Frequently Asked Questions
Home
Installing and Building Node.js
Installing io.js via package manager
Meetings: Creating a Hangouts On Air Event
Merging pull requests with Jenkins
Migrating IO polling from libev to libuv
Migrating from v0.2 to v0.3
Migrating from v0.2 to v0.4
Statically linked executable
Testing pull requests with Jenkins
Windows Environment
5
Statically linked executable
Yihong Wang edited this page 2018-03-21 10:29:10 -07:00
Node.js has support to be compiled as a fully statically linked executable just by using the --fully-static
configure flag. That way it doesn't require external dynamic libraries (.so, .dll, .dylib...) and its main purpose is for embedded platforms. Nevertheless, it's somewhat experimental and has some issues you need to know before using it:
- It's dependent of the C lib used: the standard glibc (found on Ubuntu, for example) cannot be used to build fully statically linked executables, as some components are designed such that they require loading dynamic libs for some functionality. This doesn't happen with other alternative C libs like musl, uclib or DietLib, for example.
- It doesn't work with MacOS X developer tools: the vanilla gcc compiler on MacOS X doesn't recognize the
-static
flag since it's intended to use only dynamic linking. It could work with other compilers (installed with homebrew or macports, for example), but this has not been tested. - It could not load C++ Addons: some C libs like musl (and seems glibc too) either use a stripped-down version of the
dlopen()
function or dynamic loading functionality is stubbed out entirely (at least with musl 1.1.11) when included in statically linked executables, so loading of C++ Addons could fail. Requiring pure Javascript modules will work as expected, though.