You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Justin Erenkrantz <ju...@erenkrantz.com> on 2013/01/03 02:52:51 UTC

[PATCH] Add -no-suppress to LT_CFLAGS

I'm not entirely sure if we should commit this, but I'll throw this on-list
for posterity and future reference.

I was trying to compile trunk and was getting the following:

/bin/sh path-to-svn/libtool --tag=CC --silent --mode=compile ccache gcc
-std=c89  -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp
-DDARWIN_10  -g -g -O2    -I../../subversion/subversion/include
-I./subversion -I/opt/local/include/apr-1   -I/opt/local/include/apr-1
-I/opt/local/include -I/opt/local/include/serf-1 -I/opt/local/include   -o
subversion/svn/conflict-callbacks.lo -c
../../subversion/subversion/svn/conflict-callbacks.c
gmake: *** [subversion/svn/conflict-callbacks.lo] Error 1

The key thing here was that I did not get an error message - even though
there was an error code.  (Running with --debug indicated that libtool was
seeing an error returned by ccache and subsequently deleting the .lo files.)

Because GNU libtool always compiles code twice on Mac OS X (insert rant
against GNU libtool here), it defaults to hiding all compiler output on the
second pass.  In their infinite wisdom, I guess they figure that if the
first compile passes, the second always will too.  So, if I add
"-no-suppress" to LT_CFLAGS, I get:

/bin/sh path-to-svn/libtool --tag=CC --silent --mode=compile ccache gcc
-std=c89  -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp
-DDARWIN_10  -g -no-suppress -g -O2
 -I../../subversion/subversion/include -I./subversion
-I/opt/local/include/apr-1   -I/opt/local/include/apr-1
-I/opt/local/include -I/opt/local/include/serf-1 -I/opt/local/include   -o
subversion/svn/conflict-callbacks.lo -c
../../subversion/subversion/svn/conflict-callbacks.c
ccache: FATAL: Could not create
/Users/xx/.ccache/9/9/3aa71ed31e8f3313f3404f17c0985c-599411.o.tmp.stdout.xx.local.25073
(permission denied?)
gmake: *** [subversion/svn/conflict-callbacks.lo] Error 1

That of course is a far more useful error message and led me to the root
cause (bad perms in ~/.ccache/).  In subsequent builds, no more output was
produced with -no-suppress.  I guess if we have warnings in the code, it'd
perhaps emit the warnings twice for every compilation.  But, then again, I
always like reminding devs how evil libtool is and that it's
double-compiling everything.  =P  The right and proper thing would likely
be if libtool stashed the output in a variable and only emitted it when
there's an error code...alas.  -- justin

* configure.ac: Never suppress possible error output from the second-pass
compile.

Index: configure.ac
===================================================================
--- configure.ac        (revision 1428128)
+++ configure.ac        (working copy)
@@ -260,6 +260,7 @@
                  [Build shared libraries]),
   [svn_enable_shared="$enableval"], [svn_enable_shared="yes"])

+LT_CFLAGS="-no-suppress"
 if test "$svn_enable_static" = "yes" && test "$svn_enable_shared" = "yes"
; then
   AC_MSG_NOTICE([building both shared and static libraries])
 elif test "$svn_enable_static" = "yes" ; then

Re: [PATCH] Add -no-suppress to LT_CFLAGS

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
If you look at the path of the file that failed compilation, it is in
subversion/svn/.  On Mac OS X there is no need to compile it twice as there
is no real supported concept of PIC - it's a no-op for the compiler.
Linking the libraries statically or dynamically is different of course.  --
justin
On Jan 3, 2013 2:18 AM, "Peter Samuelson" <pe...@p12n.org> wrote:

>
> [Justin Erenkrantz]
> > Because GNU libtool always compiles code twice on Mac OS X (insert rant
> > against GNU libtool here)
> ...
> > But, then again, I always like reminding devs how evil libtool is and
> > that it's double-compiling everything.  =P
>
> Well, you asked it to build both static and shared libraries.  What's
> it supposed to do?  With most ABIs, you want to build shared library
> code in PIC mode and all other code in non-PIC mode.  So yes, that
> means double-compiling.  You'll notice it does _not_ do this for
> non-library code such as subversion/svn/ or subversion/svnadmin/.  (At
> least on Linux it doesn't.  I actually have no idea what it does on Mac
> OS.)
>
> Frankly, if you think double-compiling is "evil", you should be
> suggesting that we make either '--disable-static' or '--disable-shared'
> the default - see configure.ac, line 238 or so.  Not blaming libtool.
>

Re: [PATCH] Add -no-suppress to LT_CFLAGS

Posted by Peter Samuelson <pe...@p12n.org>.
[Justin Erenkrantz]
> Because GNU libtool always compiles code twice on Mac OS X (insert rant
> against GNU libtool here)
...
> But, then again, I always like reminding devs how evil libtool is and
> that it's double-compiling everything.  =P

Well, you asked it to build both static and shared libraries.  What's
it supposed to do?  With most ABIs, you want to build shared library
code in PIC mode and all other code in non-PIC mode.  So yes, that
means double-compiling.  You'll notice it does _not_ do this for
non-library code such as subversion/svn/ or subversion/svnadmin/.  (At
least on Linux it doesn't.  I actually have no idea what it does on Mac
OS.)

Frankly, if you think double-compiling is "evil", you should be
suggesting that we make either '--disable-static' or '--disable-shared'
the default - see configure.ac, line 238 or so.  Not blaming libtool.