You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Johan Corveleyn <jc...@gmail.com> on 2012/01/06 02:12:15 UTC

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

On Fri, Dec 2, 2011 at 7:04 PM,  <hw...@apache.org> wrote:
> Author: hwright
> Date: Fri Dec  2 18:04:14 2011
> New Revision: 1209610
>
> URL: http://svn.apache.org/viewvc?rev=1209610&view=rev
> Log:
> Fix builds where SVN_DEBUG is not defined.
>
> * subversion/libsvn_subr/debug.c:
>  Don't build any of this file if SVN_DEBUG isn't defined.  Callers don't have
>  access to it in that case, anyway.

For some reason, after this commit my *Release* build on Windows (VCE
2008) fails with:

libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__preamble
libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__print_props
libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
error LNK1120: 3 unresolved externals

I've been trying to understand why, but I don't. Maybe something to do
with preprocessors and linkers ... but my C compilation knowledge is
lacking here :-).

Is any of the other Windows devs seeing this?

A Debug build still works, so if SVN_DEBUG is defined everything's ok.
I guess that's also the reason why the buildbots don't see this
problem (I guess they perform Debug-builds).

-- 
Johan

> Modified:
>    subversion/trunk/subversion/libsvn_subr/debug.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/debug.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/debug.c?rev=1209610&r1=1209609&r2=1209610&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/debug.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/debug.c Fri Dec  2 18:04:14 2011
> @@ -29,6 +29,9 @@
>  #include "svn_types.h"
>  #include "svn_string.h"
>
> +/* We only build this code if SVN_DEBUG is defined. */
> +#ifdef SVN_DEBUG
> +
>  #include "private/svn_debug.h"
>
>
> @@ -111,3 +114,5 @@ svn_dbg__print_props(apr_hash_t *props,
>       SVN_DBG(("    '%s' -> '%s'\n", name, val->data));
>     }
>  }
> +
> +#endif
>
>

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

Posted by Daniel Shahaf <da...@elego.de>.
Daniel Shahaf wrote on Sat, Jan 07, 2012 at 01:07:01 +0200:
> Johan Corveleyn wrote on Fri, Jan 06, 2012 at 23:50:02 +0100:
> > Any ideas on how to fix this?
> > 
> 
> Make extractor.py skip svn_debug.h for debug builds?

And if anyone is feeling more ambitious: by making extractor.py pass the
files through the C preprocessor ('cl -E'), possibly excepting #include
directives, before regex'ing them for declarations.

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

Posted by Daniel Shahaf <da...@elego.de>.
Johan Corveleyn wrote on Fri, Jan 06, 2012 at 23:50:02 +0100:
> On Fri, Jan 6, 2012 at 2:45 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Johan Corveleyn wrote on Fri, Jan 06, 2012 at 02:12:15 +0100:
> >> On Fri, Dec 2, 2011 at 7:04 PM,  <hw...@apache.org> wrote:
> >> > Author: hwright
> >> > Date: Fri Dec  2 18:04:14 2011
> >> > New Revision: 1209610
> >> >
> >> > URL: http://svn.apache.org/viewvc?rev=1209610&view=rev
> >> > Log:
> >> > Fix builds where SVN_DEBUG is not defined.
> >> >
> >> > * subversion/libsvn_subr/debug.c:
> >> >  Don't build any of this file if SVN_DEBUG isn't defined.  Callers don't have
> >> >  access to it in that case, anyway.
> >>
> >> For some reason, after this commit my *Release* build on Windows (VCE
> >> 2008) fails with:
> >>
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__preamble
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__print_props
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
> >> ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
> >> error LNK1120: 3 unresolved externals
> >>
> >> I've been trying to understand why, but I don't. Maybe something to do
> >> with preprocessors and linkers ... but my C compilation knowledge is
> >> lacking here :-).
> >>
> >> Is any of the other Windows devs seeing this?
> >>
> >> A Debug build still works, so if SVN_DEBUG is defined everything's ok.
> >> I guess that's also the reason why the buildbots don't see this
> >> problem (I guess they perform Debug-builds).
> >>
> > Does adding those three functions to the exceptions list in
> > build/generator/extractor.py fix the release build (and break the
> > debug build)?
> 
> Yes.
> 
> Release build works.
> 
> Debug build fails with:
> 
> libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
> external symbol _svn_dbg__printf referenced in function
> _ignore_warnings
> libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
> external symbol _svn_dbg__preamble referenced in function
> _ignore_warnings
> ..\..\..\Debug\subversion\libsvn_ra\libsvn_ra-1.dll : fatal error
> LNK1120: 2 unresolved externals
> 
> 
> Any ideas on how to fix this?
> 

