Opened 5 years ago

Last modified 7 months ago

#58930 new defect

gcc 8.3.0_4 with _XOPEN_SOURCE=500 breaks with #include <complex>

Reported by: bernstei Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cooljeanius (Eric Gallager)
Port: gcc8

Description

Compiling a trivial file, that just contains '#include <complex>' with the following command line fails as shown:

> g++ -c -std=c++0x   -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1    t.cpp 
In file included from /opt/local/include/gcc8/c++/system_error:39,
                 from /opt/local/include/gcc8/c++/bits/ios_base.h:46,
                 from /opt/local/include/gcc8/c++/ios:42,
                 from /opt/local/include/gcc8/c++/istream:38,
                 from /opt/local/include/gcc8/c++/sstream:38,
                 from /opt/local/include/gcc8/c++/complex:45,
                 from t.cpp:1:
/opt/local/include/gcc8/c++/x86_64-apple-darwin18/bits/error_constants.h:135:24: error: 'EOWNERDEAD' was not declared in this scope
       owner_dead =     EOWNERDEAD,
                        ^~~~~~~~~~
/opt/local/include/gcc8/c++/x86_64-apple-darwin18/bits/error_constants.h:151:34: error: 'ENOTRECOVERABLE' was not declared in this scope
       state_not_recoverable =    ENOTRECOVERABLE,
                                  ^~~~~~~~~~~~~~~
> cat t.cpp
#include <complex>
> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin18/8.3.0/lto-wrapper
Target: x86_64-apple-darwin18
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.3.0/configure --prefix=/opt/local --build=x86_64-apple-darwin18 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc8 --includedir=/opt/local/include/gcc8 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-8 --with-gxx-include-dir=/opt/local/include/gcc8/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-tls --with-pkgversion='MacPorts gcc8 8.3.0_4' --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
Thread model: posix
gcc version 8.3.0 (MacPorts gcc8 8.3.0_4) 

This appears to happen to other people sometimes (e.g. https://github.com/arbor-sim/arbor/issues/562), but I didn't see any evidence of a related ticket on macports.

Change History (5)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Port: gcc8 added

comment:2 Changed 5 years ago by kencu (Ken)

My first thought was that this was an upstream issue, but it appears that at least some people feel that the way we build gcc on MacPorts is not fully correct in this area <https://github.com/arbor-sim/arbor/commit/3bafa1b3547d6102ca5376f6ce3bc00aab0280a2>, and it's a configuration bug (i.e. a MacPorts bug).

comment:3 Changed 5 years ago by jmroot (Joshua Root)

It's correct that ENOTRECOVERABLE and EOWNERDEAD are not defined with _XOPEN_SOURCE=500. The issue is that error_constants.h is still referencing them in that case. It wraps the references in checks like #ifdef _GLIBCXX_HAVE_EOWNERDEAD but I guess those may be determined statically at build time or at least not change based on the current __DARWIN_C_LEVEL like the system headers do.

comment:4 Changed 3 years ago by kencu (Ken)

Nearly two years on, and I have no idea still if this issue is gone, is an upstream issue to worry about, or a MacPorts issue.

I am not sure how to make any progress here.

comment:5 Changed 7 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.