[Libreoffice-commits] core.git: solenv/gcc-wrappers

2022-02-13 Thread Luboš Luňák (via logerrit)
 solenv/gcc-wrappers/wrapper.cxx |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit c5e29ad23da99913a73e28e7d5d1c096c7b9e312
Author: Luboš Luňák 
AuthorDate: Sat Feb 12 23:40:20 2022 +0100
Commit: Luboš Luňák 
CommitDate: Sun Feb 13 13:17:34 2022 +0100

may just as well use -Z7 if trying to avoid shared .pdb access

-Z7 writes all debug info into the .obj file, so it avoids the .pdb
altogether.

Change-Id: I89265009782d0a901ba3583a7241da0daf83860e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129877
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index c97b57808be9..c84fd4990b75 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -107,11 +107,12 @@ std::string processccargs(const std::vector& 
rawargs, std::string &
 std::string linkargs;
 bool block_linkargs = false;
 
-// instead of using synced PDB access (-FS), use individual PDB files 
based on output
+// Instead of using synced PDB access (-FS), use individual PDB files 
based on output.
+// In fact, simply use -Z7, which doesn't use PDB files at all and writes 
all debug into the .obj file.
 const char *const pEnvIndividualPDBs(getenv("MSVC_USE_INDIVIDUAL_PDBS"));
 const bool bIndividualPDBs = (pEnvIndividualPDBs && 
!strcmp(pEnvIndividualPDBs, "TRUE"));
 const char *const pEnvEnableZ7Debug(getenv("ENABLE_Z7_DEBUG"));
-const bool bEnableZ7Debug = (pEnvEnableZ7Debug && 
!strcmp(pEnvEnableZ7Debug, "TRUE"));
+const bool bEnableZ7Debug = (pEnvEnableZ7Debug && 
!strcmp(pEnvEnableZ7Debug, "TRUE")) || bIndividualPDBs;
 
 for(std::vector::const_iterator i = rawargs.begin(); i != 
rawargs.end(); ++i) {
 if (env_prefix_next_arg)
@@ -152,21 +153,12 @@ std::string processccargs(const std::vector& 
rawargs, std::string &
  << (*i) << "\"" << std::endl;
 exit(1);
 }
-
-if (bIndividualPDBs && !bEnableZ7Debug)
-{
-if (dot == std::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")) {
 if(!bEnableZ7Debug)
 {
 args.append("-Zi");
-if (!bIndividualPDBs)
-args.append(" -FS");
+args.append(" -FS");
 }
 else
 {


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2022-01-19 Thread Stephan Bergmann (via logerrit)
 solenv/gcc-wrappers/wrapper.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 19de52a0a66323eefd9f82f148ff1751dc6af08e
Author: Stephan Bergmann 
AuthorDate: Wed Jan 19 16:48:45 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 19 18:35:32 2022 +0100

Fix processing of first path in SOLARINC

...which does not have a space before the -I, so copying starting at pos+3
dropped the leading character from the path.  This was apparently never a
problem in practice, as the first path in SOLARINC happens to always be
SRCDIR/include, which should not be needed anyway when building external
projects with this GCC wrapper on Windows.

(So this commit is a change in behavior, making SRCDIR/include available to
those external project builds on Windows, but the follow-up commit
 "Decouple SRCDIR/include 
from
SOLARINC" will change the behavior back again.)

Change-Id: I3f82a83683ed381b791d221fe1da78b9797aea94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128621
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index fbf3f5378ae5..c97b57808be9 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -60,8 +60,11 @@ void setupccenv() {
 std::string inctmp(incbuf);
 free(incbuf);
 
-// 3 = strlen(" -I")
+// 2 = strlen("-I")
 for(size_t pos=0,len=0;pos0&[pos+len-1]==' ')
 --len;
 
-if(len>3) {
+if(len>2) {
 includepath.append(";");
-includepath.append(inctmp,pos+3,len-3);
+includepath.append(inctmp,pos+2,len-2);
 }
 pos=endpos;
 }


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2020-10-09 Thread Stephan Bergmann (via logerrit)
 solenv/gcc-wrappers/wrapper.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 22d7f7b3a5d9bde58a3b6e59f5c9117faaea4673
Author: Stephan Bergmann 
AuthorDate: Fri Oct 9 11:13:47 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 9 14:03:26 2020 +0200

Be more verbose why gcc-wrapper could not create process

Change-Id: I34f4209f1b830060a22ae38c05fe8a8e771c8f41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104111
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 56936155fa47..abc0ed2864fc 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -262,7 +262,8 @@ int startprocess(string command, string args, bool verbose)
 , // Startup Info
 ) // Process Information
 ) {
-cerr << "Error: could not create process" << endl;
+auto const e = GetLastError();
+cerr << "Error: could not create process \"" << cmdlineBuf << "\": 
" << e << endl;
 exit(1);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2018-01-08 Thread Michael Stahl
 solenv/gcc-wrappers/wrapper.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 471b844915cc3d7036cb0fd88b40eeb049f5b54d
Author: Michael Stahl 
Date:   Mon Jan 8 20:50:18 2018 +0100

gcc-wrappers: always pass -debug to linker

... like gbuild does; this causes a PDB file to be created, which
is required by BinScope.  Stops complaints about firebird's DLLs,
which are apparently the only DLLs linked with gcc-wrapper.

Change-Id: Ibe0e8053e0556748b1562b5f50f08480b2f2f89b

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index eb8954bc9764..b156c89dc220 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -97,7 +97,8 @@ string processccargs(vector rawargs) {
 
 // apparently these must be at the end
 // otherwise configure tests may fail
-string linkargs(" -link");
+// note: always use -debug so a PDB file is created
+string linkargs(" -link -debug");
 
 for(vector::iterator i = rawargs.begin(); i != rawargs.end(); ++i) 
{
 args.append(" ");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2017-09-18 Thread David Ostrovsky
 solenv/gcc-wrappers/wrapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bef91f7e5f3121dced360d4b90a09c334f12e56e
Author: David Ostrovsky 
Date:   Tue Sep 19 01:20:04 2017 +0200

gpg4libre: have gcc-wrapper handle linking properly

Change-Id: I83305f504f7d492195f07f11f06d2c9855d92400
Reviewed-on: https://gerrit.libreoffice.org/42441
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 6e3fe1393fdb..800687ad65a6 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -142,7 +142,7 @@ string processccargs(vector rawargs) {
 else if(!(*i).compare(0,2,"-L")) {
 linkargs.append(" -LIBPATH:"+(*i).substr(2));
 }
-else if(!(*i).compare(0,2,"-l")) {
+else if(!(*i).compare(0,2,"-l") && (*i).compare(0,5,"-link")) {
 linkargs.append(" "+(*i).substr(2)+".lib");
 }
 else if(!(*i).compare(0,5,"-def:") || !(*i).compare(0,5,"/def:")) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2017-02-23 Thread Mark Hung
 solenv/gcc-wrappers/wrapper.cxx |   20 
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit baf043318e83e768abe4ed7ae1c45bb75c0197e3
Author: Mark Hung 
Date:   Thu Feb 23 07:48:02 2017 +0800

solenv(gcc-wrappers): remove trailing space of includepath

Change-Id: Ic14140f197a2c5e1632fd27cfae38ca4eff9bd8c
Reviewed-on: https://gerrit.libreoffice.org/34562
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index cc31272..6e3fe13 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -49,7 +49,7 @@ void setupccenv() {
 }
 
 // Set-up include path
-string includepath="INCLUDE=.;";
+string includepath="INCLUDE=.";
 char* incbuf;
 size_t inclen;
 _dupenv_s(,,"SOLARINC");
@@ -61,16 +61,20 @@ void setupccenv() {
 free(incbuf);
 
 // 3 = strlen(" -I")
-for(size_t pos=0; pos != string::npos;) {
-size_t endpos=inctmp.find(" -I",pos+3);
-size_t len=endpos-pos-3;
+for(size_t pos=0,len=0;pos0) {
-includepath.append(inctmp,pos+3,len);
+endpos=inctmp.length();
+len=endpos-pos;
+
+while(len>0&[pos+len-1]==' ')
+--len;
+
+if(len>3) {
 includepath.append(";");
+includepath.append(inctmp,pos+3,len-3);
 }
-pos=inctmp.find(" -I",pos+len);
+pos=endpos;
 }
 if(_putenv(includepath.c_str())<0) {
 cerr << "Error: could not export INCLUDE" << endl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2015-04-18 Thread Michael Stahl
 solenv/gcc-wrappers/wrapper.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit c4a267215c10647ff281e9e629faa0a8a201f4b4
Author: Michael Stahl mst...@redhat.com
Date:   Sat Apr 18 22:02:23 2015 +0200

tdf#82430: gcc-wrappers: command line *must* start with a space

Yes, you read that right, if there's no space in front of the first
argument, cl.exe will *ignore* it.

Change-Id: I73d9bf026705538e53b5d91091a4c96eb15739b2

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 9dacb26..e68603c 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -186,6 +186,11 @@ int startprocess(string command, string args) {
 command=command.substr(0,pos+strlen(ccache))+.exe;
 }
 
+if (args[0] != ' ')
+{
+args.insert(0,  ); // lpCommandLine *must* start with space!
+}
+
 //cerr  CMD=   command args  endl;
 
 // Commandline may be modified by CreateProcess
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2014-08-18 Thread Michael Stahl
 solenv/gcc-wrappers/g++.cxx |2 +-
 solenv/gcc-wrappers/gcc.cxx |2 +-
 solenv/gcc-wrappers/wrapper.cxx |5 -
 solenv/gcc-wrappers/wrapper.hxx |2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit a18ff3d5c75c2b468c48bd19439dee0689d24d67
Author: Michael Stahl mst...@redhat.com
Date:   Mon Aug 18 12:04:17 2014 +0200

fdo#82430: gcc-wrappers: don't stop if REAL_CXX_FLAGS is empty

Hopefully should fix MSVC 2010 build...

Change-Id: I3dc71acfa58cdf65dfc6d731d9ebb77fd18f7fac

diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx
index 289d919..626b164 100644
--- a/solenv/gcc-wrappers/g++.cxx
+++ b/solenv/gcc-wrappers/g++.cxx
@@ -13,7 +13,7 @@ int main(int argc, char *argv[]) {
 vectorstring rawargs(argv + 1, argv + argc);
 
 string command=getexe(REAL_CXX);
-string flags=getexe(REAL_CXX_FLAGS);
+string flags=getexe(REAL_CXX_FLAGS, true);
 
 string args=flags.empty() ? string() : flags +  ;
 args += processccargs(rawargs);
diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx
index 8ff8148..f34c2db 100644
--- a/solenv/gcc-wrappers/gcc.cxx
+++ b/solenv/gcc-wrappers/gcc.cxx
@@ -13,7 +13,7 @@ int main(int argc, char *argv[]) {
 vectorstring rawargs(argv + 1, argv + argc);
 
 string command=getexe(REAL_CC);
-string flags=getexe(REAL_CC_FLAGS);
+string flags=getexe(REAL_CC_FLAGS, true);
 
 string args=flags.empty() ? string() : flags +  ;
 args += processccargs(rawargs);
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index ccdf206..1b8d562 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -15,11 +15,14 @@
 
 #define BUFLEN 2048
 
-string getexe(string exename) {
+string getexe(string exename, bool maybeempty) {
 char* cmdbuf;
 size_t cmdlen;
 _dupenv_s(cmdbuf,cmdlen,exename.c_str());
 if(!cmdbuf) {
+if (maybeempty) {
+return string();
+}
 cout  Error   exename   not defined. Did you forget to source 
the environment?  endl;
 exit(1);
 }
diff --git a/solenv/gcc-wrappers/wrapper.hxx b/solenv/gcc-wrappers/wrapper.hxx
index e2ffb01..789bc92 100644
--- a/solenv/gcc-wrappers/wrapper.hxx
+++ b/solenv/gcc-wrappers/wrapper.hxx
@@ -16,7 +16,7 @@
 
 using namespace std;
 
-string getexe(string exename);
+string getexe(string exename, bool maybeempty = false);
 
 void setupccenv();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2014-07-07 Thread Tor Lillqvist
 solenv/gcc-wrappers/wrapper.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit cdcb08c9dfdec86b232bd4ba4a8590e184836376
Author: Tor Lillqvist t...@collabora.com
Date:   Mon Jul 7 21:19:00 2014 +0300

Use -FS for VS 2013

Change-Id: I3beea86e97a4217128383c01049b2fc19c85c67a

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index ba22e16..ccdf206 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -113,8 +113,12 @@ string processccargs(vectorstring rawargs) {
 exit(1);
 }
 }
-else if(*i == -g)
+else if(*i == -g) {
 args.append(-Zi);
+#if _MSC_VER = 1800
+args.append( -FS);
+#endif
+}
 else if(!(*i).compare(0,2,-D)) {
 // need to re-escape strings for preprocessor
 for(size_t pos=(*i).find(\,0); pos!=string::npos; 
pos=(*i).find(\,pos)) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2013-09-19 Thread Jan Holesovsky
 solenv/gcc-wrappers/wrapper.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 61afc9f057bda2e27d547a406caf582d00a80638
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Sep 19 09:31:46 2013 +0200

Revert gcc-wrapper: warn on invalid path names.

This reverts commit 5f0145818cba17558708ef731e2bcc6a0b92a9f7.

Breaks the tinderboxes, I am afraid.

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index d83423d..42ead2f 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -87,11 +87,7 @@ string processccargs(vectorstring rawargs) {
 
 for(vectorstring::iterator i = rawargs.begin(); i != rawargs.end(); ++i) 
{
 args.append( );
-if(i-find(/) == 0) {
-cerr  Error: absolute unix path passed that looks like an 
option: '  *i  ';
-args.append(*i);
-}
-else if(*i == -o) {
+if(*i == -o) {
 // TODO: handle more than just exe output
 ++i;
 size_t dot=(*i).find_last_of(.);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2013-09-18 Thread Michael Meeks
 solenv/gcc-wrappers/wrapper.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5f0145818cba17558708ef731e2bcc6a0b92a9f7
Author: Michael Meeks michael.me...@collabora.com
Date:   Wed Sep 18 17:05:21 2013 +0100

gcc-wrapper: warn on invalid path names.

Change-Id: Ib057d519485da3a454bad579675ae718c42155eb

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 42ead2f..d83423d 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -87,7 +87,11 @@ string processccargs(vectorstring rawargs) {
 
 for(vectorstring::iterator i = rawargs.begin(); i != rawargs.end(); ++i) 
{
 args.append( );
-if(*i == -o) {
+if(i-find(/) == 0) {
+cerr  Error: absolute unix path passed that looks like an 
option: '  *i  ';
+args.append(*i);
+}
+else if(*i == -o) {
 // TODO: handle more than just exe output
 ++i;
 size_t dot=(*i).find_last_of(.);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gcc-wrappers

2013-03-24 Thread Peter Foley
 solenv/gcc-wrappers/wrapper.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c8c19de5c0df85a31ceb5454da351ed13076e048
Author: Peter Foley pefol...@verizon.net
Date:   Sat Mar 23 20:09:16 2013 -0400

fix liborcus on windows

Change-Id: I852b4e159f818854fd2ac5bdcd14343b2a628134

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 2b2f233..a768eef 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -103,7 +103,7 @@ string processccargs(vectorstring rawargs) {
 args.append(-link -LIBPATH:+(*i).substr(2));
 }
 else if(!(*i).compare(0,2,-l)) {
-args.append((*i).substr(2)+lib.lib);
+args.append((*i).substr(2)+.lib);
 }
 else if(!(*i).compare(0,12,-fvisibility)) {
 //TODO: drop other gcc-specific options
@@ -132,7 +132,7 @@ int startprocess(string command, string args) {
 sa.bInheritHandle=TRUE;
 
 if(!CreatePipe(childout_read,childout_write,sa,0)) {
-cerr  Error: could not create sdtout pipe  endl;
+cerr  Error: could not create stdout pipe  endl;
 exit(1);
 }
 
@@ -141,6 +141,7 @@ int startprocess(string command, string args) {
 si.hStdOutput=childout_write;
 si.hStdError=childout_write;
 
+// support ccache
 size_t pos=command.find(ccache );
 if(pos != string::npos) {
 args.insert(0,cl.exe);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits