diff --git a/src/python/pants/backend/native/tasks/native_compile.py b/src/python/pants/backend/native/tasks/native_compile.py index ea2ed30f233c..feb2827e2e99 100644 --- a/src/python/pants/backend/native/tasks/native_compile.py +++ b/src/python/pants/backend/native/tasks/native_compile.py @@ -196,6 +196,7 @@ def _make_compile_argv(self, compile_request): argv = ( [compiler.exe_filename] + compiler.extra_args + + # TODO: add -v to every compiler and linker invocation! # TODO: If we need to produce static libs, don't add -fPIC! (could use Variants -- see #5788). ['-c', '-fPIC'] + compiler_options + diff --git a/tests/python/pants_test/backend/native/tasks/test_link_shared_libraries.py b/tests/python/pants_test/backend/native/tasks/test_link_shared_libraries.py index 09a8ab83d5f0..13bc45568ad8 100644 --- a/tests/python/pants_test/backend/native/tasks/test_link_shared_libraries.py +++ b/tests/python/pants_test/backend/native/tasks/test_link_shared_libraries.py @@ -19,11 +19,17 @@ def task_type(cls): return LinkSharedLibraries def test_caching(self): - cpp = self. create_simple_cpp_library(ctypes_native_library=NativeArtifact(lib_name='test'),) + cpp = self.create_simple_cpp_library(ctypes_native_library=NativeArtifact(lib_name='test'),) cpp_compile_task_type = self.synthesize_task_subtype(CppCompile, 'cpp_compile_scope') - context = self.prepare_context_for_compile(target_roots=[cpp], - for_task_types=[cpp_compile_task_type]) + context = self.prepare_context_for_compile( + target_roots=[cpp], + for_task_types=[cpp_compile_task_type], + options={ + 'libc': { + 'enable_libc_search': True, + }, + }) cpp_compile = cpp_compile_task_type(context, os.path.join(self.pants_workdir, 'cpp_compile')) cpp_compile.execute()