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

libselinux doesn't cross-compile for armv6/7 #107578

Closed
flokli opened this issue Dec 25, 2020 · 3 comments
Closed

libselinux doesn't cross-compile for armv6/7 #107578

flokli opened this issue Dec 25, 2020 · 3 comments
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@flokli
Copy link
Contributor

flokli commented Dec 25, 2020

When cross-compiling NixOS, libselinux is needed (due to being a dependency for glib, which is pretty much a requirement).

This currently fails to cross-compile for 32 bit platforms

To Reproduce

nix-build -A pkgsCross.armv7l-hf-multiplatform.libselinux

armv7l-unknown-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wbuiltin-macro-redefined -Wattributes -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral -Wframe-larger-than=32768 -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -Werror -Wno-aggregate-return -Wno-redundant-decls -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wstrict-overflow=5 -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -I/nix/store/i2frrm3qv2bd2yzj6zxrnnj76283x621-pcre-8.44-armv7l-unknown-linux-gnueabihf-dev/include -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations -fPIC -I../include -I/nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8 -c selinuxswig_python_wrap.c -o build/temp.linux-x86_64-3.8/selinuxswig_python_wrap.o
In file included from /nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/Python.h:63,
                 from selinuxswig_python_wrap.c:149:
/nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/pyport.h:726:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  726 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
      |  ^~~~~
In file included from /nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/abstract.h:837,
                 from /nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/Python.h:147,
                 from selinuxswig_python_wrap.c:149:
/nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/cpython/abstract.h: In function ‘_PyVectorcall_Function’:
/nix/store/m7080pw0ryjk0jhljp55rq1hd2qy8gki-python3-3.8.6/include/python3.8/cpython/abstract.h:91:11: warning: cast increases required alignment of target type [-Wcast-align]
   91 |     ptr = (vectorcallfunc*)(((char *)callable) + offset);
      |           ^
selinuxswig_python_wrap.c: At top level:
selinuxswig_python_wrap.c:1819:23: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1819 |   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
      |                       ^
selinuxswig_python_wrap.c:1820:23: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1820 |   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
      |                       ^
selinuxswig_python_wrap.c:1823:23: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1823 |   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
      |                       ^
selinuxswig_python_wrap.c:1824:23: warning: cast between incompatible function types from ‘PyObject * (*)(SwigPyObject *)’ {aka ‘struct _object * (*)(struct <anonymous> *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1824 |   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
      |                       ^
error: command 'armv7l-unknown-linux-gnueabihf-gcc' failed with exit status 1
make[1]: *** [Makefile:133: pywrap] Error 1
make[1]: Leaving directory '/build/libselinux-3.0/src'
make: *** [Makefile:58: install-pywrap] Error 2
builder for '/nix/store/qhqdys32z1cpria0w8pnr8dvcysj3g49-libselinux-3.0-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2

Related: #106759

cc @Ericson2314 @Atemu @matthewbauer

@flokli flokli added 0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on labels Dec 25, 2020
@Atemu
Copy link
Member

Atemu commented Dec 25, 2020

As noted in #106759, this is fixed by #98915.

@flokli
Copy link
Contributor Author

flokli commented Dec 26, 2020

Right, thanks for the pointer!

@flokli
Copy link
Contributor Author

flokli commented Jan 1, 2021

fixed in #98915, closing.

@flokli flokli closed this as completed Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

2 participants