Opened 6 years ago
Closed 6 years ago
#12457 closed Bugs (fixed)
cannot compile log with Oracle Developer Studio 12.5
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | atomic |
Version: | Boost 1.62.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Compiling Boost.log with Oracle Developer Studio 12.5, we see the following failure:
% "CC" -std=c++11 -library=stdcpp,CrunG3 -xO4 -mt -erroff=%none -m32 -KPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_DLL -DBOOST_LOG_HAS_PTHREAD_MUTEX_ROBUST -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -DEXTENSIONS -DSTDC_CONSTANT_MACROS -Dtypeof=typeof -I"../../.." -I"../../../libs/log/src" -c -o "../../../bin.v2/libs/log/build/sun/release/stdlib-gnu/threading-multi/posix/ipc_reliable_message_queue.o" "../../../libs/log/src/posix/ipc_reliable_message_queue.cpp"
"../../../libs/log/src/posix/ipc_reliable_message_queue.cpp", line 61: Error: #error Boost.Log: Native 32-bit atomic operations are required but not supported by Boost.Atomic on the target platform.
This seems to be a configuration issue.
The following changes seems to work:
1) In boost/atomic/detail/platform/platform.hpp % !diff diff ./platform.hpp ./platform.hpp_orig 46c46
(SUNPRO_CC >= 0x5130)) && (defined(i386) | defined(x86_64)) |
---
#elif defined(GNUC) && (defined(i386) defined(x86_64))
68c68
(SUNPRO_CC >= 0x5130)) && defined(sparc) |
---
#elif defined(GNUC) && defined(sparc_v9)
The above change causes the compilation to proceed further, however, it fails again with another configuration issue causing failure to build atomic library
"CC" -std=c++11 -library=stdcpp,CrunG3 -xO4 -mt -erroff=%none -m32 -KPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG -I"../../.." -c -o "../../../bin.v2/libs/atomic/build/sun/release/stdlib-gnu/threading-multi/lockpool.o" "../../../libs/atomic/src/lockpool.cpp"
"../../../boost/atomic/detail/ops_gcc_sparc.hpp", line 69: Error: The function "fence_before_store" must have a prototype.
In boost/atomic/detail/ops_gcc_sparc.hpp, the following change seems to resolve the issue
% !diff % diff ./ops_gcc_sparc.hpp ./ops_gcc_sparc.hpp_orig 69c69 < fence_before(order); ---
fence_before_store(order);
71c71 < fence_after(order); ---
fence_after_store(order);
110c110 < fence_before(order); ---
base_type::fence_before(order);
118c118 < fence_after(order); ---
base_type::fence_after(order);
The changes above successfully compiles the log sources.
Attachments (6)
Change History (9)
comment:1 by , 6 years ago
Owner: | changed from | to
---|
comment:2 by , 6 years ago
comment:3 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Compiler detection was corrected in dce87d3c0a756e6c627e1be3258d558767f24db8 and e4506534510635ff45d2d46dd9e9b53273c8d4c8, this should fix the problem. If it doesn't? please reopen (I have no way of testing the changes).
ops_gcc_sparc.hpp should be fixed in 4274a78f46923653082e32328d73b022e6be9365.
Regarding changes to platform.hpp, I don't think they are legit. See https://github.com/boostorg/atomic/pull/6.