10.13 ntp build failure (undefined symbols)

Daniel J. Luke dluke at geeklair.net
Tue Oct 3 16:37:47 UTC 2017

Currently ntp builds on 10.13 fail with:

% make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CCLD     ntptime
Undefined symbols for architecture x86_64:
  "_lib_nextbuf", referenced from:
      _common_prettydate in libntp.a(prettydate.o)
  "_lib_stringbuf", referenced from:
      _common_prettydate in libntp.a(prettydate.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [ntptime] Error 1
make: *** [all] Error 2

The libtool invocation is actually:

../libtool --silent --tag=CC   --mode=link cc -Wall -Wcast-align -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Winit-self -Wstrict-overflow -D_P1003_1B_VISIBLE  -Wstrict-prototypes  -g -O2   -L/opt/local/lib -o ntptime ntptime.o ../libntp/libntp.a -lresolv    -intl 

What's confusing to me is that libntp.a includes those symbols:

% nm -AU ../libntp/libntp.a | grep _lib_nextbuf
../libntp/libntp.a:lib_strbuf.o: 0000000000000004 C _lib_nextbuf
% nm -AU ../libntp/libntp.a | grep _lib_stringbuf
../libntp/libntp.a:lib_strbuf.o: 0000000000000800 C _lib_stringbuf

I'm clearly missing something - but I'm not sure what it is. Any thoughts?
Daniel J. Luke

More information about the macports-dev mailing list