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

Makefile:183: recipe for target 'parser/parser.lo' failed #1142

Closed
valVk opened this issue Dec 9, 2015 · 17 comments
Closed

Makefile:183: recipe for target 'parser/parser.lo' failed #1142

valVk opened this issue Dec 9, 2015 · 17 comments

Comments

@valVk
Copy link

valVk commented Dec 9, 2015

commit c9735cc

Merge: 9029835 712a1a2
Author: Steffen Butzer <[email protected]>
Date:   Sun Dec 6 00:46:17 2015 +0100

    Merge pull request #1141 from steffengy/parser_ext

    feat(parser): Initial implementation of parser as PHP ext
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:        15.04
Codename:       vivid

Linux radxa 3.18.0-rc5+ #2 SMP Fri Nov 28 17:36:47 CST 2014 armv7l armv7l armv7l GNU/Linux

All this gives me an error

....

Makefile:183: recipe for target 'parser/parser.lo' failed

PHP Warning:  copy(modules/zephir_parser.so): failed to open stream: No such file or directory in /home/rock/cphalcon/zephir/Library/Compiler.php on line 251
Zephir\Exception: The zephir parser extension could not be found or compiled!

at Library/Compiler.php(256)
#0 Library/Compiler.php(269): Zephir\Compiler->compileParser()
#1 Library/Compiler.php(328): Zephir\Compiler->preCompile('test/arithmetic...')
#2 Library/Compiler.php(872): Zephir\Compiler->recursivePreCompile('test')
#3 Library/Compiler.php(1076): Zephir\Compiler->generate(Object(Zephir\Commands\CommandCompile))
#4 Library/Commands/CommandAbstract.php(108): Zephir\Compiler->compile(Object(Zephir\Commands\CommandCompile))
#5 Library/Bootstrap.php(200): Zephir\Commands\CommandAbstract->execute(Object(Zephir\Config), Object(Zephir\Logger))
#6 compiler.php(21): Zephir\Bootstrap::boot()
#7 {main}

But phalcon compiled well on exact same configuration

@steffengy
Copy link
Contributor

That output doesn't seem complete, can you post the entire output?
Before Makefile:183: recipe for target 'parser/parser.lo' failed should be some more detailed error output.

@valVk
Copy link
Author

valVk commented Dec 9, 2015

rock@radxa:~/cphalcon/zephir$ ./bin/zephir compile
zephir_parser extension not loaded, compiling it
Parser statistics: 127 terminals, 99 nonterminals, 459 rules
                   947 states, 0 parser table entries, 0 conflicts
make: *** No rule to make target 'clean'.  Stop.
Preparing for parser compilation...
Compiling the parser...
/home/rock/cphalcon/zephir/parser/parser/parser.c: In function 'yy_reduce':
/home/rock/cphalcon/zephir/parser/parser/parser.c:8763:2: warning: passing argument 2 of 'xx_ret_scall' from incompatible pointer type [enabled by default]
  yygotominor.yy132 = xx_ret_scall(0, yymsp[-6].minor.yy0, 1, yymsp[-3].minor.yy0, NULL, status->scanner_state);
  ^
/home/rock/cphalcon/zephir/parser/parser/parser.c:1189:14: note: expected 'char *' but argument is of type 'struct xx_parser_token *'
 static zval *xx_ret_scall(int dynamic_class, char *class_name, int dynamic_method, xx_parser_token *M, zval *parameters, xx_scanner_state *state)
              ^
/home/rock/cphalcon/zephir/parser/parser/parser.c:8775:2: warning: passing argument 2 of 'xx_ret_scall' from incompatible pointer type [enabled by default]
  yygotominor.yy132 = xx_ret_scall(0, yymsp[-7].minor.yy0, 1, yymsp[-4].minor.yy0, yymsp[-1].minor.yy132, status->scanner_state);
  ^
/home/rock/cphalcon/zephir/parser/parser/parser.c:1189:14: note: expected 'char *' but argument is of type 'struct xx_parser_token *'
 static zval *xx_ret_scall(int dynamic_class, char *class_name, int dynamic_method, xx_parser_token *M, zval *parameters, xx_scanner_state *state)
              ^
In file included from /usr/include/string.h:634:0,
                 from /usr/include/php5/main/php_config.h:2525,
                 from /usr/include/php5/main/php.h:34,
                 from /home/rock/cphalcon/zephir/parser/parser/parser.c:9:
/home/rock/cphalcon/zephir/parser/parser/parser.c: At top level:
/home/rock/cphalcon/zephir/parser/parser/parser.c:9257:7: error: expected identifier or '(' before '__extension__'
 char *strndup(const char *s, size_t len)
       ^
/home/rock/cphalcon/zephir/parser/parser/parser.c: In function 'xx_parse_program':
/home/rock/cphalcon/zephir/parser/parser/parser.c:9350:3: warning: return makes pointer from integer without a cast [enabled by default]
   return SUCCESS;
   ^
