Opened 6 years ago

Closed 6 years ago

#12457 closed Bugs (fixed)

cannot compile log with Oracle Developer Studio 12.5

Reported by: Aparna Kumta <aparna.kumta@…> 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

< #elif (defined(GNUC)
(SUNPRO_CC >= 0x5130)) && (defined(i386) defined(x86_64))

---

#elif defined(GNUC) && (defined(i386)
defined(x86_64))

68c68

< #elif (defined(GNUC)
(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)

dump_x86_m64.txt (3.5 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros 64 bit mode for x86
dump_x86_m32.txt (3.4 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros 32 bit mode for x86
dump_m64_sparc.txt (3.5 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros 64 bit mode for sparc-S2
dump_m32_sparc.txt (3.5 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros 32 bit mode for sparc-S2
dump_sparc.tar.gz (153.3 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros for sparc-s2
dump_x86.tar.gz (154.3 KB ) - added by Aparna Kumta <aparna.kumta@…> 6 years ago.
predefined macros for x86

Download all attachments as: .zip

Change History (9)

comment:1 by Andrey Semashev, 6 years ago

Owner: changed from timblechmann to Andrey Semashev

comment:2 by Andrey Semashev, 6 years ago

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.

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_x86_m64.txt added

predefined macros 64 bit mode for x86

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_x86_m32.txt added

predefined macros 32 bit mode for x86

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_m64_sparc.txt added

predefined macros 64 bit mode for sparc-S2

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_m32_sparc.txt added

predefined macros 32 bit mode for sparc-S2

comment:3 by Andrey Semashev, 6 years ago

Resolution: fixed
Status: newclosed

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).

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_sparc.tar.gz added

predefined macros for sparc-s2

by Aparna Kumta <aparna.kumta@…>, 6 years ago

Attachment: dump_x86.tar.gz added

predefined macros for x86

Note: See TracTickets for help on using tickets.