Opened 7 years ago

Closed 7 years ago

#12098 closed Bugs (fixed)

Tests fail with #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications...

Reported by: Aparna Kumta <aparna.kumta@…> Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: sergey.sprogis.oracle.com

Description

Compiling with Oracle Solaris Studio12.5 several log several tests fail as follows:

"CC" -std=c++11 -temp=/tmp/bn -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_USE_NATIVE_SYSLOG -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=600 -DEXTENSIONS -DSTDC_CONSTANT_MACROS -Dtypeof=typeof -I".." -c -o "/export/home/sstrunk-tester/boost_regression/boost_regression_develop/boost_sparc-S2_cpp11/results/boost/bin.v2/libs/log/build/sun-12.5_cpp11/release/build-no/log-api-unix/threading-multi/once_block.o" "../libs/log/src/once_block.cpp"

"/usr/include/sys/feature_tests.h", line 359: Error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications ?require the use of c99".

See for example: http://www.boost.org/development/tests/develop/developer/output/oracle-sparc-S2-12-5-cpp11-boost-bin-v2-libs-log-test-attr_attribute_set-test-sun-12-5_cpp11-release-build-no-threading-multi.html

The test passes, if '-D_XOPEN_SOURCE=600' is removed from the command line. So, inside libs/log/build/Jamfile.v2 removing the following line causes the compilation to succeed:

<target-os>solaris:<define>_XOPEN_SOURCE=600

Output after removing '-D_XOPEN_SOURCE=600'from the command line.

$CC -std=c++11 -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_USE_NATIVE_SYSLOG -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 -DEXTENSIONS -DSTDC_CONSTANT_MACROS -Dtypeof=typeof -I.. -c -o ./once_block.o ../libs/log/src/once_block.cpp

$

Change History (3)

comment:1 by Aparna Kumta <aparna.kumta@…>, 7 years ago

I see that previously, libs/log/build/Jamfile.v2 had '-D_XOPEN_SOURCE=500' defined. That seems to work. The change to '-D_XOPEN_SOURCE=600' is causing the failure when compiling with Oracle Solaris Studio 12.5.

comment:2 by Andrey Semashev, 7 years ago

Please, report this to Oracle. The headers should be compilable in C++11 mode.

Does it fix the problem if you add "<target-os>solaris:<define>_STDC_C99" on the next line after "<target-os>solaris:<define>_XOPEN_SOURCE=600"?

comment:3 by Andrey Semashev, 7 years ago

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