Make extractor.py skip svn_debug.h for debug builds?

> Has anyone been able to make a Release build on Windows since this commit?
> 

And if not: should we convert one of the bots to Release builds?

> -- 
> Johan

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

Posted by Daniel Shahaf <da...@elego.de>.
And a bit of background...

build/generator/extractor.py is a file used by gen-make.py on Windows to
construct the list of functions that the DLL's export.  That file is not
aware of C preprocessor macros, so functions that are #define'd away on
Windows must be explicitly excepted in it.

r1209610 added another instance of "functions whose declerations are
#define'd away", but failed to update the exceptions list.  The fallout
is that extractor.py includes those functions in the list of exported
symbols, but the compiler doesn't see their definitions, and
consequently linking fails since the to-be-exported symbol doesn't
exist in the object file.

Johan Corveleyn wrote on Fri, Jan 06, 2012 at 23:50:02 +0100:
> On Fri, Jan 6, 2012 at 2:45 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Johan Corveleyn wrote on Fri, Jan 06, 2012 at 02:12:15 +0100:
> >> On Fri, Dec 2, 2011 at 7:04 PM,  <hw...@apache.org> wrote:
> >> > Author: hwright
> >> > Date: Fri Dec  2 18:04:14 2011
> >> > New Revision: 1209610
> >> >
> >> > URL: http://svn.apache.org/viewvc?rev=1209610&view=rev
> >> > Log:
> >> > Fix builds where SVN_DEBUG is not defined.
> >> >
> >> > * subversion/libsvn_subr/debug.c:
> >> >  Don't build any of this file if SVN_DEBUG isn't defined.  Callers don't have
> >> >  access to it in that case, anyway.
> >>
> >> For some reason, after this commit my *Release* build on Windows (VCE
> >> 2008) fails with:
> >>
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__preamble
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__print_props
> >> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
> >> ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
> >> error LNK1120: 3 unresolved externals
> >>
> >> I've been trying to understand why, but I don't. Maybe something to do
> >> with preprocessors and linkers ... but my C compilation knowledge is
> >> lacking here :-).
> >>
> >> Is any of the other Windows devs seeing this?
> >>
> >> A Debug build still works, so if SVN_DEBUG is defined everything's ok.
> >> I guess that's also the reason why the buildbots don't see this
> >> problem (I guess they perform Debug-builds).
> >>
> > Does adding those three functions to the exceptions list in
> > build/generator/extractor.py fix the release build (and break the
> > debug build)?
> 
> Yes.
> 
> Release build works.
> 
> Debug build fails with:
> 
> libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
> external symbol _svn_dbg__printf referenced in function
> _ignore_warnings
> libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
> external symbol _svn_dbg__preamble referenced in function
> _ignore_warnings
> ..\..\..\Debug\subversion\libsvn_ra\libsvn_ra-1.dll : fatal error
> LNK1120: 2 unresolved externals
> 
> 
> Any ideas on how to fix this?
> 
> Has anyone been able to make a Release build on Windows since this commit?
> 
> -- 
> Johan

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

