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

Building fails on PHP8 on MacOS #19

Open
troy-whitespark opened this issue Jan 19, 2021 · 2 comments
Open

Building fails on PHP8 on MacOS #19

troy-whitespark opened this issue Jan 19, 2021 · 2 comments

Comments

@troy-whitespark
Copy link

I'm not certain if this package just hasn't been updated to support PHP8 yet, or if it's a problem with my machine/configuration. The output of make is:

/bin/sh /Users/troy/php-ext-snappy/libtool --mode=compile cc -I. -I/Users/troy/php-ext-snappy -I/Users/troy/php-ext-snappy/include -I/Users/troy/php-ext-snappy/main -I/Users/troy/php-ext-snappy -I/usr/local/Cellar/php/8.0.1_1/include/php -I/usr/local/Cellar/php/8.0.1_1/include/php/main -I/usr/local/Cellar/php/8.0.1_1/include/php/TSRM -I/usr/local/Cellar/php/8.0.1_1/include/php/Zend -I/usr/local/Cellar/php/8.0.1_1/include/php/ext -I/usr/local/Cellar/php/8.0.1_1/include/php/ext/date/lib -I/Users/troy/php-ext-snappy/snappy  -DHAVE_CONFIG_H  -g -O2    -c /Users/troy/php-ext-snappy/snappy.c -o snappy.lo
mkdir .libs
 cc -I. -I/Users/troy/php-ext-snappy -I/Users/troy/php-ext-snappy/include -I/Users/troy/php-ext-snappy/main -I/Users/troy/php-ext-snappy -I/usr/local/Cellar/php/8.0.1_1/include/php -I/usr/local/Cellar/php/8.0.1_1/include/php/main -I/usr/local/Cellar/php/8.0.1_1/include/php/TSRM -I/usr/local/Cellar/php/8.0.1_1/include/php/Zend -I/usr/local/Cellar/php/8.0.1_1/include/php/ext -I/usr/local/Cellar/php/8.0.1_1/include/php/ext/date/lib -I/Users/troy/php-ext-snappy/snappy -DHAVE_CONFIG_H -g -O2 -c /Users/troy/php-ext-snappy/snappy.c  -fno-common -DPIC -o .libs/snappy.o
/bin/sh /Users/troy/php-ext-snappy/libtool --mode=compile g++ -I. -I/Users/troy/php-ext-snappy -I/Users/troy/php-ext-snappy/include -I/Users/troy/php-ext-snappy/main -I/Users/troy/php-ext-snappy -I/usr/local/Cellar/php/8.0.1_1/include/php -I/usr/local/Cellar/php/8.0.1_1/include/php/main -I/usr/local/Cellar/php/8.0.1_1/include/php/TSRM -I/usr/local/Cellar/php/8.0.1_1/include/php/Zend -I/usr/local/Cellar/php/8.0.1_1/include/php/ext -I/usr/local/Cellar/php/8.0.1_1/include/php/ext/date/lib -I/Users/troy/php-ext-snappy/snappy  -DHAVE_CONFIG_H  -g -O2    -c /Users/troy/php-ext-snappy/snappy/snappy-c.cc -o snappy/snappy-c.lo
mkdir snappy/.libs
 g++ -I. -I/Users/troy/php-ext-snappy -I/Users/troy/php-ext-snappy/include -I/Users/troy/php-ext-snappy/main -I/Users/troy/php-ext-snappy -I/usr/local/Cellar/php/8.0.1_1/include/php -I/usr/local/Cellar/php/8.0.1_1/include/php/main -I/usr/local/Cellar/php/8.0.1_1/include/php/TSRM -I/usr/local/Cellar/php/8.0.1_1/include/php/Zend -I/usr/local/Cellar/php/8.0.1_1/include/php/ext -I/usr/local/Cellar/php/8.0.1_1/include/php/ext/date/lib -I/Users/troy/php-ext-snappy/snappy -DHAVE_CONFIG_H -g -O2 -c /Users/troy/php-ext-snappy/snappy/snappy-c.cc  -fno-common -DPIC -o snappy/.libs/snappy-c.o
In file included from /Users/troy/php-ext-snappy/snappy/snappy-c.cc:29:
In file included from /Users/troy/php-ext-snappy/snappy/snappy.h:45:
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:54:14: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using int8 = std::int8_t;
             ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:55:15: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using uint8 = std::uint8_t;
              ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:56:15: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using int16 = std::int16_t;
              ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:57:16: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using uint16 = std::uint16_t;
               ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:58:15: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using int32 = std::int32_t;
              ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:59:16: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using uint32 = std::uint32_t;
               ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:60:15: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using int64 = std::int64_t;
              ^
/Users/troy/php-ext-snappy/snappy/snappy-stubs-public.h:61:16: warning: alias
      declarations are a C++11 extension [-Wc++11-extensions]
using uint64 = std::uint64_t;
               ^
In file included from /Users/troy/php-ext-snappy/snappy/snappy-c.cc:29:
/Users/troy/php-ext-snappy/snappy/snappy.h:197:10: error: unknown type name
      'constexpr'
  static constexpr int kBlockLog = 16;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:198:10: error: unknown type name
      'constexpr'
  static constexpr size_t kBlockSize = 1 << kBlockLog;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:198:26: error: expected ';' after top
      level declarator
  static constexpr size_t kBlockSize = 1 << kBlockLog;
                         ^
                         ;
/Users/troy/php-ext-snappy/snappy/snappy.h:200:10: error: unknown type name
      'constexpr'
  static constexpr int kMinHashTableBits = 8;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:201:10: error: unknown type name
      'constexpr'
  static constexpr size_t kMinHashTableSize = 1 << kMinHashTableBits;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:201:26: error: expected ';' after top
      level declarator
  static constexpr size_t kMinHashTableSize = 1 << kMinHashTableBits;
                         ^
                         ;
/Users/troy/php-ext-snappy/snappy/snappy.h:203:10: error: unknown type name
      'constexpr'
  static constexpr int kMaxHashTableBits = 14;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:204:10: error: unknown type name
      'constexpr'
  static constexpr size_t kMaxHashTableSize = 1 << kMaxHashTableBits;
         ^
/Users/troy/php-ext-snappy/snappy/snappy.h:204:26: error: expected ';' after top
      level declarator
  static constexpr size_t kMaxHashTableSize = 1 << kMaxHashTableBits;
                         ^
                         ;
8 warnings and 9 errors generated.
make: *** [snappy/snappy-c.lo] Error 1
@troy-whitespark
Copy link
Author

Added -std=c++11 to the CXXFLAGS in the Makefile and it compiled.

I don't know enough about PHP extension compilation to recommend a fix here or do a pull, but hopefully someone finds this useful and we can get this resolved for others!

@stloyd
Copy link
Contributor

stloyd commented Sep 2, 2023

I can confirm that without the -std=c++11 flag extension, it cannot be compiled on M1 osx.

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