Date: Sat, 15 May 2010 20:07:03 +0200 From: "no@spam@mgedv.net" <nospam@mgedv.net> To: <naddy@FreeBSD.org> Cc: freebsd-hackers@freebsd.org, freebsd-ports-bugs@freebsd.org Subject: openntpd port for freebsd8: removal of custom arc4random_uniform Message-ID: <FECF6B775DC14635BA03128FA50D81A9@vstandard.lan>
next in thread | raw e-mail | index | archive | help
hi naddy, i'm not sure whether this is relevant or not, but: in the openntpd-4.6 port there's a file called arc4random.c, which gets involved during compilation and linking of openntpd: static linking fails because the function arc4random_uniform (which did not exist on 7.2-RELEASE) is delivered by the OS-libs: compile:/data/compile/compile/openntpd-4.6# make cc -O2 -pipe -Wall -I/data/compile/compile/openntpd-4.6 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector -o ntpd ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o parse.o config.o server.o client.o util.o ntp_dns.o adjfreq.o arc4random.o -lmd /usr/lib/libc.a(arc4random.o)(.text+0x3f0): In function `arc4random_uniform': : multiple definition of `arc4random_uniform' arc4random.o(.text+0x0): first defined here *** Error code 1 Stop in /data/compile/compile/openntpd-4.6. i tried removing the arc4random.c file from the Makefile and compiled openntpd static without any problems: cc -O2 -pipe -Wall -I/data/compile/compile/openntpd-4.6 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector -o ntpd ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o parse.o config.o server.o client.o util.o ntp_dns.o adjfreq.o -lmd compile:/data/compile/compile/openntpd-4.6# file ntpd ntpd: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, for FreeBSD 8.0 (800107), not stripped my patch looks as follows: --- Makefile.orig 2010-05-15 17:53:31.000000000 +0200 +++ Makefile 2010-05-15 18:02:49.000000000 +0200 @@ -2,7 +2,7 @@ PROG= ntpd SRCS= ntpd.c buffer.c log.c imsg.c ntp.c ntp_msg.c parse.y config.c \ - server.c client.c util.c ntp_dns.c adjfreq.c arc4random.c + server.c client.c util.c ntp_dns.c adjfreq.c CFLAGS+= -Wall -I${.CURDIR} CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes CFLAGS+= -Wmissing-declarations (tested on FREEBSD 8.0-RELEASE) cheers. ps: don't directly reply to me, post to the lists.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FECF6B775DC14635BA03128FA50D81A9>