seveas / python-prctl

Wrapping prctl for python

Home Page:http://packages.python.org/python-prctl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails on Raspbian

itayperl opened this issue · comments

Hello,

I'm getting some build errors when installing python-prctl v1.8 on Raspbian. I had no issues with v1.7.

  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c _prctlmodule.c -o build/temp.linux-armv7l-3.7/_prctlmodule.o
  _prctlmodule.c: In function ‘prctl_prctl’:
  _prctlmodule.c:180:54: error: ‘PR_SPEC_INDIRECT_BRANCH’ undeclared (first use in this function); did you mean ‘PR_SPEC_STORE_BYPASS’?
               if(arg != PR_SPEC_STORE_BYPASS && arg != PR_SPEC_INDIRECT_BRANCH) {
                                                        ^~~~~~~~~~~~~~~~~~~~~~~
                                                        PR_SPEC_STORE_BYPASS
  _prctlmodule.c:180:54: note: each undeclared identifier is reported only once for each function it appears in
  _prctlmodule.c: In function ‘PyInit__prctl’:
  _prctlmodule.c:796:19: error: ‘PR_SPEC_INDIRECT_BRANCH’ undeclared (first use in this function); did you mean ‘PR_SPEC_STORE_BYPASS’?
       namedconstant(PR_SPEC_INDIRECT_BRANCH);
                     ^~~~~~~~~~~~~~~~~~~~~~~
  _prctlmodule.c:704:62: note: in definition of macro ‘namedconstant’
   #define namedconstant(x) PyModule_AddIntConstant(_prctl, #x, x)
                                                                ^
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

linux/prctl.h seems to come from linux-libc-dev which is on version 4.18.20-2 in raspbian. Hopefully this can be fixed with a few more ifdefs...

Thanks for the report! Can you try building commit 3c2885b?

This is what I'm getting with 3c2885b:

    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c _prctlmodule.c -o build/temp.linux-armv7l-3.7/_prctlmodule.o
    _prctlmodule.c: In function ‘PyInit__prctl’:
    _prctlmodule.c:804:19: error: ‘PR_SPEC_INDIRECT_BRANCH’ undeclared (first use in this function); did you mean ‘PR_SPEC_STORE_BYPASS’?
         namedconstant(PR_SPEC_INDIRECT_BRANCH);
                       ^~~~~~~~~~~~~~~~~~~~~~~
    _prctlmodule.c:712:62: note: in definition of macro ‘namedconstant’
     #define namedconstant(x) PyModule_AddIntConstant(_prctl, #x, x)
                                                                  ^
    _prctlmodule.c:804:19: note: each undeclared identifier is reported only once for each function it appears in
         namedconstant(PR_SPEC_INDIRECT_BRANCH);
                       ^~~~~~~~~~~~~~~~~~~~~~~
    _prctlmodule.c:712:62: note: in definition of macro ‘namedconstant’
     #define namedconstant(x) PyModule_AddIntConstant(_prctl, #x, x)
                                                                  ^
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

That's getting further 😄

Try 9709940 please

Yup, this one works!

Thanks for the quick response!

Now released as 1.8.1, thank you for the quick responses as well!