build: do not link against librt on linux

PR-URL: https://github.com/nodejs/node/pull/29727
Fixes: https://github.com/nodejs/node/issues/27377
Fixes: https://github.com/nodejs/node/issues/29718
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Sam Roberts 2019-09-26 15:17:30 -07:00
parent f3ae3c9e3d
commit 7ec558cb24

View File

@ -290,6 +290,11 @@
[ 'OS=="sunos"', {
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
}],
[ 'OS=="linux"', {
'libraries!': [
'-lrt'
],
}],
[ 'OS in "freebsd linux"', {
'ldflags': [ '-Wl,-z,relro',
'-Wl,-z,now' ]