Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC

Bug 533238

Summary: net-misc/ntp-4.2.8 - ../libntp/libntp.a(ntp_crypto_rnd.o): In function `ntp_crypto_random_buf': ntp_crypto_rnd.c:(.text.ntp_crypto_random_buf+0x7): undefined reference to `arc4random_buf'
Product: Gentoo Linux Reporter: Thomas Deutschmann <whissi>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 533076    
Attachments: net-misc_ntp-4.2.8_20141221-232351.log

Description Thomas Deutschmann gentoo-dev Security 2014-12-21 23:37:29 UTC
Created attachment 392206 [details]
net-misc_ntp-4.2.8_20141221-232351.log

Hi,

building net-misc/ntp-4.2.8 is failing:

[...]
env CSET=`cat ../sntp/scm-rev` ../scripts/build/mkver ntp-keygen
Version <ntp-keygen 4.2.8@1.3265 Sun Dec 21 23:24:31 UTC 2014 (1)>
env CCACHE_DISABLE=1 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I../include -I../lib/isc/include -I../lib/isc/pthreads/include -I../lib/isc/unix/include -I../sntp/libopts  -D_GNU_SOURCE -ffunction-sections -fdata-sections -Wall -Wcast-align -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Winit-self -Wstrict-overflow   -Wstrict-prototypes -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -c version.c -o version.o
  CCLD   ntptime
  CCLD   ntp-keygen
  CCLD   tickadj
../libntp/libntp.a(ntp_crypto_rnd.o): In function `ntp_crypto_random_buf':
ntp_crypto_rnd.c:(.text.ntp_crypto_random_buf+0x7): undefined reference to `arc4random_buf'
collect2: error: ld returned 1 exit status
Makefile:740: recipe for target 'ntp-keygen' failed
make[3]: *** [ntp-keygen] Error 1
make[3]: *** Waiting for unfinished jobs....
config.status: creating ntp-keygen.1+
mv ntp-keygen.1+ ntp-keygen.1
make[3]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8/work/ntp-4.2.8/util'
Makefile:558: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8/work/ntp-4.2.8/util'
Makefile:549: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8/work/ntp-4.2.8'
Makefile:478: recipe for target 'all' failed
make: *** [all] Error 2




# emerge --info                                                                                                                                                      [261/261]
Portage 2.2.15 (python 3.4.2-final-0, default/linux/amd64/13.0, gcc-4.8.3, glibc-2.20, 3.18.1-gentoo x86_64)
=================================================================
System uname: Linux-3.18.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:     4038300 total,   2900872 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of tree: Sun, 21 Dec 2014 22:45:01 +0000
sh bash 4.3_p30-r1
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.3_p30-r1
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.6
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.4
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
ARCH="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-s
ize=64 --param l2-cache-size=8192 -mtune=generic"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-activ
e/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line
-size=64 --param l2-cache-size=8192 -mtune=generic"
DEFAULT_ABI="amd64"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--quiet-build=n --verbose --buildpkg-exclude 'virtual/* net-firewall/xtables-addons'"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-
libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
LANG="en_US.UTF-8"
LC_MESSAGES="C"
LC_NUMERIC="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x32="-m elf32_x86_64"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSCOLOR="yes"
MAKEOPTS="--jobs 6"
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2014-12-22 10:33:00 UTC
Does it build for you if you enable ssl? I wonder if we miss an optional libbsd dependency for USE="-ssl" cases.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2014-12-22 11:22:21 UTC
hmm I think this is a bug in the upstream code itself.

This function is used when not using USE="-ssl", and nothing in the build system currently checks for the availability of that function (especially when --disable-local-libevent) is passed. Even with --enable-local-libevent used, it does not seem to make any difference.
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2014-12-22 11:23:45 UTC
How about this patch?

http://bk1.ntp.org/ntp-stable/?PAGE=patch&REV=5497b345z5MNTuNvJWuqPSje25NQTg
Comment 4 Thomas Deutschmann gentoo-dev Security 2014-12-22 12:14:23 UTC
Hi,

net-misc/ntp-4.2.8-r1[caps,ipv6] is still failing.

net-misc/ntp-4.2.8-r1[caps,ipv6,ssl] succeeded. So it is just building without SSL which is broken.

I applied the patch set from your link, but is still doesn't build without SSL (patch seems to be incomplete):

../libntp/libntp.a(ntp_crypto_rnd.o): In function `ntp_crypto_random_buf':
ntp_crypto_rnd.c:(.text.ntp_crypto_random_buf+0x5): undefined reference to `evutil_secure_rng_get_bytes'
collect2: error: ld returned 1 exit status
Makefile:740: recipe for target 'ntp-keygen' failed
make[3]: *** [ntp-keygen] Error 1
make[3]: *** Waiting for unfinished jobs....
config.status: creating ntp-keygen.1+
mv ntp-keygen.1+ ntp-keygen.1
make[3]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8-r1/work/ntp-4.2.8/util'
Makefile:558: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8-r1/work/ntp-4.2.8/util'
Makefile:549: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-misc/ntp-4.2.8-r1/work/ntp-4.2.8'
Makefile:478: recipe for target 'all' failed
make: *** [all] Error 2
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2014-12-22 14:46:05 UTC
please read my last comment. It's USE="-ssl" that's failing. We need to put some effort to backport the upstream patch or wait for 4.2.8p1 or something
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2014-12-22 15:04:57 UTC
Should be ok now. Sync in an hour to get the updated ebuild. Thanks for the report

+  22 Dec 2014; Markos Chandras <hwoarang@gentoo.org>
+  +files/ntp-4.2.8-ntp-keygen-no-openssl.patch, ntp-4.2.8-r1.ebuild:
+  Backport upstream patch to allow ntp-keygen building with USE=-ssl.
+