make: *** [parser/parser.lo] Error 1
make: *** Waiting for unfinished jobs....
/home/rock/cphalcon/zephir/parser/parser/scanner.c: In function 'xx_get_token':
/home/rock/cphalcon/zephir/parser/parser/scanner.c:1274:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
    free(token->value);
    ^

libtool: compile:  gcc -I. -I/home/rock/cphalcon/zephir/parser -DPHP_ATOM_INC -I/home/rock/cphalcon/zephir/parser/include -I/home/rock/cphalcon/zephir/parser/main -I/home/rock/cphalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/rock/cphalcon/zephir/parser/parser/parser.c  -fPIC -DPIC -o parser/.libs/parser.o
libtool: compile:  gcc -I. -I/home/rock/cphalcon/zephir/parser -DPHP_ATOM_INC -I/home/rock/cphalcon/zephir/parser/include -I/home/rock/cphalcon/zephir/parser/main -I/home/rock/cphalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/rock/cphalcon/zephir/parser/zephir_parser.c  -fPIC -DPIC -o .libs/zephir_parser.o
Makefile:183: recipe for target 'parser/parser.lo' failed
libtool: compile:  gcc -I. -I/home/rock/cphalcon/zephir/parser -DPHP_ATOM_INC -I/home/rock/cphalcon/zephir/parser/include -I/home/rock/cphalcon/zephir/parser/main -I/home/rock/cphalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/rock/cphalcon/zephir/parser/parser/scanner.c  -fPIC -DPIC -o parser/.libs/scanner.o

PHP Warning:  copy(modules/zephir_parser.so): failed to open stream: No such file or directory in /home/rock/cphalcon/zephir/Library/Compiler.php on line 251
Zephir\Exception: The zephir parser extension could not be found or compiled!

at Library/Compiler.php(256)
#0 Library/Compiler.php(269): Zephir\Compiler->compileParser()
#1 Library/Compiler.php(328): Zephir\Compiler->preCompile('test/arithmetic...')
#2 Library/Compiler.php(872): Zephir\Compiler->recursivePreCompile('test')
#3 Library/Compiler.php(1076): Zephir\Compiler->generate(Object(Zephir\Commands\CommandCompile))
#4 Library/Commands/CommandAbstract.php(108): Zephir\Compiler->compile(Object(Zephir\Commands\CommandCompile))
#5 Library/Bootstrap.php(200): Zephir\Commands\CommandAbstract->execute(Object(Zephir\Config), Object(Zephir\Logger))
#6 compiler.php(21): Zephir\Bootstrap::boot()
#7 {main}

jfy
this g++-4.8-arm-linux-gnueabihf was used when Phalcon extension was compiled

P.S.
The same version of Zephir was successful compiled at my notebook. But at Radxa Rock plate it fails.

P.P.S I even can provide you an access to my RadxaRock just to try find a reason of that issue.

@steffengy
Copy link
Contributor

@mruz @valVk
Could you please try the latest master?

@valVk
Copy link
Author

valVk commented Dec 14, 2015

@steffengy

From my side:

  • Zephir was compiled.
  • Phalcon was compiled using Zephir.

Thanks. Now you can say for 100% sure that it works even at ARM processors.
I'm using radxa rock pro.

@valVk valVk closed this as completed Dec 14, 2015
@sergeyklay
Copy link
Contributor

👍

@mruz
Copy link
Contributor

mruz commented Dec 14, 2015

But I'm still getting:

 ./vendor/bin/zephir build              
zephir_parser extension not loaded, compiling it
Parser statistics: 127 terminals, 99 nonterminals, 459 rules
                   947 states, 0 parser table entries, 0 conflicts
Preparing for parser compilation...
Compiling the parser...
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c: In function ‘yy_reduce’:
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:8763:38: warning: passing argument 2 of ‘xx_ret_scall’ from incompatible pointer type [-Wincompatible-pointer-types]
  yygotominor.yy132 = xx_ret_scall(0, yymsp[-6].minor.yy0, 1, yymsp[-3].minor.yy0, NULL, status->scanner_state);
                                      ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:1189:14: note: expected ‘char *’ but argument is of type ‘xx_parser_token * {aka struct _xx_parser_token *}’
 static zval *xx_ret_scall(int dynamic_class, char *class_name, int dynamic_method, xx_parser_token *M, zval *parameters, xx_scanner_state *state)
              ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:8775:38: warning: passing argument 2 of ‘xx_ret_scall’ from incompatible pointer type [-Wincompatible-pointer-types]
  yygotominor.yy132 = xx_ret_scall(0, yymsp[-7].minor.yy0, 1, yymsp[-4].minor.yy0, yymsp[-1].minor.yy132, status->scanner_state);
                                      ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:1189:14: note: expected ‘char *’ but argument is of type ‘xx_parser_token * {aka struct _xx_parser_token *}’
 static zval *xx_ret_scall(int dynamic_class, char *class_name, int dynamic_method, xx_parser_token *M, zval *parameters, xx_scanner_state *state)
              ^
