Opened 7 years ago

Closed 4 years ago

#11972 closed Bugs (worksforme)

thousands multi-thread tests fail after -mt, _REENTRANT elimination in Oracle Studio 12.5 C++

Reported by: angela.xie@… Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description

Problem:thousands multi-thread tests fail after -mt, _REENTRANT elimination in Oracle Studio 12.5 C++. for example: atomic shared library build, CC lockpool.cpp -KPIC -G -o ../libboost_atomic.so -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I. -mt -DBOOST_ATOMIC_SOURCE -DBOOST_ATOMIC_DYN_LINK=1 -compat=5 -library=stlport4 -m32 ...

"lockpool.cpp", line 24: Error: #error Boost.Atomic: Unsupported target platform, POSIX threads are required when native atomic operations are not available. Solution: in boost/config/suffix.hpp 26:#ifndef BOOST_CONFIG_SUFFIX_HPP 27:#define BOOST_CONFIG_SUFFIX_HPP

change to 25:#include <unistd.h> 26:#ifndef BOOST_CONFIG_SUFFIX_HPP 27:#define BOOST_CONFIG_SUFFIX_HPP

250:
defined(_PTHREADS) defined(APPLE) defined(DragonFly)) \

change to

250:
defined(_PTHREADS) defined(APPLE) defined(DragonFly) (defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0))) \

Change History (3)

comment:1 by John Maddock, 7 years ago

Component: Noneconfig
Owner: set to John Maddock

I mentioned this in the PR, but there's something wrong here:

  • _POSIX_THREADS only tells you whether the operating system supports threads, it tells you nothing about whether the compiler in it's current version and build configuration generates thread safe code. At the very least the check would have to be in sun.hpp and guarded by a compiler version check if it's true that the next compiler release always generates thread safe code.
  • The latest online docs for Oracle 12.5 beta still mention -mt and _REENTRANT, in fact they say that -mt is a requirement for building thread safe code.

comment:2 by John Maddock, 6 years ago

Ping?

comment:3 by John Maddock, 4 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.