2008-04-06 07:56:21 compile error openntpd with uclibc-full-08r1-8
Stefan Pledl (GERMANY)
Message: 53706 hi,
openntpd does not compile with uclibc-full-08r1-8 due to multiple definitions of in6addr_any
(uclibc and openbsd-compat/fake-rfc2553.c).
After analyze of the configure script i found out that the reason is an error in configure.ac.
(see openntpd.diff)
Now i can compile an start ntpd but the application terminates with
fatal: cannot fork
Do you have any ideas how to solve this problem
thanks for your help
and best regards
Stefan Pledl
openntpd.diff.bz2
QuoteReplyEditDelete
2008-04-06 15:02:33 Re: compile error openntpd with uclibc-full-08r1-8
Javier Herrero (SPAIN)
Message: 53708 Hello,
You must run ntpd with the 'no fork' option, if I'm right is ntpd -n. To demonize it, you can simply run it as ntpd -n &
Regards,
Javier
QuoteReplyEditDelete
2008-04-06 23:14:18 Re: compile error openntpd with uclibc-full-08r1-8
Yi Li (CHINA)
Message: 53718 I tried to build openntpd with 2008r1-rc8 toolchain and uclibc-full-08r1-rc8, it builds well. Could you please post your error log?
QuoteReplyEditDelete
2008-04-06 23:15:21 Re: compile error openntpd with uclibc-full-08r1-8
Mike Frysinger (UNITED STATES)
Message: 53719 thanks, ive applied your fix to svn
for future reference, there's no need to tar up single files ... nor compress them when they're small
QuoteReplyEditDelete
2008-04-07 04:34:08 Re: compile error openntpd with uclibc-full-08r1-8
Stefan Pledl (GERMANY)
Message: 53736
hi Javier,
i think you talk about ntpd from user/ntp/ntp-4.2.4p4/ntpd because the ntpd from user/openntp have no -n option.
best regards
Stefan
QuoteReplyEditDelete
2008-04-07 04:51:54 Re: compile error openntpd with uclibc-full-08r1-8
Mike Frysinger (UNITED STATES)
Message: 53739 yes, but openntpd has a similar option if you review the documentation
-d do not daemonize
QuoteReplyEditDelete
2008-04-07 06:42:04 Re: compile error openntpd with uclibc-full-08r1-8
Javier Herrero (SPAIN)
Message: 53744 Yes, Stefan, I misunderstood from your post that since you had problems compiling openntp, you were trying the standard ntp, and I was not surprised because I found the same issue with it
Regards,
Javier
QuoteReplyEditDelete
2008-04-07 14:26:54 Re: compile error openntpd with uclibc-full-08r1-8
Stefan Pledl (GERMANY)
Message: 53757 hi Yi Li,
this is my error log.
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf537-0.2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -D_GNU_SOURCE -I. -I.. -I../../openntpd-3.9p1/openbsd-compat -I../../openntpd-3.9p1/openbsd-compat/.. -I/usr/local/ssl/include -DEMBED -D__uClinux__ -I/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8 -mcpu=bf537-0.2 -c ../../openntpd-3.9p1/openbsd-compat/port-qnx.c
/usr/bin/ar rv libopenbsd-compat.a atomicio.o bsd-arc4random.o bsd-misc.o bsd-poll.o bsd-snprintf.o bsd-getifaddrs.o bsd-setresuid.o bsd-setresgid.o fake-rfc2553.o asprintf.o daemon.o errx.o inet_pton.o strlcpy.o verrx.o port-qnx.o
/usr/bin/ar: creating libopenbsd-compat.a
a - atomicio.o
a - bsd-arc4random.o
a - bsd-misc.o
a - bsd-poll.o
a - bsd-snprintf.o
a - bsd-getifaddrs.o
a - bsd-setresuid.o
a - bsd-setresgid.o
a - fake-rfc2553.o
a - asprintf.o
a - daemon.o
a - errx.o
a - inet_pton.o
a - strlcpy.o
a - verrx.o
a - port-qnx.o
bfin-uclinux-ranlib libopenbsd-compat.a
make[5]: Leaving directory `/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8/user/openntpd/build-openntpd-3.9p1/openbsd-compat'
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf537-0.2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -D_GNU_SOURCE -L/usr/local/ssl/lib -Wl,-elf2flt -mcpu=bf537-0.2 -o ntpd ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o config.o server.o client.o util.o y.tab.o openbsd-compat/libopenbsd-compat.a
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib/bf532-0.3/libc.a(in6_addr.os):(.rodata+0x0): multiple definition of `_in6addr_any'
openbsd-compat/libopenbsd-compat.a(fake-rfc2553.o):(.rodata+0x0): first defined here
collect2: ld returned 1 exit status
make[4]: *** [ntpd] Error 1
make[4]: Leaving directory `/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8/user/openntpd/build-openntpd-3.9p1'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8/user/openntpd'
make[2]: *** [openntpd] Error 2
make[2]: Leaving directory `/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8/user'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/projects/bf537-stamp/uClinux-dist-2008R1-RC8/user'
make: *** [subdirs] Error 1
regards
Stefan
QuoteReplyEditDelete
2008-04-07 14:46:01 Re: compile error openntpd with uclibc-full-08r1-8
Stefan Pledl (GERMANY)
Message: 53760 hi Mike,
i have tried to start ntpd with -d option, but i got the same error
root:/home> /usr/bin/ntpd -d&
111
root:/home> fatal: cannot fork: Function not implemented
root:/home> ps aux
PID Uid VSZ Stat Command
1 root 104 S /sbin/init
2 root SW< [kthreadd]
3 root SWN [ksoftirqd/0]
4 root SW< [events/0]
5 root SW< [khelper]
23 root SW< [kblockd/0]
35 root SW [pdflush]
36 root SW [pdflush]
37 root SW< [kswapd0]
38 root SW< [aio/0]
70 root SW< [mtdblockd]
72 root SW< [bfin-spi.0]
77 root SW< [rpciod/0]
96 root 40 S inetd
98 root 588 S -/bin/sh
99 root 32 S /bin/watchdogd -f -s
100 root 480 S /sbin/syslogd -n
101 root 480 S /sbin/klogd -n
112 root 484 R ps aux
root:/home>
Any ideas?
QuoteReplyEditDelete
2008-04-07 17:42:17 Re: compile error openntpd with uclibc-full-08r1-8
Mike Frysinger (UNITED STATES)
Message: 53768 looks like the architecture of ntpd may need a little work to get things right ... for the purpose of security, they split ntpd into two processes: the parent process retains root privs while the child drops all of that and listens to the network and processes things. it sends commands to the parent which does the actual time changing. all of this communication is via pipe.
using threads is pointless as the entire purpose of splitting the two is to have 1 super privileged process and one not -- you cant do that with threads.
QuoteReplyEditDelete
2008-04-07 22:22:19 Re: compile error openntpd with uclibc-full-08r1-8
Yi Li (CHINA)
Message: 53784 I am using bfin-linux-uclibc toolchain (FDPIC format), and there is no error. So it looks this problem happens with FLAT format.
QuoteReplyEditDelete
2008-04-07 22:30:43 Re: compile error openntpd with uclibc-full-08r1-8
Mike Frysinger (UNITED STATES)
Message: 53786 yes, the symbol conflict would be avoided in the FDPIC ELF case