In file included from /usr/include/string.h:630:0,
                 from /usr/include/php5/main/../main/php_config.h:2554,
                 from /usr/include/php5/Zend/zend_config.h:1,
                 from /usr/include/php5/Zend/zend.h:51,
                 from /usr/include/php5/main/php.h:35,
                 from /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:9:
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c: At top level:
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:9258:7: error: expected identifier or ‘(’ before ‘__extension__’
 char *strndup(const char *s, size_t len)
       ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c: In function ‘xx_parse_program’:
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:9235:17: warning: return makes pointer from integer without a cast [-Wint-conversion]
 #define SUCCESS 1
                 ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:9352:10: note: in expansion of macro ‘SUCCESS’
   return SUCCESS;
          ^
make: *** [parser/parser.lo] Błąd 1
make: *** Oczekiwanie na niezakończone zadania....
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/scanner.c: In function ‘xx_get_token’:
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/scanner.c:1274:4: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
    free(token->value);
    ^
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/scanner.c:1274:4: warning: incompatible implicit declaration of built-in function ‘free’
/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/scanner.c:1274:4: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’

libtool: compile:  gcc -I. -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -DPHP_ATOM_INC -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/include -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/main -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/zephir_parser.c  -fPIC -DPIC -o .libs/zephir_parser.o
libtool: compile:  gcc -I. -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -DPHP_ATOM_INC -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/include -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/main -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c  -fPIC -DPIC -o parser/.libs/parser.o
libtool: compile:  gcc -I. -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -DPHP_ATOM_INC -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/include -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/main -I/home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/scanner.c  -fPIC -DPIC -o parser/.libs/scanner.o
Makefile:183: polecenia dla obiektu 'parser/parser.lo' nie powiodły się

PHP Warning:  copy(modules/zephir_parser.so): failed to open stream: No such file or directory in /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/Library/Compiler.php on line 251
Zephir\Exception: The zephir parser extension could not be found or compiled!

@valVk
Copy link
Author

valVk commented Dec 14, 2015

@mruz

I've removed all untracked files in the parser directory. Did git checkout . -- and after that I've pulled the latest changes from master.

All this allow me to compile zephir extension and phalcon through zephir.

Also i think will be helpfull if you provide a bit more information about your environment.

Regards.

@mruz
Copy link
Contributor

mruz commented Dec 14, 2015

I've removed whole zephir directory from vendor/ and reinstall by composer.

I'm using openSUSE Tumbleweed 20151201
PHP 5.6.15 (cli)
gcc version 5.2.1 20151008

@valVk
Copy link
Author

valVk commented Dec 14, 2015

Hmmm... did you remove composer.lock? Because this file can freeze version.
Anyway I did git clone from this repository maybe this is the difference.

In my case I've checked this fix at my ARM web server and laptop all looks good.

Regards.

@sergeyklay
Copy link
Contributor

Right now tested on my VPS:

  • Ubuntu 14.04.3
  • PHP 5.6.16
  • gcc 4.8.4

All ok

@mruz
Copy link
Contributor

mruz commented Dec 15, 2015

Hmmm... did you remove composer.lock? Because this file can freeze version.
Anyway I did git clone from this repository maybe this is the difference.

I have:

    "require-dev": {
        "phalcon/zephir": "dev-master"
    },

And I checked that changes 6153090 are present, so this is not the composer fault.

@steffengy
Copy link
Contributor

Does the generated parser.c file contain the changes of 6153090 ? (Search for strndup and check if the ifndef guards are present)

@mruz
Copy link
Contributor

mruz commented Dec 15, 2015

Yes, they are present.

@steffengy
Copy link
Contributor

So just to absolutely clarify: you see the #ifndef HAVE_STRNDUP around /home/mruz/Dropbox/git/ice/framework/vendor/phalcon/zephir/parser/parser/parser.c:9258 ?

@valVk
Copy link
Author

valVk commented Dec 15, 2015

@mruz

Please try do next.

  1. remove all untracked files from repository zephir git clean -f
  2. do git checkout -- .
  3. execute ./zephir/bin compile

I've just checked. That this file parser/parser/parser.c:9258 can be without lines provided by @steffengy

maybe you've executed this command ./zephir/bin compile with sudo and now it's not refresh due to permissions

@mruz
Copy link
Contributor

mruz commented Dec 15, 2015

parser.txt @steffengy exactly. @valVk check :9258 line after ./zephir/bin compile

@mruz
Copy link
Contributor

mruz commented Dec 29, 2015

On the openSUSE I see in the /usr/include/string.h

#if defined __USE_XOPEN2K8
extern char *strndup (const char *__string, size_t __n)
     __THROW __attribute_malloc__ __nonnull ((1));
#endif

So if I add in base.c 6153090

#if !defined HAVE_STRNDUP && !defined __USE_XOPEN2K8

Then I can compile.

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

4 participants