Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1810 closed Bugs (fixed)

HP-UX, PA-RISC, GCC 4.1+ sp_counted_base.hpp

Reported by: Yves Pausch Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc: Boris.Gubenko@…

Description

Hi, I can't link executables or shared libs 'cause of the following dependency produced by sp_counted_base.hpp and friends:

/usr/ccs/bin/ld: Unsatisfied symbols:
__sync_fetch_and_add_4 (first referenced in ...) (code)
__sync_val_compare_and_swap_4 (first referenced in ...) (code)

One can simply reproduce this behavior building this sample:

#include <boost/shared_ptr.hpp>

int main()
{
        boost::shared_ptr<int> spi ;
}

I don't know if this is a general solution but for me it helps to patch the mentioned file:

...
#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )

# include <boost/detail/sp_counted_base_sync.hpp>
...
...
#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined(__hpux)

# include <boost/detail/sp_counted_base_sync.hpp>
...

After that, the compiler passes BOOST_HAS_PTHREADS section and includes sp_counted_base_pt.hpp which works.

Thanks for considering to solve this issue.

Cheers, Yves.

Change History (6)

comment:1 Changed 10 years ago by Marshall Clow

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 Changed 10 years ago by Peter Dimov

Cc: Boris.Gubenko@… added
Status: newassigned

A workaround is to build with BOOST_SP_USE_PTHREADS defined.

I believe that the proper symbol to test is hppa, because hpux is set on HP-UX/IA-64 as well. Our regression tests at the moment only have g++ 3.4.6 for PA-RISC, which is why we missed this problem.

Are you in a position to test the current SVN trunk? If so, I'd appreciate it if you confirm or deny that building with BOOST_SP_USE_SPINLOCK works, so that I can route hppa to use it by default (as is done for ARM due to a similar problem with the sync intrinsics.)

comment:3 Changed 10 years ago by Boris Gubenko

Are you in a position to test the current SVN trunk? If so, I'd appreciate it if you confirm or deny that building with BOOST_SP_USE_SPINLOCK works, so that I can route hppa to use it by default (as is done for ARM due to a similar problem with the sync intrinsics.)

I'll test the current SVN trunk, as requested, and report back here. This platform needs some configuration work (for example, I don't think that wide character support is configured properly), but I could never get to it.

Thanks,

Boris

comment:4 Changed 10 years ago by Boris Gubenko

I ran smart_ptr library tests on PA-RISC with BOOST_SP_USE_PTHREADS defined and everything was fine. This is the same machine I'm using for the SVN trunk tests. The version of gcc is 3.4.2. Unfortunately, I don't have PA-RISC machine with more recent gcc installed.

I believe that the proper symbol to test is hppa, because hpux is set on HP-UX/IA-64 as well

This is correct: hppa is set on PA-RISC only while hpux is set on both PA-RISC and HP-UX/ia64.

Thanks,

Boris

comment:5 Changed 10 years ago by Peter Dimov

Resolution: fixed
Status: assignedclosed

This should be fixed in [44440] (release branch) and [44441] (trunk).

comment:6 Changed 10 years ago by Yves Pausch

Thank you!

Note: See TracTickets for help on using tickets.