Boost logo

Boost :

Subject: Re: [boost] [1.41.0] Beta 1 available
From: Alexander Churanov (alexanderchuranov_at_[hidden])
Date: 2009-11-13 12:36:55


Boost 1.40.0 beta 1 fail to build on SPARC64 machines. 1.37, however,
builds flawlessly.

Brief analysis indicates that the issue arises when code of smart_ptr
is assembled. The
"boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp" file contains
SPARC-specific assembly for atomic compare-and-swap implementation and
assembler rejects the code generated by the compiler out of that
function. The generated code contains a "cas" instruction where first
operand is a memory reference with complex addressing (register and
offset). According to the SPARC v9 manual only register containing
stored address may go there.

"uname -a": FreeBSD boost 8.0-BETA4 FreeBSD 8.0-BETA4 #4: Tue Sep 15
14:03:28 UTC 2009 boris_at_poly-e450-1:/usr/obj/usr/src/sys/E450
"c++ --version": c++ (GCC) 4.2.1 20070719 [FreeBSD]
"as --version": GNU assembler 2.15 [FreeBSD] 2004-05-23

The attached patch allows the code to build.

What is the appropriate way to check that the patched code works
correctly both in terms of logic and atomicity?

Alexander Churanov
maintainer of devel/boost-* ports for FreeBSD

Boost list run by bdawes at, gregod at, cpdaniel at, john at