Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Sep 2013 11:50:05 -0600
From:      Ian Lepore <ian@FreeBSD.org>
To:        freebsd-current@FreeBSD.org
Cc:        Dimitry Andric <dim@FreeBSD.org>
Subject:   aicasm build error
Message-ID:  <1379181005.1197.24.camel@revolution.hippie.lan>

next in thread | raw e-mail | index | archive | help

--=-RdR77MEbvpQRXzS+iCfF
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

For a while I've been getting a build error on aicasm during the early
steps of the build.  Today I finally dug into it and discovered it's
because the build is using a mix of header files, some from /usr/include
on the build host, and some from obj/... for the target being built.  It
happens because dev/aic7xxx/aicasm/Makefile contains CFLAGS+= -I. and
the current directory when aicasm builds is obj/.../<kernconf>.  In my
case it was picking up machine/_types.h from objdir.

Apparently this is usually harmless, but if the build host system and
the target versions are far enough apart, or with a cross-build where
the host and target are different architectures, you can get problems.  

After a little digging, I just now discovered Marcel fixed this long ago
in r70000, but then it got undone in r236578 a couple months ago.  Is
there any reason not to restore Marcel's fix, such as with the attached
patch?

-- Ian



--=-RdR77MEbvpQRXzS+iCfF
Content-Disposition: inline; filename="aicasm_build.diff"
Content-Type: text/x-patch; name="aicasm_build.diff"; charset="us-ascii"
Content-Transfer-Encoding: 7bit

diff -r 00739d74c495 sys/dev/aic7xxx/aicasm/Makefile
--- sys/dev/aic7xxx/aicasm/Makefile	Sat Sep 14 09:55:04 2013 -0600
+++ sys/dev/aic7xxx/aicasm/Makefile	Sat Sep 14 11:44:09 2013 -0600
@@ -24,7 +24,8 @@ WARNS?=	5
 DEPENDFILE=	.depend_aicasm
 .endif
 
-CFLAGS+= -I.
+# Tool runs on the build host, must prefer /usr/include headers over obj/...
+CFLAGS+= -I/usr/include -I.
 .ifdef MAKESRCPATH
 CFLAGS+= -I${MAKESRCPATH}
 .endif

--=-RdR77MEbvpQRXzS+iCfF--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1379181005.1197.24.camel>