From: Mikko Rasa Date: Tue, 3 Jan 2023 10:58:22 +0000 (+0200) Subject: Make symbols hidden by default on Linux X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cb25b8db7131a48be0411a4ce6898f09c530687c;p=builder.git Make symbols hidden by default on Linux This will encourage me to add the visibility decorations where necessary and reduce work needed for porting to Windows. --- diff --git a/plugins/gnu/gnucompiler.cpp b/plugins/gnu/gnucompiler.cpp index ba74409..e4c050f 100644 --- a/plugins/gnu/gnucompiler.cpp +++ b/plugins/gnu/gnucompiler.cpp @@ -302,7 +302,10 @@ ExternalTask::Arguments GnuCompiler::_run(const ObjectFile &object, FS::Path &wo if(binfo.threads && arch.get_system()!="windows" && arch.get_system()!="darwin") argv.push_back("-pthread"); if(object.is_used_in_shared_library() && arch.get_system()!="windows") + { + argv.push_back("-fvisibility=hidden"); argv.push_back("-fPIC"); + } if((arch.get_type()=="x86" || arch.get_type()=="ppc") && !arch.is_native()) argv.push_back(format("-m%d", arch.get_bits()));