You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "Chakravarthula, Krishnamurthy" <kr...@siemens.com> on 2008/05/03 13:04:53 UTC

RE: Urgent: log4cxx 0.10.0 build on HP Unix build problem

Hi Arnold,

 I am getting following error when I do make of log4cxx. The earlier
problems got resolved. They were because of my library path settings.
Please advice.

libtool: link: warning: this platform does not like uninstalled shared
libraries
libtool: link: `trivial' will be relinked during installation
g++ -g -O2 -o .libs/trivial trivial.o  -L/u/chakrava/apr
-L/u/chakrava/apr-util
-lm ../../../src/main/cpp/.libs/liblog4cxx.sl
/u/chakrava/apr-util/.libs/libapru
til-1.sl /u/chakrava/apr-util/xml/expat/lib/.libs/libexpat.sl
/u/chakrava/apr/.l
ibs/libapr-1.sl -lrt -lpthread /opt/hp-gcc64-4.2.1/lib/libstdc++.sl
-L/tmp/gcc-4
.2.1.tar.gz/obj/hppa64-hp-hpux11.11/libstdc++-v3/src
-L/tmp/gcc-4.2.1.tar.gz/obj
/hppa64-hp-hpux11.11/libstdc++-v3/src/.libs
-L/tmp/gcc-4.2.1.tar.gz/obj/./gcc -L
/opt/hp-gcc64-4.2.1/hppa64-hp-hpux11.11/bin -L/opt/hp-gcc64-4.2.1/lib
-Wl,+b -Wl
,/u/chakrava/log4cxx/src/main/cpp/.libs:/u/chakrava/apr-util/.libs:/u/ch
akrava/a
pr-util/xml/expat/lib/.libs:/u/chakrava/apr/.libs:/opt/hp-gcc64-4.2.1/li
b:/usr/l
ocal/lib:/usr/local/apr/lib
ld: Can't find dependent library "libaprutil-1.sl.2"
Fatal error.
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
  
Regards,
Krishna

-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Friday, April 25, 2008 6:27 PM
To: Log4CXX User
Subject: Re: Urgent: log4cxx 0.10.0 build on HP Unix build problem


On Apr 25, 2008, at 6:49 AM, Chakravarthula, Krishnamurthy wrote:

> I get the following error when I build log4cxx 0.10.0. Please advice.
> Did anybody get this working on HP Unix. If so, can you please pass on
> the configurations and build steps.
>
> objectptr.cpp: In static member function 'static void*
> log4cxx::helpers::ObjectPtrBase::exchange(void**, void*)':
> objectptr.cpp:41: error: cast from 'void*' to 'apr_uint32_t' loses
> precisiongmake[3]: *** [objectptr.lo] Error 1
> gmake[3]: Leaving directory
> `/u/zztstkqa/jen/apache-log4cxx-0.10.0/src/main/cpp'
> gmake[2]: *** [all-recursive] Error 1
> gmake[2]: Leaving directory
> `/u/zztstkqa/jen/apache-log4cxx-0.10.0/src/main'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/u/zztstkqa/jen/apache-log4cxx-0.10.0/ 
> src'
> gmake: *** [all-recursive] Error 1
>
>

Glad you got past the APR build problems.

The code that is failing to compile is this little chunk which is  
called by the ObjectPtrT<T> template during assignment operations to  
exchange the new and old values.  It is preferable, but not absolutely  
essential, that this exchange be atomic, so #if's are used to check  
for the presence of atomic exchange methods.

The problem is that the middle chunk in the following code fragment is  
active, but doesn't compile.  If the APR configuration has detected  
that void* is 4 bytes in size, then apr_atomic_xchg32 is used.  The  
compilation error indicates that void* can't be cast to apr_uint32_t  
which is a 32-bit unsigned integer which you'd expect would be able to  
hold a void* if void* was 4 bytes in size.


void* ObjectPtrBase::exchange(void** destination, void* newValue) {
#if _WIN32 && (!defined(_MSC_VER) || _MSC_VER >= 1300)
     return InterlockedExchangePointer(destination, newValue);
#elif APR_SIZEOF_VOIDP == 4
    return (void*) apr_atomic_xchg32((volatile apr_uint32_t*)  
destination,
                           (apr_uint32_t) newValue);
#else
    void* oldValue = *destination;
    *destination = newValue;
    return oldValue;
#endif

You could work around the compile problem, by modifying the #elif so  
that the last fragment is active.  Either a hack

#elif 0

or a refinement of the condition (which please submit back to the list)

#elif APR_SIZEOF_VOIDP == 4 && !defined(SOMEFLAG)

However, the compile error is problematic since it suggests that APR  
might have falsely detected a 32-bit void* when void* is 64-bit or APR  
was compiled as a 32-bit app and log4cxx is being built as a 64-bit  
app.  In either case, bad things would be likely.

If you thought that you were building a 64-bit APR and  
APR_SIZEOF_VOIDP == 4, then something is wrong in APR's configure on  
your platform and you should raise the issue on the user@apr mailing  
list.


RE: Urgent: log4cxx 0.10.0 build on HP Unix build problem

Posted by "Chakravarthula, Krishnamurthy" <kr...@siemens.com>.
-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Wednesday, May 07, 2008 9:10 PM
To: Log4CXX User
Subject: Re: Urgent: log4cxx 0.10.0 build on HP Unix build problem


On May 7, 2008, at 9:48 AM, Chakravarthula, Krishnamurthy wrote:

> I updated the Makefile.am in my installation but I get the same error.
> Please advice.
>
> Regards,
> Krishna
>

Did you rerun configure after the change to rebuild the generated  
Makefiles?

> After running configure again I am able to build successfully. After
"make install" I ran "make check" and it is giving following error. This
is same as the one which I was getting earlier with "make" on log4cxx.

ld: Can't find dependent library "libaprutil-1.sl.2"
> Fatal error.
> collect2: ld returned 1 exit status
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.


Re: Urgent: log4cxx 0.10.0 build on HP Unix build problem

Posted by Curt Arnold <ca...@apache.org>.
On May 7, 2008, at 9:48 AM, Chakravarthula, Krishnamurthy wrote:

> I updated the Makefile.am in my installation but I get the same error.
> Please advice.
>
> Regards,
> Krishna
>

Did you rerun configure after the change to rebuild the generated  
Makefiles?

RE: Urgent: log4cxx 0.10.0 build on HP Unix build problem

Posted by "Chakravarthula, Krishnamurthy" <kr...@siemens.com>.
I updated the Makefile.am in my installation but I get the same error.
Please advice.

Regards,
Krishna

-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Wednesday, May 07, 2008 10:42 AM
To: Log4CXX User
Subject: Re: Urgent: log4cxx 0.10.0 build on HP Unix build problem


On May 3, 2008, at 6:04 AM, Chakravarthula, Krishnamurthy wrote:

> Hi Arnold,

Please ask questions of the list instead of an individual developer.   
If you ask questions of a specific developer, that might discourage  
someone else from answering.

>
>
> I am getting following error when I do make of log4cxx. The earlier
> problems got resolved. They were because of my library path settings.
> Please advice.
>
> libtool: link: warning: this platform does not like uninstalled shared
> libraries
> libtool: link: `trivial' will be relinked during installation
> g++ -g -O2 -o .libs/trivial trivial.o  -L/u/chakrava/apr
> -L/u/chakrava/apr-util
> -lm ../../../src/main/cpp/.libs/liblog4cxx.sl
> /u/chakrava/apr-util/.libs/libapru
> til-1.sl /u/chakrava/apr-util/xml/expat/lib/.libs/libexpat.sl
> /u/chakrava/apr/.l
> ibs/libapr-1.sl -lrt -lpthread /opt/hp-gcc64-4.2.1/lib/libstdc++.sl
> -L/tmp/gcc-4
> .2.1.tar.gz/obj/hppa64-hp-hpux11.11/libstdc++-v3/src
> -L/tmp/gcc-4.2.1.tar.gz/obj
> /hppa64-hp-hpux11.11/libstdc++-v3/src/.libs
> -L/tmp/gcc-4.2.1.tar.gz/obj/./gcc -L
> /opt/hp-gcc64-4.2.1/hppa64-hp-hpux11.11/bin -L/opt/hp-gcc64-4.2.1/lib
> -Wl,+b -Wl
> ,/u/chakrava/log4cxx/src/main/cpp/.libs:/u/chakrava/apr-util/.libs:/ 
> u/ch
> akrava/a
> pr-util/xml/expat/lib/.libs:/u/chakrava/apr/.libs:/opt/hp- 
> gcc64-4.2.1/li
> b:/usr/l
> ocal/lib:/usr/local/apr/lib
> ld: Can't find dependent library "libaprutil-1.sl.2"
> Fatal error.
> collect2: ld returned 1 exit status
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
>
> Regards,
> Krishna
>

