s2geometry: Build fails on PowerPC (ppc32) almost immediately on encoded_s2shape_index.cc

Unfortunately, there is no meaningful error output, it just fails:

[  3%] Building CXX object CMakeFiles/s2.dir/src/s2/encoded_s2shape_index.cc.o
/opt/local/bin/g++-mp-12 -DABSL_MIN_LOG_LEVEL=1 -Ds2_EXPORTS -I/opt/local/libexec/openssl11/include -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_math_s2/s2/work/s2geometry-0.10.0/src -isystem /opt/local/include -pipe -I/opt/local/libexec/openssl11/include -Os -mone-byte-bool -DNDEBUG -I/opt/local/libexec/openssl11/include -isystem/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 -arch ppc -mmacosx-version-min=10.6 -fPIC   -Wno-attributes -Wno-deprecated-declarations -MD -MT CMakeFiles/s2.dir/src/s2/encoded_s2shape_index.cc.o -MF CMakeFiles/s2.dir/src/s2/encoded_s2shape_index.cc.o.d -o CMakeFiles/s2.dir/src/s2/encoded_s2shape_index.cc.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_s2/s2/work/s2geometry-0.10.0/src/s2/encoded_s2shape_index.cc
make[2]: *** [CMakeFiles/s2.dir/src/s2/encoded_s2shape_index.cc.o] Error 1

Here I use external abseil, but same story when I tried to build R-s2 (with bundled abseil), build immediately fails when begins compiling s2: https://github.com/r-spatial/s2/issues/235

Something is very wrong in some basic settings or assumptions. It should not fail this way, even if Big endian is not propertly supported down the road.

@jmr Any thoughts what may be failing?

P. S. -mone-byte-bool is passed to bypass broken static asserts in endian.h – they assume 1 byte bool, yet on Darwin ppc32 bool is 4 bytes.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 34 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry, I meant find the full gcc command that failed, and run it with -E so I can look at the preprocessed output.

Wherever you’re getting an error. You may be able to look at what the Debian patches did.

For -mone-byte-bool, is it safe to use? GCC documentation has a warning that resulting code may not be compatible.

It definitely is risky. If you call any other code with a bool argument that’s compiled without the option, it won’t work.

We can just as well disable static asserts for Darwin PPC, I guess.

Try wrapping all the functions with the static assert in #ifndef __PPC__ or whatever the right thing is. I don’t think the bool versions are needed.