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

Reply via email to