+ const FS::Path &sysroot = binfo.sysroot;
+ if(!sysroot.empty())
+ argv.push_back("--sysroot="+sysroot.str());
+
+ FS::Path lib_dir = builder.get_prefix()/"lib";
+ if(binfo.rpath_mode==BuildInfo::ABSOLUTE)
+ argv.push_back("-Wl,-rpath,"+lib_dir.str());
+ else
+ {
+ if(binfo.rpath_mode==BuildInfo::RELATIVE)
+ argv.push_back("-Wl,-rpath,$ORIGIN/../lib");
+ argv.push_back("-Wl,-rpath-link,"+lib_dir.str());
+ }
+
+ for(const FS::Path &p: binfo.libpath)
+ argv.push_back("-L"+p.str());
+ if(binfo.strip)
+ argv.push_back("-s");
+ if(binfo.threads && arch.get_system()!="windows" && arch.get_system()!="darwin")
+ argv.push_back("-pthread");
+
+ const Architecture &native_arch = builder.get_native_arch();
+ if(arch.is_native() && arch.get_bits()!=native_arch.get_bits())
+ argv.push_back(format("-m%d", arch.get_bits()));