Bug 249461 - netstat(1) fails to build
Summary: netstat(1) fails to build
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-19 19:52 UTC by Moritz Schmitt
Modified: 2020-09-21 18:51 UTC (History)
1 user (show)

See Also:


Attachments
Patch for ${SRCTOP}/usr.bin/netstat/Makefile (188 bytes, patch)
2020-09-19 19:52 UTC, Moritz Schmitt
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Schmitt 2020-09-19 19:52:05 UTC
Created attachment 218087 [details]
Patch for ${SRCTOP}/usr.bin/netstat/Makefile

${SRCTOP}/usr.bin/netstat doesn't build on older systems (e.g., 12.1) because struct members were added in tcp_var.h and if_arp.h in CURRENT and are missing on older systems. The CURRENT include dir should be added to CFLAGS by the Makefile.

The attached patch does just that and cleans up formatting according to style.Makefile(5).
Comment 1 Ed Maste freebsd_committer 2020-09-21 17:59:10 UTC
The standard build environment installs the target headers into a sysroot directory and builds against those, so the only way this ought to occur is if you try to build a head usr.bin/netstat in isolation on a 12.1 host. Is that the case here?
Comment 2 Moritz Schmitt 2020-09-21 18:51:33 UTC
Yes, this is the case. In fact thj ran into this problem during yesterday's bug squash. He suggested I send the above patch in for review, which I did:

    https://reviews.freebsd.org/D26483

By the way, usr.bin/truss/Makefile includes the same dir as the attached patch.