ლ(ಠ益ಠლ)

Gentoo: Sys-fs/udev-216 Update Failure

Updating a Gentoo server that hasn’t seen updates in a long while–during an update operation, it pulled in udev, which eventually errored out:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cc1: warning: unrecognized command line option "-Wno-typedef-redefinition"
Makefile:15334: recipe for target 'src/libudev/libudev_la-libudev.lo' failed
make: *** [src/libudev/libudev_la-libudev.lo] Error 1
At top level:
cc1: warning: unrecognized command line option "-Wno-typedef-redefinition"
Makefile:15355: recipe for target 'src/libudev/libudev_la-libudev-device.lo' failed
make: *** [src/libudev/libudev_la-libudev-device.lo] Error 1
cc1: warning: unrecognized command line option "-Wno-typedef-redefinition"
Makefile:13640: recipe for target 'src/libsystemd/sd-bus/libsystemd_internal_la-sd-bus.lo' failed
make: *** [src/libsystemd/sd-bus/libsystemd_internal_la-sd-bus.lo] Error 1
 [31;01m*[0m ERROR: sys-fs/udev-216::gentoo failed (compile phase):
 [31;01m*[0m   emake failed
 [31;01m*[0m 
 [31;01m*[0m If you need support, post the output of `emerge --info '=sys-fs/udev-216::gentoo'`,
 [31;01m*[0m the complete build log and the output of `emerge -pqv '=sys-fs/udev-216::gentoo'`.
 [31;01m*[0m The complete build log is located at '/var/tmp/portage/sys-fs/udev-216/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/sys-fs/udev-216/temp/environment'.
 [31;01m*[0m Working directory: '/var/tmp/portage/sys-fs/udev-216/work/systemd-216-abi_x86_64.amd64'
 [31;01m*[0m S: '/var/tmp/portage/sys-fs/udev-216/work/systemd-216'

Typically, this indicates an issue with gcc.

1
2
3
 ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-4.5.4 *
 [2] x86_64-pc-linux-gnu-4.8.3

Indeed, our gcc version is locked to an older release–it’s highly recommended to switch to the newer version:

1
2
3
4
5
6
7
8
~ # gcc-config 2
 * Switching native-compiler to x86_64-pc-linux-gnu-4.8.3 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                                                                                                                                [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

Per the Gentoo documentation, it’s best practices to one-shot libtool–let’s do it:

1
$ emerge -av --oneshot libtool

Remove the old version we no longer need:

1
$ emerge -C =sys-devel/gcc-4.4.5

You should now be able to successfully merge udev–recommend doing the following so blocks pertaining to lvm and/or pciutils are suppressed:

1
$ emerge -av --newuse --deep --update @world

Comments