Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add glibcCompiler and glibcRuntime to process.versions #41338

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/node_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ Metadata::Versions::Versions() {
openssl = GetOpenSSLVersion();
#endif

#ifdef __GLIBC__
glibcCompiler =
NODE_STRINGIFY(__GLIBC__)
"."
NODE_STRINGIFY(__GLIBC_MINOR__);
#endif /* __GLIBC__ */

#ifndef _WIN32
#ifdef RTLD_DEFAULT
const char* (*libc_version)();
*(reinterpret_cast<void**>(&libc_version)) =
dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
if (libc_version != nullptr) {
glibcRuntime = (*libc_version)();
}
#endif /* RTLD_DEFAULT */
#endif /* _WIN32 */

#ifdef NODE_HAVE_I18N_SUPPORT
icu = U_ICU_VERSION;
unicode = U_UNICODE_VERSION;
Expand Down
14 changes: 14 additions & 0 deletions src/node_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ namespace node {
#define NODE_VERSIONS_KEY_CRYPTO(V)
#endif

#ifdef __GLIBC__
#define NODE_VERSIONS_KEY_GLIBC_COMPILER(V) V(glibcCompiler)
#else
#define NODE_VERSIONS_KEY_GLIBC_COMPILER(V)
#endif /* __GLIBC__ */

#ifndef _WIN32
#define NODE_VERSIONS_KEY_GLIBC_RUNTIME(V) V(glibcRuntime)
#else
#define NODE_VERSIONS_KEY_GLIBC_RUNTIME(V)
#endif /* _WIN32 */

#ifdef NODE_HAVE_I18N_SUPPORT
#define NODE_VERSIONS_KEY_INTL(V) \
V(cldr) \
Expand All @@ -66,6 +78,8 @@ namespace node {
#define NODE_VERSIONS_KEYS(V) \
NODE_VERSIONS_KEYS_BASE(V) \
NODE_VERSIONS_KEY_CRYPTO(V) \
NODE_VERSIONS_KEY_GLIBC_COMPILER(V) \
NODE_VERSIONS_KEY_GLIBC_RUNTIME(V) \
NODE_VERSIONS_KEY_INTL(V) \
NODE_VERSIONS_KEY_QUIC(V)

Expand Down