I created a bug report for this at
http://issues.apache.org/jira/browse/LOGCXX-280 
.  The fix is in the SVN HEAD, but I've provided the diffs below in  
case you want to fix up your existing build.

HP-UX apparently has issues with linking to an uninstalled shared  
library which prevents the sample and unit test programs from  
linking.  libtool indicates in your log file.

I've modified src/test/cpp/Makefile.am and src/examples/cpp/ 
Makefile.am so that the example and unit test files are not compiled  
and linked during the default build target, but only when you do a  
"make check".  To run "make check" on HP-UX, you will need to first do  
a "make install".

= 
= 
= 
= 
= 
= 
========================================================================
--- logging/log4cxx/trunk/src/examples/cpp/Makefile.am (original)
+++ logging/log4cxx/trunk/src/examples/cpp/Makefile.am Tue May  6  
22:03:40 2008
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-noinst_PROGRAMS = trivial delayedloop stream console
+check_PROGRAMS = trivial delayedloop stream console

INCLUDES = -I$(top_srcdir)/src/main/include -I$(top_builddir)/src/main/ 
include


Modified: logging/log4cxx/trunk/src/test/cpp/Makefile.am
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/Makefile
.am?rev=653989&r1=653988&r2=653989&view=diff
= 
= 
= 
= 
= 
= 
========================================================================
--- logging/log4cxx/trunk/src/test/cpp/Makefile.am (original)
+++ logging/log4cxx/trunk/src/test/cpp/Makefile.am Tue May  6 22:03:40  
2008
@@ -24,7 +24,7 @@

