ports/150235: smartmontools build system bug

Garrett Wollman wollman at hergotha.csail.mit.edu
Thu Sep 2 23:00:09 UTC 2010


>Number:         150235
>Category:       ports
>Synopsis:       smartmontools build system bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 02 23:00:08 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Wollman
>Release:        FreeBSD 8.1-RELEASE amd64
>Organization:
FreeBSD
>Environment:
System: FreeBSD hergotha.csail.mit.edu 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Wed Aug 25 19:31:08 EDT 2010 root at new-hergotha.csail.mit.edu:/usr/obj/usr/src/sys/HERGOTHA amd64


>Description:
	smartmontools' configure script unconditionally includes
	"-I/usr/src/sys" in CPPFLAGS, with the result that
	smartmontools will be miscompiled if the source tree does not
	match the running system.  All of the header files it needs
	are installed in /usr/include, so this is unnecessary.

>How-To-Repeat:
	Build smartmontools on an 8.1 system where /usr/src is 7.3.
	Observe how smartctl doesn't work, because it has an incorrect
	value for the CAMIOCOMMAND, because sizeof(struct ccb) is
	different in 7.3 and 8.1.  (It would presumably have the same
	problem going the other way but I haven't tested.)
>Fix:

Patch the configure script.  I did the following, but it's obviously
silly in retrospect -- the FreeBSD section of that case statement
should just be deleted entirely.

--- configure.orig	2010-09-02 17:26:13.952714756 -0400
+++ configure	2010-09-02 17:26:31.877736681 -0400
@@ -4475,7 +4475,7 @@
 		CPPFLAGS="$CPPFLAGS -idirafter ${srcdir}/posix -idirafter ${srcdir}/os_win32"
 		;;
 	*-*-freebsd*)
-		CPPFLAGS="$CPPFLAGS -I/usr/src/sys"
+		CPPFLAGS="$CPPFLAGS"
 		;;
 esac

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list