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

tools: skip workaround for newer llvm #14077

Closed
wants to merge 2 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
12 changes: 9 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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"', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check future proof? Not sure how the < operator operates, but what happens if llvm_version == "10.0"? If it is a string comparison, '10.0' < '4.0'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good quastion, but in that case get_llvm_version would fail since it uses this RegEx r"(^(?:FreeBSD )?clang version|based on LLVM) ([3-9]\.[0-9]+)")
https://github.com/nodejs/node/blob/master/configure#L585

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, in that case don't worry about it. We'll have to update everything anyway when 10.0 comes.

# 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',
],
Expand Down
6 changes: 4 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down