From owner-freebsd-hackers@FreeBSD.ORG Sat May 15 18:46:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D83A1065697; Sat, 15 May 2010 18:46:05 +0000 (UTC) (envelope-from nospam@mgedv.net) Received: from mail.mgedv.net (mail.mgedv.net [213.229.1.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4388FC1F; Sat, 15 May 2010 18:46:05 +0000 (UTC) Received: from my.loop (client.my.loop [255.255.255.255]) Message-ID: From: "no@spam@mgedv.net" To: Date: Sat, 15 May 2010 20:07:03 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Cc: freebsd-hackers@freebsd.org, freebsd-ports-bugs@freebsd.org Subject: openntpd port for freebsd8: removal of custom arc4random_uniform X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2010 18:46:05 -0000 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.