Blob Blame History Raw
From 29b484f58108036f0aedb7709fbd5388fb0cbd7a Mon Sep 17 00:00:00 2001
From: Hartmut Kaiser <hartmut.kaiser@gmail.com>
Date: Fri, 31 Jan 2020 11:16:18 -0600
Subject: [PATCH] Adding missing #includes to fix gcc V10 linker problems

- flyby: clean up -fPIC option
---
 src/CMakeLists.txt                                  | 7 ++++++-
 src/runtime/agas/component_namespace.cpp            | 1 +
 src/runtime/agas/server/symbol_namespace_server.cpp | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dd39f959bf5..33e0fd131aa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -346,6 +346,10 @@ foreach(_module ${HPX_LIBS})
 
 endforeach()
 
+if((NOT HPX_WITH_STATIC_LINKING) AND (("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (APPLE)))
+  set_target_properties(hpx PROPERTIES POSITION_INDEPENDENT_CODE ON)
+endif()
+
 target_compile_definitions(hpx PUBLIC HPX_ENABLE_ASSERT_HANDLER PRIVATE
   HPX_COMPONENT_NAME=hpx HPX_EXPORTS)
 
@@ -423,7 +427,6 @@ endif()
 
 if(HPX_WITH_DYNAMIC_HPX_MAIN AND (("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (APPLE)))
   if(NOT HPX_WITH_STATIC_LINKING)
-    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
     if(HPX_WITH_DEFAULT_TARGETS)
       if(HPX_WITH_CUDA)
         cuda_add_library(hpx_wrap STATIC
@@ -442,6 +445,8 @@ if(HPX_WITH_DYNAMIC_HPX_MAIN AND (("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (
       endif()
     endif()
 
+    set_target_properties(hpx_wrap PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE ON)
+
     target_compile_definitions(hpx_wrap PUBLIC HPX_ENABLE_ASSERT_HANDLER PRIVATE
       HPX_APPLICATION_EXPORTS)
 
diff --git a/src/runtime/agas/component_namespace.cpp b/src/runtime/agas/component_namespace.cpp
index 23f23e42ae5..e9236992e8a 100644
--- a/src/runtime/agas/component_namespace.cpp
+++ b/src/runtime/agas/component_namespace.cpp
@@ -12,6 +12,7 @@
 #include <hpx/runtime/actions/basic_action.hpp>
 #include <hpx/runtime/agas/component_namespace.hpp>
 #include <hpx/runtime/agas/server/component_namespace.hpp>
+#include <hpx/runtime/applier/apply.hpp>
 #include <hpx/runtime/components/component_factory.hpp>
 #include <hpx/serialization/vector.hpp>
 
diff --git a/src/runtime/agas/server/symbol_namespace_server.cpp b/src/runtime/agas/server/symbol_namespace_server.cpp
index 436063ed470..b1eefebe41c 100644
--- a/src/runtime/agas/server/symbol_namespace_server.cpp
+++ b/src/runtime/agas/server/symbol_namespace_server.cpp
@@ -21,6 +21,7 @@
 #include <hpx/runtime/agas/interface.hpp>
 #include <hpx/runtime/agas/namespace_action_code.hpp>
 #include <hpx/runtime/agas/server/symbol_namespace.hpp>
+#include <hpx/runtime/applier/apply.hpp>
 #include <hpx/runtime/naming/split_gid.hpp>
 #include <hpx/thread_support/unlock_guard.hpp>
 #include <hpx/timing/scoped_timer.hpp>