From 71dcd6e0db26ea32920d8834d8dde2d49ebdfd5f Mon Sep 17 00:00:00 2001 From: nanaya Date: Wed, 5 Jul 2017 15:49:18 +0900 Subject: [PATCH 1/2] tools: skip workaround for newer llvm Fixes: https://github.com/nodejs/node/issues/14076 Refs: https://svnweb.freebsd.org/ports/head/www/node/Makefile?revision=444555&view=markup --- common.gypi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index ea08e80365b5c6..6677274f3abe80 100644 --- a/common.gypi +++ b/common.gypi @@ -407,9 +407,15 @@ 'libraries': [ '-lelf' ], }], ['OS=="freebsd"', { - # Use this flag because on FreeBSD std::pairs copy constructor is non-trivial - # https://lists.freebsd.org/pipermail/freebsd-toolchain/2016-March/002094.html - 'cflags': [ '-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1' ], + 'conditions': [ + ['llvm_version < "4.0"', { + # Use this flag because on FreeBSD std::pairs copy constructor is non-trivial. + # Doesn't apply to llvm 4.0 (FreeBSD 11.1) or later. + # Refs: https://lists.freebsd.org/pipermail/freebsd-toolchain/2016-March/002094.html + # Refs: https://svnweb.freebsd.org/ports/head/www/node/Makefile?revision=444555&view=markup + 'cflags': [ '-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1' ], + }], + ], 'ldflags': [ '-Wl,--export-dynamic', ], From b2407bc735e0f14dca380479ed3fb39d35b475fe Mon Sep 17 00:00:00 2001 From: nanaya Date: Wed, 5 Jul 2017 19:43:47 +0900 Subject: [PATCH 2/2] tools: always include llvm_version in config Also used in common.gypi to check whether a flag is needed or not based on llvm version. --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index eae46392ab5713..4f2e9e563c7cf8 100755 --- a/configure +++ b/configure @@ -635,12 +635,14 @@ def check_compiler(o): # to a version that is not completely ancient. warn('C compiler too old, need gcc 4.2 or clang 3.2 (CC=%s)' % CC) - # Need llvm_version or gas_version when openssl asm files are compiled + if is_clang: + o['variables']['llvm_version'] = get_llvm_version(CC) + + # Need xcode_version or gas_version when openssl asm files are compiled. if options.without_ssl or options.openssl_no_asm or options.shared_openssl: return if is_clang: - o['variables']['llvm_version'] = get_llvm_version(CC) if sys.platform == 'darwin': o['variables']['xcode_version'] = get_xcode_version(CC) else: