Giter VIP home page Giter VIP logo

Comments (11)

fishilico avatar fishilico commented on July 23, 2024

Hello, did you install package ustr or ustr-selinux on your system? https://www.archlinux.org/packages/community/x86_64/ustr/ indicates it provides /usr/include/ustr.h.

By the way, ustr-selinux is a package that I made with custom patches because the packaged ustr library was not usable with the latest gcc the last time I checked (c.f. https://bugs.archlinux.org/task/46445)

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

Thank you for the detailed response.
Will try again, as the package was missing.
Also, it seems that the BUG has been fixed according to the comment: https://bugs.archlinux.org/task/46445#comment145457

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

Installed ustr-selinux but got the same error as in the bug:

collect2: error: ld returned 1 exit status
Makefile:95: recipe for target 'libsemanage.so.1' failed
make[2]: *** [libsemanage.so.1] Error 1

Both ustr and ustr-selinux give same linker errors as in bug you mentioned, (multiple definition ... first defined et cetera)

from selinux.

fishilico avatar fishilico commented on July 23, 2024

Did you run make clean between two build attempts?

By the way, even if https://bugs.archlinux.org/task/46445#comment145457 claims the bug is fixed, ustr package is still broken and I have not seen the patches which fix the bug in http://www.and.org/ustr/ustr.git .

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

I installed first ustr-selinux with yaourt from AUR, then removed package and installed ustr from Arch packages.
Yes, I realized that, as I cloned git from there and still had issues

from selinux.

fishilico avatar fishilico commented on July 23, 2024

I did not understand your last comment and I managed to build the project in a Docker container, using ustr-selinux. Which system configuration are you using? (CPU, up-to-date Arch system, testing repositories?)

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

I am using Arch (bbqlinux Gnome build), up-to-date, no testing repos, Intel® Core™ i7-5500U CPU
I tried to build selinux after installing ustr-selinux through Yaourt, but it did not build. I will try again.

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

The error I get after installing ustr-selinux from AUR:

In file included from /usr/include/ustr.h:16:0,
                 from utilities.c:29:
/usr/include/ustr-cmp.h:144:24: error: ‘ustr_cmp_case_suffix_buf_eq’ used but never defined [-Werror]
 USTR_CONF_EI_PROTO int ustr_cmp_case_suffix_buf_eq(const struct Ustr *,
                        ^
cc1: all warnings being treated as errors
Makefile:113: recipe for target 'utilities.o' failed
make[2]: *** [utilities.o] Error 1

from selinux.

fishilico avatar fishilico commented on July 23, 2024

Indeed, I am using some patches on my system to build the project with clang and many compiler flags (for extra warnings, address sanitizer, etc.), and I forgot I added a few months ago on the first line of libsemanage/src/Makefile:

utilities.o utilities.lo genhomedircon.o genhomedircon.lo: CFLAGS += -Wno-error

... to ignore warnings generated by ustr. Moreover I changed PYTHON ?= python to PYTHON ?= python2 in policycoreutils/sepolicy/Makefile. I hope this can help you solve the issues you have.

from selinux.

rancidfrog avatar rancidfrog commented on July 23, 2024

Adding changes to libsemanage makefiles fixed that particular issue,
but now it results in new error:

make -C test
make[2]: Entering directory '/../selinux-master/checkpolicy/test'
cc -g -Wall -W -Werror -O2 -pipe -I/../seOBJ/usr/include   -c -o dispol.o dispol.c
cc   dispol.o  -lfl /../seOBJ/usr/lib/libsepol.a -L/../seOBJ/usr/lib -o dispol
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'dispol' failed
make[2]: *** [dispol] Error 1

Replacing "-lfl" in checkpolicy/test makefile with direct reference to "seOBJ/usr/lib//libsepol.a" results again with a new error:

make[1]: Entering directory '/../selinux-master/secilc'
cc -Wall -Wshadow -Wextra -Wundef -Wmissing-format-attribute -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wunused -I/../seOBJ/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64   -c -o secilc.o secilc.c
cc -Wall -Wshadow -Wextra -Wundef -Wmissing-format-attribute -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wunused -I/../seOBJ/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o secilc secilc.o  -lsepol -L/../seOBJ/usr/lib
xmlto man secilc.8.xml
make[1]: xmlto: Command not found
Makefile:29: recipe for target 'man' failed
make[1]: *** [man] Error 127

Thank you for your time.
Seems like a hassle to compile directly.

from selinux.

fishilico avatar fishilico commented on July 23, 2024

To build secilc you need to install xmlto, docbook-xml and docbook-xsl, as it specified in the PKGBUILD of the AUR package (https://github.com/archlinuxhardened/selinux/blob/master/secilc/PKGBUILD).

from selinux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.