Skip to content

Commit

Permalink
Make check_linker_need_libatomic more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush committed Aug 28, 2020
1 parent dca24b8 commit 7dcba1a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,17 @@ def check_linker_need_libatomic():
stdout=PIPE,
stderr=PIPE)
cc_test.communicate(input=code_test)
return cc_test.returncode != 0
if cc_test.returncode == 0:
return False
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
cc_test = subprocess.Popen(
['cc', '-x', 'c++', '-std=c++11', '-latomic', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
cc_test.communicate(input=code_test)
return cc_test.returncode == 0


# There are some situations (like on Windows) where CC, CFLAGS, and LDFLAGS are
Expand Down

0 comments on commit 7dcba1a

Please sign in to comment.