2009-06-26 12:25:29 Problem to build ntp package, please help
Abram Jiang (CHINA)
Message: 76396
Hi,
I tried to build ntp package provided in uclinux-dist-2008R1.5-RC3 but met some problem. First to claim, I can include ntpd by select it with menuconfig and build the uClinux image. But I cannot run it normally on BF537-EZKIT as expected for my project even use "no fork" option. Also, it seems no "-d" option offered as the ntpd on my Linux host.
So I follow the debug instructions on docs.blackfin.uclinux.org. Maybe cause I'm not good at gdb, I haven't got useful info with it. So I try to use Trace Buffer. (Is this the right choice?) Now the problem comes. I suppose I need to compile the ntp source files as mentioned in the simple_hello_world example. But it's so simple example that we can use bfin-uclinux-gcc to do the compile with those options. Fot ntp package, I suppose should use 'make' command. But if I run 'make' command in uclinux-dist/user/ntp directory, it won't do cross-compiling. ( Is there any arguments I can pass to 'make' here to do cross-compiling?) To make sure it's cross-compiling, I use the configure script to setup env variables as instructed in "Cross Compiling" page of Blackfin Linux Docs. After run the configure command, I found a Makefile created in the ntp-4.2.4p4 folder by Automake. Now I run 'make' and got the following error message:
make[2]: Entering directory `/home/abram/bfuclinux/uClinux-dist-2008R1.5-RC3/user/test/ntp-4.2.4p4/libntp'
if bfin-uclinux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -g -O2 -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -MT iosignal.o -MD -MP -MF ".deps/iosignal.Tpo" -c -o iosignal.o iosignal.c; \
then mv -f ".deps/iosignal.Tpo" ".deps/iosignal.Po"; else rm -f ".deps/iosignal.Tpo"; exit 1; fi
iosignal.c: In function 'init_clock_sig':
iosignal.c:109: error: 'I_SETSIG' undeclared (first use in this function)
iosignal.c:109: error: (Each undeclared identifier is reported only once
iosignal.c:109: error: for each function it appears in.)
iosignal.c:109: error: 'S_INPUT' undeclared (first use in this function)
iosignal.c: In function 'init_socket_sig':
iosignal.c:232: error: 'I_SETSIG' undeclared (first use in this function)
iosignal.c:232: error: 'S_INPUT' undeclared (first use in this function)
make[2]: *** [iosignal.o] Error 1
make[2]: Leaving directory `/home/abram/bfuclinux/uClinux-dist-2008R1.5-RC3/user/test/ntp-4.2.4p4/libntp'
make[1]: *** [../libntp/libntp.a] Error 2
make[1]: Leaving directory `/home/abram/bfuclinux/uClinux-dist-2008R1.5-RC3/user/test/ntp-4.2.4p4/ntpd'
make: *** [all] Error 2
By some searching, I found similar problem in Blackfin uClinux R2007 but should be fixed already. So, it should be some misunderstanding and mistake I made during my work process. To summary, my questions include:
1. Has ntpd got tested to run well in bf-uclinux-dist 2008R1.5? If so, what should I pay attention to run it? Why not support '-d' option?
2. Suppose if I need to debug the package, will Trace Buffer be helpful, based on your experience?
3. How can I implement Trace Buffer? Have I token the right path as above to implement?
4. Any comments for the "error" message?
Let me know if any info need to be posted. Thanks in advance.
best regards,
Abram
QuoteReplyEditDelete
2009-06-26 13:46:54 Re: Problem to build ntp package, please help
Robin Getz (UNITED STATES)
Message: 76402
Abram:
Use the directions at:
https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:ntp
There is also no directory in ./user/test - you must have made that yourself.
-Robin
QuoteReplyEditDelete
2009-06-26 22:36:51 Re: Problem to build ntp package, please help
Abram Jiang (CHINA)
Message: 76415
Robin,
Thanks for quick response. During my work, I have read the directions at:
https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:ntp several times. But it talks about ntpdate more than ntpd. In fact, ntpdate can work well on my system but we need ntpd. As I mentioned, we have tested ntpd on our Linux host to sync with local clock or public stratum 2 internet server. Both works well and we can see the progress by using "-d" option.. When we run ntpd on BF537 target, we cannot check the progress with "-d" and no association ID can be detected with ntpq. So I try to understand in such case whether I need to debug the source code and if so, what's common methods for debugging.
BTW, to build the package, I have made directory in ./user/test for testing.
-Abram
QuoteReplyEditDelete
2009-06-26 23:43:02 Re: Problem to build ntp package, please help
Robin Getz (UNITED STATES)
Message: 76416
Abram:
the mainline ntpd package isn't going to work without modifications. Use the existing (and tested) ./user/ntpclient
(Although I'm not sure what version is there - it looks like we need to update it to the 2007 version from doolittle.icarus.com/ntpclient/)
-Robin
QuoteReplyEditDelete
2009-06-29 01:55:31 Re: Problem to build ntp package, please help
Mike Frysinger (UNITED STATES)
Message: 76443
user/ntp/ should build/run OK in trunk, but that doesnt really have much bearing on what people are doing in their own source tree
QuoteReplyEditDelete
2009-07-02 00:00:52 Re: Problem to build ntp package, please help
Abram Jiang (CHINA)
Message: 76616
Robin and Mike,
Thanks for your help. NTP client should work but I really need is NTP Server running on Blackfin uClinux. I enabled debug for ntpd in Makefile and run it with different debug level. The output indicated fork( ) failed which I traced into do_resolve_internal function in ntp_config.c and getaddrinfo treat 127.127.1.0 as invalid host address, which is recognized well as local clock by ntpd on my host.
So, does this mean the NTP code in the BF uClinux-dist hasn't been ported and tested, just as Robin said?
Based on Mike's comment, I also checkout the svn Trunk sources. I can build with default selection successfully but after select ntpd, I got following error when building with "make" (only show last part with error message)
..............................................................
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf537-0.2 -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wno-strict-prototypes -Winit-self -Wl,-elf2flt -mcpu=bf537-0.2 -o ntpd cmd_args.o ntp_config.o ntp_io.o ntpd.o ntpd-opts.o version.o libntpd.a -lm ../libopts/.libs/libopts.a ../libntp/libntp.a
ntp_config.o: In function `do_resolve_internal':
../../ntp-4.2.4p7/ntpd/ntp_config.c:2450: undefined reference to `_fork'
../libopts/.libs/libopts.a(libopts_la-libopts.o): In function `textToVariable':
../../ntp-4.2.4p7/libopts/makeshell.c:525: undefined reference to `_fork'
../libopts/.libs/libopts.a(libopts_la-libopts.o): In function `genshelloptUsage':
../../ntp-4.2.4p7/libopts/makeshell.c:1056: undefined reference to `_fork'
../../ntp-4.2.4p7/libopts/makeshell.c:1098: undefined reference to `_fork'
collect2: ld returned 1 exit status
make[7]: *** [ntpd] Error 1
make[7]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user/ntp/build-ntp-4.2.4p7/ntpd'
make[6]: *** [install] Error 2
make[6]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user/ntp/build-ntp-4.2.4p7/ntpd'
make[5]: *** [install-recursive] Error 1
make[5]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user/ntp/build-ntp-4.2.4p7'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user/ntp/build-ntp-4.2.4p7'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user/ntp'
make[2]: *** [ntp] Error 2
make[2]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/abram/blackfin-svn-sources/uclinux-dist/user'
make: *** [subdirs] Error 1
Any suggestion?
Abram
QuoteReplyEditDelete
2009-07-02 00:34:59 Re: Problem to build ntp package, please help
Mike Frysinger (UNITED STATES)
Message: 76617
anything using fork() in trunk will fail like ntpd
QuoteReplyEditDelete