With -Wstrict-aliasing=2 we get the following warning:
libkmod/libkmod-signature.c:124:20: note: in expansion of macro 'get_unaligned'
sig_len = be32toh(get_unaligned(&modsig->sig_len));
However there's nothing wrong with it. modsig->sig_len is uint32_t and
get_unaligned in this case returns uint32_t. There's notstrict aliasing
violation.
Same reason as found in this commit to systemd:
commit 4ca39b280fce3c60d2fdecbd478fd9bf7f9d3e64
Author: Mike Gilbert <floppym@gentoo.org>
Date: Sun Feb 23 11:21:13 2014 -0500
configure: Do not require xsltproc for installation of man pages
The release tarballs ship with pre-generated man pages, so we do not
need xsltproc for a typical end-user build.
Developers will probably have xsltproc anyway, but if not they will now
encounter a build-time failure instead of an error in configure.
This allows make rules for generated build files (i.e. configure,
Makefile.in, ... ) to be skipped. This is useful when
the source is stored without timestamps (for example in CVS or GIT).
When the build rules trigger to regenerate the build files, it tries to
use the same autotools version (currently 1.14) as was originally used
for the release. Since many of our build machines run Debian Squeeze,
they only have autotools 1.11 available and the build fails.
Currently, we have to work around this by touching all the generated
files before building to avoid triggering the make rule. With this
patch, we would be able to just run configure with
--disable-maintainer-mode instead. The patch sets the default to enable
to not change the default behavior.
It's used in so many places without checking, that's really pointless to
check for it in macro.h.
Also remove AC_C_TYPEOF from configure.ac since we don't use -ansi.
Commit 8efede20ef ("Use _Static_assert") introduced the usage of
_Static_assert(). However, _Static_assert() is a fairly new thing,
since it was introduced only in gcc 4.6. In order to support older
compilers, this patch adds a configure.in test that checks whether
_Static_assert() is usable or not, and adjust the behavior of the
assert_cc() macro accordingly.
Do the same as done in systemd by Cristian Rodríguez
<crrodriguez@opensuse.org>. We use private symbols, not namespaced. So
don't pretend we support static linking.
Check for finit_module() and don't use our own static inline function if
there's such function in libc (or another lib).
In testsuite we need to unconditionally define HAVE_FINIT_MODULE because
we want to override this function, and never use the static inline one
in missing.h
"The secure_getenv() function is intended for use in general-purpose
libraries to avoid vulnerabilities that could occur if set-user-ID or
set-group-ID programs accidentally trusted the environment."
When a module is being loaded directly from disk (no compression, etc),
pass the file descriptor to the new finit_module() syscall. If the
finit_module syscall is exported by the kernel syscall headers, use it.
Additionally, if the kernel's module.h file is available, map kmod flags
to finit_module flags.
Before this commit the build system failed at late state with
non-helpful message when xsltproc was not available.
Making all in man
GEN depmod.d.5
/bin/sh: --nonet: command not found
make[2]: *** [depmod.d.5] Error 127
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This is a broken option that only leads to misery and incompatabilities
with other systems. Kbuild doesn't come close to supporting directories
other than /lib/modules with several targets simply failing without
hacky fixes. Simply remove the option and all traces of it, as it
doesn't make sense in today's world.
1) Embedded systems often don't want man pages on the
target; rather than pointlessly building them, then ignoring
the result, allow just not building them at all
2) When bootstrapping an operating systems, documentation is the
source of many cyclical dependencies, and allowing it to
be explicitly disabled is useful for earlier build passes.
These variables are supposed to be set by user. What we can do in
configure is to set another variable and AC_SUBST() it. Then in
Makefile.am we assign it to AM_{CFLAGS,LDFLAGS}. This way user can
always override their values, in configure or make phase.
Reference: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
On the ARM gcc 4.2.2 I'm using I get many
"--as-needed: linker input file unused because linking not done"
style errors when libtool is using compile mode.
In order to silence these warnings and be "correct", the flags that
only make sense for linking were moved into LDFLAGS.
Not all libc's have a mtim member in struct stat (dietlibc doesn't).
Change ts_usec() to receive a struct stat as parameter and implement it
accordingly for both cases.
Current limitation is horrible no support to sections: we have to to
have separate header files or to maintain the libkmod-sections.txt file.
We are doing the latter.
build: explicitly call PKG_PROG_PKG_CONFIG
Per the manual page, PKG_PROG_PKG_CONFIG needs to be invoked
explicitly if PKG_CHECK_MODULES might not happen (it is indeed stowed
in an AS_IF in kmod). Without this, funny failures can occur.
(As it did.)