From 22b6cfa35c4cec8462785376b8543ce9cd4e422a Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Sun, 15 Nov 2020 19:57:48 +0100 Subject: firebird: build fixes (incl. parallel build) The main idea is to get rid of the "unset MAKEFLAGS". AFAI can see, the whole CPU stuff isn't used anymore. So we can drop the whole FB_CPU_ARG handling. Since LO doesn't use any of make's implicit rules, the build breaks, but luckily it just requires a single rule for the btyacc build - just a Firebuild build tool. Then there is the whole broken handling of LIBTOMMATH and LIBATOMIC_OPS already in LO's configure.ac. I don't know if any internal build of Firebird with these as system libs would work. I guess people either have a system Firebird or also build with internal libtommath and libatomic_ops. This fixes just the obvious errors. I didn't try to build it, so there might still be typos (TBH I thought hard about just dropping the system build of these libraries, after seeing the broken configure.ac). And I'm not sure our / the system boost preprocessor library is ever used over the Firebird-internal copy. It also looks like it's also just used in an other build tool and nothing of the Firebird DB itself depends on it. Then there is the movement of the install_name_tool / otool patching on MacOS from the patch into the ExternalProject to further shrink the patches, as the build doesn't depend on it. This also introduces a different debug build mode for the gcc-/g++-wrapper: MSVC_USE_INDIVIDUAL_PDBS. It uses -Fd to write a separate PDB per output file instead of using -FS to use sync writes to a single PDB, which might work around the PDB access failures seen by Jenkins for linking executables. In theory it's also faster and should work with all the other wrapper users, but I don't want to open that can of additional build errors (yet), for eventually marginal gains. Change-Id: I8d4c5d2f17def9e840a67ef1004787e8baaffa83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105902 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- solenv/gcc-wrappers/wrapper.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'solenv/gcc-wrappers/wrapper.cxx') diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index abc0ed2864fc..fabfbfc9b346 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -106,6 +106,10 @@ string processccargs(vector rawargs, string &env_prefix, bool &verbose) // note: always use -debug so a PDB file is created string linkargs(" -link -debug"); + // instead of using synced PDB access (-FS), use inidividual PDB files based on output + const char *const pEnvIndividualPDBs(getenv("MSVC_USE_INDIVIDUAL_PDBS")); + const bool bIndividualPDBs = (pEnvIndividualPDBs && !strcmp(pEnvIndividualPDBs, "TRUE")); + for(vector::iterator i = rawargs.begin(); i != rawargs.end(); ++i) { if (env_prefix_next_arg) { @@ -145,10 +149,19 @@ string processccargs(vector rawargs, string &env_prefix, bool &verbose) << (*i) << "\"" << endl; exit(1); } + + if (bIndividualPDBs) + { + if (dot == string::npos) + args.append(" -Fd" + *i + ".pdb"); + else + args.append(" -Fd" + (*i).substr(0, dot) + ".pdb"); + } } else if(*i == "-g" || !(*i).compare(0,5,"-ggdb")) { args.append("-Zi"); - args.append(" -FS"); + if (!bIndividualPDBs) + args.append(" -FS"); } else if(!(*i).compare(0,2,"-D")) { // need to re-escape strings for preprocessor -- cgit