Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple errors in folly/net/TcpInfo when building with gcc12 for ppc #1835

Closed
barracuda156 opened this issue Aug 10, 2022 · 3 comments
Closed

Comments

@barracuda156
Copy link

In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:27,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:18:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoTypes.h:184:20: error: 'tcp_connection_info' in namespace '::' does not name a type
  184 | using tcp_info = ::tcp_connection_info;
      |                    ^~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoTypes.h:185:31: error: 'TCP_CONNECTION_INFO' was not declared in this scope; did you mean 'TCP_CONNECTIONTIMEOUT'?
  185 | const int tcp_info_sock_opt = TCP_CONNECTION_INFO;
      |                               ^~~~~~~~~~~~~~~~~~~
      |                               TCP_CONNECTIONTIMEOUT
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:273:35: error: 'tcp_info' in namespace 'folly::detail' does not name a type
  273 |   using tcp_info = folly::detail::tcp_info;
      |                                   ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:276:26: error: 'tcp_info' does not name a type; did you mean 'TcpInfo'?
  276 |   explicit TcpInfo(const tcp_info& tInfo)
      |                          ^~~~~~~~
      |                          TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:289:38: error: expected ',' or '...' before '::' token
  289 |   const T1* getFieldAsPtr(T1 tcp_info::*field) const {
      |                                      ^~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:303:60: error: expected ',' or '...' before '::' token
  303 |   folly::Optional<uint64_t> getFieldAsOptUInt64(T1 tcp_info::*field) const {
      |                                                            ^~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:312:3: error: 'tcp_info' does not name a type; did you mean 'TcpInfo'?
  312 |   tcp_info tcpInfo = {};
      |   ^~~~~~~~
      |   TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In constructor 'folly::TcpInfo::TcpInfo(const int&)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:9: error: class 'folly::TcpInfo' does not have any field named 'tcpInfo'
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |         ^~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:58: error: 'tcp_info' is not a member of 'folly::TcpInfo'
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |                                                          ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:25: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In member function 'const T1* folly::TcpInfo::getFieldAsPtr(T1) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:290:26: error: 'tcpInfo' was not declared in this scope; did you mean 'TcpInfo'?
  290 |     return getFieldAsPtr(tcpInfo, tcpInfoBytesRead, field);
      |                          ^~~~~~~
      |                          TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:290:53: error: 'field' was not declared in this scope
  290 |     return getFieldAsPtr(tcpInfo, tcpInfoBytesRead, field);
      |                                                     ^~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::getFieldAsOptUInt64(T1) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:304:34: error: 'field' was not declared in this scope
  304 |     if (auto ptr = getFieldAsPtr(field)) {
      |                                  ^~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In static member function 'static folly::Expected<folly::TcpInfo, std::errc> folly::TcpInfo::initFromFd(const folly::NetworkSocket&, const LookupOptions&, folly::netops::Dispatcher&, IoctlDispatcher&)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:82:35: error: 'tcp_info' is not a member of 'folly::TcpInfo'
   82 |   socklen_t len = sizeof(TcpInfo::tcp_info);
      |                                   ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:87:20: error: 'struct folly::TcpInfo' has no member named 'tcpInfo'; did you mean 'TcpInfo'?
   87 |       (void*)&info.tcpInfo,
      |                    ^~~~~~~
      |                    TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<std::chrono::duration<long long int, std::ratio<1, 1000000> > > folly::TcpInfo::srtt() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:137:35: error: 'tcp_info' has not been declared
  137 |   const auto ptr = getFieldAsPtr(&tcp_info::tcpi_srtt);
      |                                   ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::bytesSent() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:151:31: error: 'tcp_info' has not been declared
  151 |   return getFieldAsOptUInt64(&tcp_info::tcpi_txbytes);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::bytesReceived() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:163:31: error: 'tcp_info' has not been declared
  163 |   return getFieldAsOptUInt64(&tcp_info::tcpi_rxbytes);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::bytesRetransmitted() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:175:31: error: 'tcp_info' has not been declared
  175 |   return getFieldAsOptUInt64(&tcp_info::tcpi_txretransmitbytes);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::packetsSent() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:211:31: error: 'tcp_info' has not been declared
  211 |   return getFieldAsOptUInt64(&tcp_info::tcpi_txpackets);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::packetsReceived() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:235:31: error: 'tcp_info' has not been declared
  235 |   return getFieldAsOptUInt64(&tcp_info::tcpi_rxpackets);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::packetsRetransmitted() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:259:31: error: 'tcp_info' has not been declared
  259 |   return getFieldAsOptUInt64(&tcp_info::tcpi_txretransmitpackets);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::cwndInPackets() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:301:31: error: 'tcp_info' has not been declared
  301 |   return getFieldAsOptUInt64(&tcp_info::tcpi_snd_cwnd);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::ssthresh() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:322:31: error: 'tcp_info' has not been declared
  322 |   return getFieldAsOptUInt64(&tcp_info::tcpi_snd_ssthresh);
      |                               ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::mss() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.cpp:334:10: error: 'tcpInfo' was not declared in this scope; did you mean 'TcpInfo'?
  334 |   return tcpInfo.tcpi_maxseg;
      |          ^~~~~~~
      |          TcpInfo
In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:27,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoDispatcher.h:23,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoDispatcher.cpp:17:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoTypes.h:184:20: error: 'tcp_connection_info' in namespace '::' does not name a type
  184 | using tcp_info = ::tcp_connection_info;
      |                    ^~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfoTypes.h:185:31: error: 'TCP_CONNECTION_INFO' was not declared in this scope; did you mean 'TCP_CONNECTIONTIMEOUT'?
  185 | const int tcp_info_sock_opt = TCP_CONNECTION_INFO;
      |                               ^~~~~~~~~~~~~~~~~~~
      |                               TCP_CONNECTIONTIMEOUT
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:273:35: error: 'tcp_info' in namespace 'folly::detail' does not name a type
  273 |   using tcp_info = folly::detail::tcp_info;
      |                                   ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:276:26: error: 'tcp_info' does not name a type; did you mean 'TcpInfo'?
  276 |   explicit TcpInfo(const tcp_info& tInfo)
      |                          ^~~~~~~~
      |                          TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:289:38: error: expected ',' or '...' before '::' token
  289 |   const T1* getFieldAsPtr(T1 tcp_info::*field) const {
      |                                      ^~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:303:60: error: expected ',' or '...' before '::' token
  303 |   folly::Optional<uint64_t> getFieldAsOptUInt64(T1 tcp_info::*field) const {
      |                                                            ^~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:312:3: error: 'tcp_info' does not name a type; did you mean 'TcpInfo'?
  312 |   tcp_info tcpInfo = {};
      |   ^~~~~~~~
      |   TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In constructor 'folly::TcpInfo::TcpInfo(const int&)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:9: error: class 'folly::TcpInfo' does not have any field named 'tcpInfo'
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |         ^~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:58: error: 'tcp_info' is not a member of 'folly::TcpInfo'
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |                                                          ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:277:25: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization
  277 |       : tcpInfo(tInfo), tcpInfoBytesRead{sizeof(TcpInfo::tcp_info)} {}
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In member function 'const T1* folly::TcpInfo::getFieldAsPtr(T1) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:290:26: error: 'tcpInfo' was not declared in this scope; did you mean 'TcpInfo'?
  290 |     return getFieldAsPtr(tcpInfo, tcpInfoBytesRead, field);
      |                          ^~~~~~~
      |                          TcpInfo
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:290:53: error: 'field' was not declared in this scope
  290 |     return getFieldAsPtr(tcpInfo, tcpInfoBytesRead, field);
      |                                                     ^~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h: In member function 'folly::Optional<long long unsigned int> folly::TcpInfo::getFieldAsOptUInt64(T1) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_folly/folly/work/folly-v2022.08.01.00/folly/net/TcpInfo.h:304:34: error: 'field' was not declared in this scope
  304 |     if (auto ptr = getFieldAsPtr(field)) {
      |                                  ^~~~~
@barracuda156
Copy link
Author

Looks like this is supported from 10.11 onwards: https://developer.apple.com/documentation/kernel/tcp_connection_info

@Orvid
Copy link
Contributor

Orvid commented Aug 11, 2022

In general we only support the 2 most recent named releases of OSX, so seeing errors when trying to build against a version more than 7 years old is expected. If the fixes aren't particularly invasive, we might be able to accept some of them, but I believe we've already removed a lot of the older workarounds for various things and would prefer not to bring those back.

@Orvid Orvid closed this as completed Aug 11, 2022
@barracuda156
Copy link
Author

In general we only support the 2 most recent named releases of OSX, so seeing errors when trying to build against a version more than 7 years old is expected. If the fixes aren't particularly invasive, we might be able to accept some of them, but I believe we've already removed a lot of the older workarounds for various things and would prefer not to bring those back.

@Orvid Thank you for responding. I have fixed the build now for 10.6 ppc32, though I had to disable TCP-related files and two files from Base64 (due to endianness) via CMakeLists.

10:~ svacchanda$ port -v installed folly
The following ports are currently installed:
  folly @2022.08.01.00_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-08-13T17:56:48+0700'

Let me deal with my PR to Macports, see if Intel also works on old systems, and then I can open a PR here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants