Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481020 - sys-apps/kmod-14-r1 - tools/kmod.o: In function `kmod_help': kmod.c:(.text.kmod_help+0x2c): undefined reference to `_Static_assert'
Summary: sys-apps/kmod-14-r1 - tools/kmod.o: In function `kmod_help': kmod.c:(.text.km...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 10:03 UTC by Hans
Modified: 2013-08-24 11:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info '=sys-apps/kmod-14-r1' (emerge.info,4.82 KB, text/plain)
2013-08-14 10:03 UTC, Hans
Details
build.log (build.log,55.66 KB, text/plain)
2013-08-14 10:05 UTC, Hans
Details
Patch adapted from sys-fs/udev (kmod-14-r1.ebuild.patch,625 bytes, patch)
2013-08-15 08:10 UTC, Samuli Suominen (RETIRED)
Details | Diff
build.log with patched ebuild (build.log,55.69 KB, text/x-log)
2013-08-16 06:54 UTC, Hans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans 2013-08-14 10:03:46 UTC
Created attachment 355966 [details]
emerge --info '=sys-apps/kmod-14-r1'

see title
Comment 1 Hans 2013-08-14 10:05:08 UTC
Created attachment 355968 [details]
build.log
Comment 2 Hans 2013-08-14 10:06:59 UTC
The relevant bit from the build.log:


libtool: link: x86_64-pc-linux-gnu-gcc -std=gnu99 -pipe -DANOTHER_BRICK_IN_THE -Wall -W -Wextra -Wno-inline -Wvla -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wnested-externs -Wchar-subscripts -Wtype-limits -Wuninitialized -fno-common -fdiagnostics-show-option -fvisibility=hidden -ffunction-sections -fdata-sections -march=native -pipe -O2 -Wl,--gc-sections -Wl,-O1 -o tools/.libs/kmod tools/kmod.o tools/lsmod.o tools/rmmod.o tools/insmod.o tools/modinfo.o tools/modprobe.o tools/depmod.o tools/log.o tools/static-nodes.o  -Wl,--as-needed libkmod/.libs/libkmod-util.a libkmod/.libs/libkmod.so -L/usr/lib64 -lz
tools/kmod.o: In function `kmod_help':
kmod.c:(.text.kmod_help+0x2c): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0x66): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0x89): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0xc6): undefined reference to `_Static_assert'
tools/kmod.o: In function `main':
kmod.c:(.text.main+0x5b): undefined reference to `_Static_assert'
tools/kmod.o:kmod.c:(.text.main+0x8c): more undefined references to `_Static_assert' follow
collect2: ld returned 1 exit status
tools/kmod.o: In function `kmod_help':
kmod.c:(.text.kmod_help+0x2c): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0x66): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0x89): undefined reference to `_Static_assert'
kmod.c:(.text.kmod_help+0xc6): undefined reference to `_Static_assert'
tools/kmod.o: In function `main':
kmod.c:make[1]: (.*** [tools/test/kmod] Error 1text.main
+0x5b): undefined reference to `_Static_assert'
toolsmake[1]: /*** Waiting for unfinished jobs....kmod.o
:kmod.c:(.text.main+0x8c): more undefined references to `_Static_assert' follow
collect2: ld returned 1 exit status
make[1]: *** [tools/kmod] Error 1
make: *** [install-recursive] Error 1
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-08-15 08:05:39 UTC
Looks like bug 451110, but this time in kmod instead of udev.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2013-08-15 08:10:10 UTC
Created attachment 356056 [details, diff]
Patch adapted from sys-fs/udev

Try this patch with gcc-4.5
Comment 5 Hans 2013-08-16 06:54:34 UTC
Created attachment 356170 [details]
build.log with patched ebuild
Comment 6 Hans 2013-08-16 06:55:40 UTC
Comment on attachment 356170 [details]
build.log with patched ebuild

The ebuild patch fixed the _Static_assert problem, but a new undefined reference appeared:

libtool: link: x86_64-pc-linux-gnu-gcc -std=gnu99 -pipe -DANOTHER_BRICK_IN_THE -Wall -W -Wextra -Wno-inline -Wvla -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wnested-externs -Wchar-subscripts -Wtype-limits -Wuninitialized -fno-common -fdiagnostics-show-option -fvisibility=hidden -ffunction-sections -fdata-sections -march=native -pipe -O2 -Wl,--gc-sections -Wl,-O1 -o tools/.libs/kmod tools/kmod.o tools/lsmod.o tools/rmmod.o tools/insmod.o tools/modinfo.o tools/modprobe.o tools/depmod.o tools/log.o tools/static-nodes.o  -Wl,--as-needed libkmod/.libs/libkmod-util.a libkmod/.libs/libkmod.so -L/usr/lib64 -lz
tools/kmod.o: In function `kmod_help':
kmod.c:(.text.kmod_help+0x2c): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0x66): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0x89): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0xc6): undefined reference to `_alsdjflkasjdfa'
tools/kmod.o: In function `main':
kmod.c:(.text.main+0x5b): undefined reference to `_alsdjflkasjdfa'
tools/kmod.o:kmod.c:(.text.main+0x8c): more undefined references to `_alsdjflkasjdfa' follow
collect2: ld returned 1 exit status
make[1]: *** [tools/test/kmod] Error 1
make[1]: *** Waiting for unfinished jobs....
tools/kmod.o: In function `kmod_help':
kmod.c:(.text.kmod_help+0x2c): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0x66): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0x89): undefined reference to `_alsdjflkasjdfa'
kmod.c:(.text.kmod_help+0xc6): undefined reference to `_alsdjflkasjdfa'
tools/kmod.o: In function `main':
kmod.c:(.text.main+0x5b): undefined reference to `_alsdjflkasjdfa'
tools/kmod.o:kmod.c:(.text.main+0x8c): more undefined references to `_alsdjflkasjdfa' follow
collect2: ld returned 1 exit status
make[1]: *** [tools/kmod] Error 1
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2013-08-16 12:16:15 UTC
Well, current stable sys-devel/gcc is 4.6.3, so that's all we have to support so I'm thinking of:

-- cut --

@@ -6,7 +6,7 @@
 
 VIRTUAL_MODUTILS=1
 
-inherit autotools eutils libtool multilib linux-mod
+inherit autotools eutils libtool multilib linux-mod versionator toolchain-funcs
 
 if [[ ${PV} == 9999 ]]; then
 	EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
@@ -42,6 +42,8 @@
 pkg_setup() {
 	CONFIG_CHECK="~MODULES ~MODULE_UNLOAD"
 	linux-info_pkg_setup
+	version_is_at_least 4.6 $(gcc-version) || \
+		die "At least sys-devel/gcc >= 4.6 is required."
 }
 
 src_prepare() {

-- cut --

Or is there any reason we should be backporting patch to sys-devel/gcc-4.5.x, or is there any reason we even carry a patch for that in sys-fs/udev anymore?
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2013-08-16 12:17:15 UTC
Hans,

# emerge sys-devel/gcc:4.6
# gcc-config -l

And select 4.6

# env-update
# source /etc/profile
Comment 9 Hans 2013-08-16 13:04:53 UTC
libtool: install: /usr/bin/install -c libkmod/.libs/libkmod.so.2.2.4 /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64/libkmod.so.2.2.4
libtool: install: (cd /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64 && { ln -s -f libkmod.so.2.2.4 libkmod.so.2 || { rm -f libkmod.so.2 && ln -s libkmod.so.2.2.4 libkmod.so.2; }; })
libtool: install: (cd /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64 && { ln -s -f libkmod.so.2.2.4 libkmod.so || { rm -f libkmod.so && ln -s libkmod.so.2.2.4 libkmod.so; }; })
libtool: install: /usr/bin/install -c libkmod/.libs/libkmod.lai /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64/libkmod.la
libtool: install: warning: remember to run `libtool --finish /usr/lib64'
 /bin/mkdir -p '/var/tmp/portage/sys-apps/kmod-14-r1/image//bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c tools/kmod '/var/tmp/portage/sys-apps/kmod-14-r1/image//bin'
libtool: install: warning: `libkmod/libkmod.la' has not been installed in `/usr/lib64'
libtool: install: /usr/bin/install -c tools/.libs/kmod /var/tmp/portage/sys-apps/kmod-14-r1/image//bin/kmod
make --no-print-directory install-exec-hook
if test "/usr/lib64" != "/lib64"; then \
	/bin/mkdir -p /var/tmp/portage/sys-apps/kmod-14-r1/image//lib64 && \
	so_img_name=$(readlink /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64/libkmod.so) && \
	so_img_rel_target_prefix=$(echo /usr/lib64 | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
	ln -sf $so_img_rel_target_prefix/lib64/$so_img_name /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64/libkmod.so && \
	mv /var/tmp/portage/sys-apps/kmod-14-r1/image//usr/lib64/libkmod.so.* /var/tmp/portage/sys-apps/kmod-14-r1/image//lib64; \
fi
Making install in libkmod/docs
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in man
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/var/tmp/portage/sys-apps/kmod-14-r1/image//usr/share/man/man5'
 /bin/mkdir -p '/var/tmp/portage/sys-apps/kmod-14-r1/image//usr/share/man/man8'
 /usr/bin/install -c -m 644 depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8 '/var/tmp/portage/sys-apps/kmod-14-r1/image//usr/share/man/man8'
 /usr/bin/install -c -m 644 depmod.d.5 modprobe.d.5 modules.dep.5 modules.dep.bin.5 '/var/tmp/portage/sys-apps/kmod-14-r1/image//usr/share/man/man5'
 * Removing unnecessary /usr/lib64/libkmod.la (no static archive)
!!! doexe: /usr/local/portage/sys-apps/kmod/files/static-nodes does not exist
 * ERROR: sys-apps/kmod-14-r1 failed (install phase):
 *   doexe failed
 *
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-08-16 13:58:21 UTC
$ ls -l /usr/portage/sys-apps/kmod/files/*static-nodes
-rw-r--r-- 1 ssuominen ssuominen 584 Aug  9 22:08 /usr/portage/sys-apps/kmod/files/kmod-static-nodes
-rw-r--r-- 1 ssuominen users     575 Jul 30 20:21 /usr/portage/sys-apps/kmod/files/static-nodes

the file is present here.  but what you should do is upgrade sys-apps/openrc to version 0.12 before emerging sys-apps/kmod 14 or newer.  0.12 of openrc is required for proper static-nodes /dev support kmod needs.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2013-08-16 13:58:57 UTC
(In reply to Hans from comment #9)
> !!! doexe: /usr/local/portage/sys-apps/kmod/files/static-nodes does not exist

you can remove it from your local overlay :P
Comment 12 Hans 2013-08-16 14:37:47 UTC
thanks, it's fixed after setting gcc to 4.6 and removing the local overlay
Comment 13 Peter 2013-08-24 09:06:22 UTC
I had the same issue for several versions of kmod-14. If upgrading through the usual emerge -auv world, kmod-14-Rx is emerged before openrc is upgraded and then fails because of the old openrc version. In my opinion the error is caused by the wrong order of emerging. Possibly not relevant but I use gcc-4.7.3
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2013-08-24 10:33:10 UTC
(In reply to Peter from comment #13)
> I had the same issue for several versions of kmod-14. If upgrading through
> the usual emerge -auv world, kmod-14-Rx is emerged before openrc is upgraded
> and then fails because of the old openrc version. In my opinion the error is
> caused by the wrong order of emerging. Possibly not relevant but I use
> gcc-4.7.3

Sorry, but you have wrong bug, the compile failure from Comment #1 has nothing to do with sys-apps/openrc, emerge order, or -rX revision of kmod
It's about old gcc being selected in gcc-config and `gcc --version` saying the compiler is 4.5 or older
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2013-08-24 11:00:35 UTC
Added check to the ebuild.