]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
Don't rely on component type in determining whether to use -fPIC
[builder.git] / source / gnucompiler.cpp
index 1b05a5cb6e99b459ff9f4f3ea3a63f3a8378295f..a86cb59d0567b06f4e88c07a72e2ddbd4dd17d49 100644 (file)
@@ -151,7 +151,7 @@ Task *GnuCompiler::run(const Target &target) const
        }
        if(binfo.threads && architecture->get_system()!="windows" && architecture->get_system()!="darwin")
                argv.push_back("-pthread");
-       if((comp.get_type()==Component::LIBRARY || comp.get_type()==Component::MODULE) && architecture->get_system()!="windows")
+       if(object.is_used_in_shared_library() && architecture->get_system()!="windows")
                argv.push_back("-fPIC");
 
        const Architecture &native_arch = builder.get_native_arch();