Bug 215934 - graphics/netpbm missing betweenZeroAndOne function won't build on FreeBSD11.0S
Summary: graphics/netpbm missing betweenZeroAndOne function won't build on FreeBSD11.0S
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-10 11:48 UTC by dewayne
Modified: 2017-01-30 00:36 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2017-01-10 11:48:45 UTC
Unfortunately building graphics/netpbm as part of the dependency chain for 
misc/freebsd-doc-en 11/14 >> textproc/docproj >> graphics/netpbm (6/100)
on FreeBSD 11.0S results in
pamthreshold.o: In function `computeGlobalThreshold.isra.1':
pamthreshold.c:(.text+0x190): undefined reference to `betweenZeroAndOne'
pamthreshold.c:(.text+0x1ac): undefined reference to `betweenZeroAndOne'
pamthreshold.c:(.text+0x30c): undefined reference to `betweenZeroAndOne'
pamthreshold.c:(.text+0x328): undefined reference to `betweenZeroAndOne'
pamthreshold.c:(.text+0x47c): undefined reference to `betweenZeroAndOne'
collect2: error: ld returned 1 exit status

so lets go hunting...
find /usr/include/ | xargs grep betweenZero
find /usr/src/ -type f  | xargs grep betweenZero
results in nothing useful, and 
find /var/ports/usr/ports/graphics/netpbm/work/netpbm-10.35.98/ | xargs grep betweenZeroAndOne

only results in function calls like 
 assert(betweenZeroAndOne(globalRange.min));
again nothing useful.  I suspect something has been removed; somewhere???

Platform: 
FreeBSD b2.hs 11.0-STABLE FreeBSD 11.0-STABLE #0 r311660M: Sun Jan  8 21:30:51 AEDT 2017    root@hathor:/110002/D/K8/hqdev-amd64-smp-vga      amd64 1100509 1100509
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2017-01-18 20:38:52 UTC
The code is compiled with NDEBUG, so all the code inside assert istn't even used.

Did you change the DEBUG settings?

Did you try installing package?
Comment 2 dewayne 2017-01-24 07:28:51 UTC
(In reply to Tilman Keskinoz from comment #1)
Apologies for the delay, I receive a lot of email.

These are the flags that are passed to the compiler.

# make -C /usr/ports/graphics/netpbm -VCFLAGS
-O2 -pipe -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3 -g0 -ggdb0 -DSTRIP_FBSDID -UNDEBUG -UDEBUGGING -UEBUGGING -UDEBUG -Wno-error -fstack-protector-strong -fstack-protector-strong -march=core2 -mtune=core2  -DPNG_DEPSTRUCT= -Iutil -fno-strict-aliasing

The various options that are used around DEBUG is to turn off debugging from various ports that use it.  Yes there is/was a port that mis-spelt DEBUGGING. :?

Due to there being an "Error 1", the package isn't assembled; hence not able to install.
Comment 3 Tilman Keskinoz freebsd_committer freebsd_triage 2017-01-28 21:51:49 UTC
Custom CFLAGS are unsupported.
Comment 4 dewayne 2017-01-30 00:36:22 UTC
(In reply to dewayne from comment #2)
The answer to this PR was self-induced in that NDEBUG was *undef*ined as part of the CFLAGS variable.  The purpose of this variable is "tell the C library to make assert() a noop as opposed to generating code to check the assertion and crash the program" (from one of the Makefiles that does use NDEBUG).

Our development machine undefined this variable for all 1047-1 ports.