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

compiling with musl on Alpine Linux #957

Closed
commandline-be opened this issue Jan 14, 2018 · 2 comments
Closed

compiling with musl on Alpine Linux #957

commandline-be opened this issue Jan 14, 2018 · 2 comments
Labels
stale An issue or a PR became old enough for us to realize that nobody actually cares about it.

Comments

@commandline-be
Copy link

commandline-be commented Jan 14, 2018

Building openscap.git on Alpine Linux 3.7 does not work well, i assume this may be because of missing libraries or ... musl

required to do before starting compilation

apk add dbus-dev libacl libcap-dev curl-dev libgcrypt-dev libxml2-dev libxslt-dev make openldap-dev pcre-dev perl-xml-parser perl-dev python-dev swig bzip2-dev util-linux-dev dpkg-dev gconf-dev attr-dev wget lua which procps build-base cmake python3-dev

to avoid some warnings to pop up

prepending on the first line of the Makefile.am listed below
AUTOMAKE_OPTIONS = subdir-objects
to the various Makefile.am resolves any warning regarding

Makefile.am:AUTOMAKE_OPTIONS = subdir-objects
src/OVAL/Makefile.am:AUTOMAKE_OPTIONS = subdir-objects
src/OVAL/probes/Makefile.am:AUTOMAKE_OPTIONS = subdir-objects
src/OVAL/probes/SEAP/Makefile.am:AUTOMAKE_OPTIONS= subdir-objects
src/OVAL/probes/SEAP/generic/rbt/Makefile.am:AUTOMAKE_OPTIONS= subdir-objects
tests/oscap_string/Makefile.am:AUTOMAKE_OPTIONS = subdir-objects
tests/API/XCCDF/unittests/Makefile.am:AUTOMAKE_OPTIONS = subdir-objects

next

./autogen.sh

next

./configure --enable-python3

next

make

results in a slew of notifications starting with

make[4]: Entering directory '/usr/src/openscap/lib'
  CC       xsize.lo
  CC       asnprintf.lo
  CC       printf-args.lo
  CC       printf-parse.lo
  CC       vasnprintf.lo
In file included from asnprintf.c:20:0:
vasnprintf.h:66:5: warning: "REPLACE_VASNPRINTF" is not defined [-Wundef]
 #if REPLACE_VASNPRINTF
     ^~~~~~~~~~~~~~~~~~
vasnprintf.c:62:6: warning: "WIDE_CHAR_VERSION" is not defined [-Wundef]
 # if WIDE_CHAR_VERSION
      ^~~~~~~~~~~~~~~~~
In file included from vasnprintf.c:65:0:
vasnprintf.h:66:5: warning: "REPLACE_VASNPRINTF" is not defined [-Wundef]
 #if REPLACE_VASNPRINTF
     ^~~~~~~~~~~~~~~~~~
vasnprintf.c:76:5: warning: "HAVE_NL_LANGINFO" is not defined [-Wundef]
 #if HAVE_NL_LANGINFO
     ^~~~~~~~~~~~~~~~
vasnprintf.c:80:6: warning: "WIDE_CHAR_VERSION" is not defined [-Wundef]
 # if WIDE_CHAR_VERSION
      ^~~~~~~~~~~~~~~~~
In file included from printf-parse.h:29:0,
                 from vasnprintf.c:83:
printf-args.h:82:5: warning: "ENABLE_UNISTDIO" is not defined [-Wundef]
 #if ENABLE_UNISTDIO
     ^~~~~~~~~~~~~~~
printf-args.h:127:5: warning: "ENABLE_UNISTDIO" is not defined [-Wundef]
 #if ENABLE_UNISTDIO
     ^~~~~~~~~~~~~~~
In file included from vasnprintf.c:83:0:
printf-parse.h:39:5: warning: "__GLIBC__" is not defined [-Wundef]
 #if __GLIBC__ >= 2 && !defined __UCLIBC__

**_.... eventually ending in ...._**

make[3]: Entering directory '/usr/src/openscap/src/common'
  CC       liboscapcommon_la-debug.lo
debug.c: In function 'oscap_set_verbose':
debug.c:103:8: warning: implicit declaration of function 'open' [-Wimplicit-function-declaration]
   fd = open(filename, O_APPEND | O_WRONLY);
        ^~~~
debug.c:103:23: error: 'O_APPEND' undeclared (first use in this function)
   fd = open(filename, O_APPEND | O_WRONLY);
                       ^~~~~~~~
debug.c:103:23: note: each undeclared identifier is reported only once for each function it appears in
debug.c:103:34: error: 'O_WRONLY' undeclared (first use in this function)
   fd = open(filename, O_APPEND | O_WRONLY);
                                  ^~~~~~~~
debug.c:113:34: error: 'O_CREAT' undeclared (first use in this function)
   fd = open(filename, O_APPEND | O_CREAT | O_TRUNC | O_WRONLY,
                                  ^~~~~~~
debug.c:113:44: error: 'O_TRUNC' undeclared (first use in this function)
   fd = open(filename, O_APPEND | O_CREAT | O_TRUNC | O_WRONLY,
                                            ^~~~~~~
debug.c:114:4: error: 'S_IRUSR' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    ^~~~~~~
debug.c:114:14: error: 'S_IWUSR' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
              ^~~~~~~
debug.c:114:24: error: 'S_IRGRP' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                        ^~~~~~~
debug.c:114:34: error: 'S_IWGRP' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                                  ^~~~~~~
debug.c:114:44: error: 'S_IROTH' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                                            ^~~~~~~
debug.c:114:54: error: 'S_IWOTH' undeclared (first use in this function)
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                                                      ^~~~~~~
debug.c: In function 'debug_message_devel_metadata':
debug.c:192:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   (unsigned long long) thread, f, line, fn);

make[3]: *** [Makefile:1127: liboscapcommon_la-debug.lo] Error 1
make[3]: Leaving directory '/usr/src/openscap/src/common'
make[2]: *** [Makefile:1146: all-recursive] Error 1
make[2]: Leaving directory '/usr/src/openscap/src'
make[1]: *** [Makefile:1285: all-recursive] Error 1
make[1]: Leaving directory '/usr/src/openscap'
make: *** [Makefile:1094: all] Error 2


@fcolista
Copy link

openscap is now available in testing repository of Alpine Linux:
https://pkgs.alpinelinux.org/package/edge/testing/x86_64/openscap

You can check the APKBUILD to see how the compilation has been done succesfully:
https://git.alpinelinux.org/aports/plain/testing/openscap/APKBUILD?id=79deec876eec167af1c28c40d63eff9afa1def97

.: Francesco

@shawndwells
Copy link
Member

Neat! There are others who may be interested in this (@openprivacy).

Any plans to also author content?

@evgenyz evgenyz added the stale An issue or a PR became old enough for us to realize that nobody actually cares about it. label Feb 9, 2024
@evgenyz evgenyz closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale An issue or a PR became old enough for us to realize that nobody actually cares about it.
Projects
None yet
Development

No branches or pull requests

4 participants