Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565570 - =net-misc/openntpd-5.7_p4-r2 with kernel 3.14 - getentropy_linux.c:203:17: error: '__NR_getrandom' undeclared (first use in this function)
Summary: =net-misc/openntpd-5.7_p4-r2 with kernel 3.14 - getentropy_linux.c:203:17: er...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paul B. Henson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-12 07:38 UTC by Tomáš Mózes
Modified: 2015-12-08 06:00 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,64.79 KB, text/plain)
2015-11-12 07:38 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2015-11-12 07:38:09 UTC
I get this on machines with kernel 3.14, but works on a recent machine with kernel 4.1. Seems like the syscall was added in 3.17.
Comment 1 Tomáš Mózes 2015-11-12 07:38:33 UTC
Created attachment 416758 [details]
build.log
Comment 2 Tomáš Mózes 2015-11-12 07:39:14 UTC
Portage 2.2.20.1 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.21-r1, 3.14.57-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.14.57-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2687W_v3_@_3.10GHz-with-gentoo-2.2
KiB Mem:     5003600 total,   3552388 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 12 Nov 2015 06:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.14::hydra (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/ http://gentoo.wheel.sk/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv mmx mmxext modules multilib ncurses nptl openmp pam pcre readline seccomp session sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

net-misc/openntpd-4.0_pre20080406::gentoo was built with the following:
USE="ssl (-selinux)" ABI_X86="64"
Comment 3 Tomáš Mózes 2015-11-12 08:36:23 UTC
This is a problem of linux-headers, see https://bugs.gentoo.org/show_bug.cgi?id=561418.
Comment 4 Tomáš Mózes 2015-11-13 06:22:42 UTC
According to Vapier, this is a bug in openntpd. Can you please Vapier help us defining the exact problem so we can bring this upstream?
Comment 5 SpanKY gentoo-dev 2015-11-13 06:41:07 UTC
based on the other description, it sounds like you broke your install

you did:
- install linux-headers-3.17+
- built glibc (which used the 3.17+ defs)
- downgraded linux-headers to 3.14
- glibc, assuming 3.17+ defs, has SYS_getrandom which refers to __NR_getrandom which no longer exists

don't downgrade your kernel headers and things work fine
Comment 6 Tomáš Mózes 2015-11-13 08:41:06 UTC
(In reply to SpanKY from comment #5)

I haven't installed linux-headers-3.17+, they were included in stage3. So you are saying I'm forced to use only kernels 3.17+ when installing new machines?
Comment 7 SpanKY gentoo-dev 2015-11-13 22:46:17 UTC
(In reply to Tomas Mozes from comment #6)

no, just the headers.  don't downgrade.  if you do, you can figure out how to do so safely (like rebuilding glibc by hand).
Comment 8 Tomáš Mózes 2015-11-14 19:57:57 UTC
(In reply to SpanKY from comment #7)

This doesn't make sense. Since stage3 was built with headers 3.18 (latest stable), when I boot a new machine with kernel 3.14, openntpd will fail to build because it will think I have getrandom() as glibc was built using headers 3.18. There is no difference if I install headers 3.14 or not.

Shouldn't we keep older headers and compile stage3 with the lowest supported kernel's headers to avoid these situations?
Comment 9 SpanKY gentoo-dev 2015-11-15 08:53:40 UTC
(In reply to Tomas Mozes from comment #8)

no, it won't.  it's fairly trivial to check:
(1) download the stage3
(2) unpack it
(3) chroot into it
(4) emerge openntpd
(5) see it build just fine

the error is that you manually downgraded your kernel headers before you built openntpd thus breaking your glibc.  your emerge info shows this clearly.

the active running kernel is entirely irrelevant.  openntpd does not do a runtime check to see if the getrandom syscall exists ... it checks to see if SYS_getrandom is defined.  since glibc is built against new enough headers, it is defined, and everything works.

any further details are already in bug 561418.
Comment 10 Tomáš Mózes 2015-12-08 06:00:39 UTC
Yes, it works as you say. Thanks for the explanation, appreciated!