Bug 228195 - sysutils/rdate port fails to build
Summary: sysutils/rdate port fails to build
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Johan van Selst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-12 12:22 UTC by Sergey
Modified: 2018-06-23 19:01 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (johans)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2018-05-12 12:22:49 UTC
rdate port fails to build, PSB:

$ uname -aK
FreeBSD KPECT 11.1-STABLE FreeBSD 11.1-STABLE #0: Sat Apr 21 18:26:49 MSK 2018     root@KPECT  amd64 1101515
$ cd /usr/ports/sysutils/rdate/
total 14
-rw-r--r--  1 root  wheel   134  4 мая    2015 distinfo
drwxr-xr-x  2 root  wheel     3 27 янв.  00:53 files
-rw-r--r--  1 root  wheel  1024 27 янв.  00:53 Makefile
-rw-r--r--  1 root  wheel   295  1 июня   2014 pkg-descr
$ doas make
===>   rdate-20150501 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rdate-20150501 for building
===>  Extracting for rdate-20150501
=> SHA256 Checksum OK for rdate-20150501.tar.gz.
===>  Patching for rdate-20150501
/usr/bin/sed -i.bak -e 's,/right,,' /usr/obj/usr/ports/sysutils/rdate/work/rdate/rdate.8
===>  Configuring for rdate-20150501
===>  Building for rdate-20150501
--- objwarn ---
--- .depend ---
echo rdate: /usr/lib/libc.a /usr/lib/libutil.a >> .depend
--- objwarn ---
Warning: Object directory not changed from original /usr/obj/usr/ports/sysutils/rdate/work/rdate
--- rdate.o ---
--- rfc868time.o ---
--- ntp.o ---
--- ntpleaps.o ---
--- rdate.o ---
cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge  -MD  -MF.depend.rdate.o -MTrdate.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c rdate.c -o rdate.o
--- rfc868time.o ---
cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge  -MD  -MF.depend.rfc868time.o -MTrfc868time.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c rfc868time.c -o rfc868time.o
--- ntp.o ---
cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge  -MD  -MF.depend.ntp.o -MTntp.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c ntp.c -o ntp.o
--- ntpleaps.o ---
cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge  -MD  -MF.depend.ntpleaps.o -MTntpleaps.o -std=gnu99 -fstack-protector-strong    -Qunused-arguments  -c ntpleaps.c -o ntpleaps.o
--- rdate.o ---
rdate.c:54:10: fatal error: 'util.h' file not found
#include <util.h>
         ^~~~~~~~
1 error generated.
*** [rdate.o] Error code 1

make[1]: stopped in /usr/obj/usr/ports/sysutils/rdate/work/rdate
--- ntp.o ---
ntp.c:188:24: warning: implicit declaration of function 'SA_LEN' is invalid in C99 [-Wimplicit-function-declaration]
        if (connect(fd, peer, SA_LEN(peer)) < 0) {
                              ^
1 warning generated.
1 error

make[1]: stopped in /usr/obj/usr/ports/sysutils/rdate/work/rdate
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/rdate
$
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-06-22 12:09:36 UTC
With which compiler you work?

It seems it does not find the compiler. Or it is a error with ccache (or something in /etc/make.conf)

compare with my code:

--- rdate.o ---
/usr/local/libexec/ccache/world/clang60 -O2 -pipe  -DNO_UTIL -D__dead= -D'SA_LEN(x)=
                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(x)->sa_len' -fstack-protector -fno-strict-aliasing -Wno-invalid-source-encoding   -Wall -std=gnu99 
                                                                                                                                     ^^^^^
-Qunused-arguments  -fstack-protector   -c rdate.c -o rdate.o

It complete ignores the CFLAGS.
The -D... are in the port Makefile, -Wall comes from the source Makefile.
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-06-22 12:10:20 UTC
It seems it does not find the compiler was wrong.
Comment 3 Walter Schwarzenfeld freebsd_triage 2018-06-22 12:16:41 UTC
Try it with
CONFIGURE_ENV+="CFLAGS+=-DNO_UTIL -D__dead= -D'SA_LEN(x)=(x)->sa_len' -Wall"
and
MAKE_ENV+="CFLAGS+=-DNO_UTIL -D__dead= -D'SA_LEN(x)=(x)->sa_len' -Wall"
Comment 4 Sergey 2018-06-23 19:00:43 UTC
with those CFLAGS everything builds fine, thanx!

# cc -v
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd11.2
Thread model: posix
InstalledDir: /usr/bin