Posted by Johan Corveleyn <jc...@gmail.com>.
On Fri, Jan 6, 2012 at 2:45 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Johan Corveleyn wrote on Fri, Jan 06, 2012 at 02:12:15 +0100:
>> On Fri, Dec 2, 2011 at 7:04 PM,  <hw...@apache.org> wrote:
>> > Author: hwright
>> > Date: Fri Dec  2 18:04:14 2011
>> > New Revision: 1209610
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1209610&view=rev
>> > Log:
>> > Fix builds where SVN_DEBUG is not defined.
>> >
>> > * subversion/libsvn_subr/debug.c:
>> >  Don't build any of this file if SVN_DEBUG isn't defined.  Callers don't have
>> >  access to it in that case, anyway.
>>
>> For some reason, after this commit my *Release* build on Windows (VCE
>> 2008) fails with:
>>
>> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__preamble
>> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__print_props
>> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
>> ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
>> error LNK1120: 3 unresolved externals
>>
>> I've been trying to understand why, but I don't. Maybe something to do
>> with preprocessors and linkers ... but my C compilation knowledge is
>> lacking here :-).
>>
>> Is any of the other Windows devs seeing this?
>>
>> A Debug build still works, so if SVN_DEBUG is defined everything's ok.
>> I guess that's also the reason why the buildbots don't see this
>> problem (I guess they perform Debug-builds).
>>
> Does adding those three functions to the exceptions list in
> build/generator/extractor.py fix the release build (and break the
> debug build)?

Yes.

Release build works.

Debug build fails with:

libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
external symbol _svn_dbg__printf referenced in function
_ignore_warnings
libsvn_ra_local-1.lib(ra_plugin.obj) : error LNK2019: unresolved
external symbol _svn_dbg__preamble referenced in function
_ignore_warnings
..\..\..\Debug\subversion\libsvn_ra\libsvn_ra-1.dll : fatal error
LNK1120: 2 unresolved externals


Any ideas on how to fix this?

Has anyone been able to make a Release build on Windows since this commit?

-- 
Johan

Re: svn commit: r1209610 - /subversion/trunk/subversion/libsvn_subr/debug.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Does adding those three functions to the exceptions list in
build/generator/extractor.py fix the release build (and break the
debug build)?

Johan Corveleyn wrote on Fri, Jan 06, 2012 at 02:12:15 +0100:
> On Fri, Dec 2, 2011 at 7:04 PM,  <hw...@apache.org> wrote:
> > Author: hwright
> > Date: Fri Dec  2 18:04:14 2011
> > New Revision: 1209610
> >
> > URL: http://svn.apache.org/viewvc?rev=1209610&view=rev
> > Log:
> > Fix builds where SVN_DEBUG is not defined.
> >
> > * subversion/libsvn_subr/debug.c:
> >  Don't build any of this file if SVN_DEBUG isn't defined.  Callers don't have
> >  access to it in that case, anyway.
> 
> For some reason, after this commit my *Release* build on Windows (VCE
> 2008) fails with:
> 
> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__preamble
> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__print_props
> libsvn_subr.def : error LNK2001: unresolved external symbol svn_dbg__printf
> ..\..\..\Release\subversion\libsvn_subr\libsvn_subr-1.lib : fatal
> error LNK1120: 3 unresolved externals
> 
> I've been trying to understand why, but I don't. Maybe something to do
> with preprocessors and linkers ... but my C compilation knowledge is
> lacking here :-).
> 
> Is any of the other Windows devs seeing this?
> 
> A Debug build still works, so if SVN_DEBUG is defined everything's ok.
> I guess that's also the reason why the buildbots don't see this
> problem (I guess they perform Debug-builds).
> 
> -- 
> Johan
> 
> > Modified:
> >    subversion/trunk/subversion/libsvn_subr/debug.c
> >
> > Modified: subversion/trunk/subversion/libsvn_subr/debug.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/debug.c?rev=1209610&r1=1209609&r2=1209610&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_subr/debug.c (original)
> > +++ subversion/trunk/subversion/libsvn_subr/debug.c Fri Dec  2 18:04:14 2011
> > @@ -29,6 +29,9 @@
> >  #include "svn_types.h"
> >  #include "svn_string.h"
> >
> > +/* We only build this code if SVN_DEBUG is defined. */
> > +#ifdef SVN_DEBUG
> > +
> >  #include "private/svn_debug.h"
> >
> >
> > @@ -111,3 +114,5 @@ svn_dbg__print_props(apr_hash_t *props,
> >       SVN_DBG(("    '%s' -> '%s'\n", name, val->data));
> >     }
> >  }
> > +
> > +#endif
> >
> >