INCLUDES = -I$(top_srcdir)/src/main/include -I$(top_builddir)/src/main/ 
include

-noinst_PROGRAMS = testsuite
+check_PROGRAMS = testsuite

customlogger_tests = \
	customlogger/xlogger.cpp\


Re: Urgent: log4cxx 0.10.0 build on HP Unix build problem

Posted by Curt Arnold <ca...@apache.org>.
On May 3, 2008, at 6:04 AM, Chakravarthula, Krishnamurthy wrote:

> Hi Arnold,

Please ask questions of the list instead of an individual developer.   
If you ask questions of a specific developer, that might discourage  
someone else from answering.

>
>
> I am getting following error when I do make of log4cxx. The earlier
> problems got resolved. They were because of my library path settings.
> Please advice.
>
> libtool: link: warning: this platform does not like uninstalled shared
> libraries
> libtool: link: `trivial' will be relinked during installation
> g++ -g -O2 -o .libs/trivial trivial.o  -L/u/chakrava/apr
> -L/u/chakrava/apr-util
> -lm ../../../src/main/cpp/.libs/liblog4cxx.sl
> /u/chakrava/apr-util/.libs/libapru
> til-1.sl /u/chakrava/apr-util/xml/expat/lib/.libs/libexpat.sl
> /u/chakrava/apr/.l
> ibs/libapr-1.sl -lrt -lpthread /opt/hp-gcc64-4.2.1/lib/libstdc++.sl
> -L/tmp/gcc-4
> .2.1.tar.gz/obj/hppa64-hp-hpux11.11/libstdc++-v3/src
> -L/tmp/gcc-4.2.1.tar.gz/obj
> /hppa64-hp-hpux11.11/libstdc++-v3/src/.libs
> -L/tmp/gcc-4.2.1.tar.gz/obj/./gcc -L
> /opt/hp-gcc64-4.2.1/hppa64-hp-hpux11.11/bin -L/opt/hp-gcc64-4.2.1/lib
> -Wl,+b -Wl
> ,/u/chakrava/log4cxx/src/main/cpp/.libs:/u/chakrava/apr-util/.libs:/ 
> u/ch
> akrava/a
> pr-util/xml/expat/lib/.libs:/u/chakrava/apr/.libs:/opt/hp- 
> gcc64-4.2.1/li
> b:/usr/l
> ocal/lib:/usr/local/apr/lib
> ld: Can't find dependent library "libaprutil-1.sl.2"
> Fatal error.
> collect2: ld returned 1 exit status
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
>
> Regards,
> Krishna
>

I created a bug report for this at http://issues.apache.org/jira/browse/LOGCXX-280 
.  The fix is in the SVN HEAD, but I've provided the diffs below in  
case you want to fix up your existing build.

HP-UX apparently has issues with linking to an uninstalled shared  
library which prevents the sample and unit test programs from  
linking.  libtool indicates in your log file.

I've modified src/test/cpp/Makefile.am and src/examples/cpp/ 
Makefile.am so that the example and unit test files are not compiled  
and linked during the default build target, but only when you do a  
"make check".  To run "make check" on HP-UX, you will need to first do  
a "make install".

= 
= 
= 
= 
= 
= 
========================================================================
--- logging/log4cxx/trunk/src/examples/cpp/Makefile.am (original)
+++ logging/log4cxx/trunk/src/examples/cpp/Makefile.am Tue May  6  
22:03:40 2008
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-noinst_PROGRAMS = trivial delayedloop stream console
+check_PROGRAMS = trivial delayedloop stream console

INCLUDES = -I$(top_srcdir)/src/main/include -I$(top_builddir)/src/main/ 
include


Modified: logging/log4cxx/trunk/src/test/cpp/Makefile.am
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/Makefile.am?rev=653989&r1=653988&r2=653989&view=diff
= 
= 
= 
= 
= 
= 
========================================================================
--- logging/log4cxx/trunk/src/test/cpp/Makefile.am (original)
+++ logging/log4cxx/trunk/src/test/cpp/Makefile.am Tue May  6 22:03:40  
2008
@@ -24,7 +24,7 @@

INCLUDES = -I$(top_srcdir)/src/main/include -I$(top_builddir)/src/main/ 
include

-noinst_PROGRAMS = testsuite
+check_PROGRAMS = testsuite

customlogger_tests = \
	customlogger/xlogger.cpp\