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

Compilation of cphalcon fails with gcc-7.2. #1591

Closed
sergeyklay opened this issue Oct 27, 2017 · 8 comments
Closed

Compilation of cphalcon fails with gcc-7.2. #1591

sergeyklay opened this issue Oct 27, 2017 · 8 comments

Comments

@sergeyklay
Copy link
Member

From @Fisiu on September 19, 2017 19:14

I'm trying to compile phalcon-3.2.2 with with the latest zephir-0.9.11 using gcc-7.2 however I have some issues. Here is a build log:
phalcon-3.2.2-gcc-7.2.txt

Compilation of zephir didn't return any errors, but cphalcon.

[   86s] libtool: compile:  cc -I. -I/home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext -DPHP_ATOM_INC -I/home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/include -I/home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/main -I/home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g3 -O1 -std=gnu90 -DZEPHIR_RELEASE=1 -c /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c  -fPIC -DPIC -o phalcon/events/.libs/eventsawareinterface.o
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: stray '\' in program
[   86s]   * Phalcon\Di\InjectionAwareInterface
[   86s]            ^
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Di'
[   86s]   * Phalcon\Di\InjectionAwareInterface
[   86s]             ^~
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:16:14: error: stray '\' in program
[   86s]   * Phalcon\Di\InjectionAwareInterface
[   86s]               ^
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: unknown type name 'Di'
[   86s]   * Phalcon\Di\InjectionAwareInterface
[   86s]             ^~
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:18:88: error: stray '\' in program
[   86s]   * This interface must be implemented in those classes that uses internally the Phalcon\Di that creates them
[   86s]                                                                                         ^
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'the'
[   86s]   * Sets the dependency injector
[   86s]          ^~~
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: unknown type name 'the'
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'the'
[   86s]   * Returns the internal dependency injector
[   86s]             ^~~
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: unknown type name 'the'
[   86s] make: *** [Makefile:234: phalcon/di/injectionawareinterface.lo] Error 1
[   86s] make: *** Waiting for unfinished jobs....
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/exception.zep.c:18:11: error: stray '\' in program
[   86s]   * Phalcon\Exception
[   86s]            ^
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/exception.zep.c:18:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Exception'
[   86s]   * Phalcon\Exception
[   86s]             ^~~~~~~~~
[   86s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/exception.zep.c:18:12: error: unknown type name 'Exception'
[   86s] make: *** [Makefile:236: phalcon/exception.lo] Error 1
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:16:11: error: stray '\' in program
[   87s]   * Phalcon\Events\EventsAwareInterface
[   87s]            ^
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:16:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Events'
[   87s]   * Phalcon\Events\EventsAwareInterface
[   87s]             ^~~~~~
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:16:18: error: stray '\' in program
[   87s]   * Phalcon\Events\EventsAwareInterface
[   87s]                   ^
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:16:12: error: unknown type name 'Events'
[   87s]   * Phalcon\Events\EventsAwareInterface
[   87s]             ^~~~~~
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:29:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'the'
[   87s]   * Sets the events manager
[   87s]          ^~~
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:29:9: error: unknown type name 'the'
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:34:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'the'
[   87s]   * Returns the internal event manager
[   87s]             ^~~
[   87s] /home/abuild/rpmbuild/BUILD/cphalcon-3.2.2/ext/phalcon/events/eventsawareinterface.zep.c:34:12: error: unknown type name 'the'
[   87s] make: *** [Makefile:238: phalcon/events/eventsawareinterface.lo] Error 1

Copied from original issue: phalcon/cphalcon#13076

@sergeyklay
Copy link
Member Author

There is no support yet for PHP 7.2. We'll plan to introduce 7.2 support in the Phalcon 4.0.0.

@sergeyklay
Copy link
Member Author

From @Fisiu on October 11, 2017 15:20

I played around that issue. I build php-zephir-parser, invoked zephir compiler and passed generate option. Once C code has been generated, I tried to compile it and I get errors posted above.

However, if I try to compile extension directly from build/php7/$arch directory → it succeeds.

In both cases I used the same toolchain with gcc 7.2.

@sergeyklay
Copy link
Member Author

Well, as I can see the first version of GCC 7.x was released on May 2, 2017. I did a little research and made sure that most of LTS OS don't use even the 6.x branch. I'm sorry, but I want to close this issue for now. There are several reasons for this:

  • This issue is related to Zephir not Phalcon
  • It would be rash right now to waste time to solve this (not trivial) problem
  • Users always can have multiple versions of the compiler - it is not hard to install one more GCC (for example 5.x)

I'd like to add support for anything/everything at some point, but keeping the issue open doesn't help that. If anyone wants to get started, I'd love that.

Thank you for contributing

@sergeyklay
Copy link
Member Author

@Fisiu Could you provide re2c --version output

@Fisiu
Copy link

Fisiu commented Oct 27, 2017

@sergeyklay
re2c-1.0.2

@sergeyklay
Copy link
Member Author

sergeyklay commented Oct 27, 2017

Gotcha! 😄
Try downgrade re2c.

For example:

$ re2c --version
re2c 0.16

sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Don't concatenate result output in tests to avoid confusion.

Correct parser output for the following text:
```
/**
 * Comment
 */
```

is:

```
/**
 * Comment
 *
```

Related issues:

* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140
sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Don't concatenate result output with "/" in tests
to avoid confusion. Correct parser output for the
following text:

  /**
   * Comment
   */

is:

  **
  * Comment
  *

Related issues:

* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140

8ae4b82
sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Actually this is temporary workaround to be able try latest changes
of re2c >= 1.x.

Related issues:

* skvadrik/re2c#197
* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140
@sergeyklay
Copy link
Member Author

@Fisiu I've prepared a patch for Zephir Parser to work with re2c >= 1.0. Could you please reinstall Zephir Parser from development branch?

@sergeyklay
Copy link
Member Author

Fixed in the latest stable release of Zephir Parser. Feel free to open a new issue if the problem appears again. Thank you for the report, and for helping us make Zephir Parser better.

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