potential future proofing fix for aicasm build.

Dimitry Andric dimitry at andric.com
Thu May 2 07:19:40 UTC 2013


On May 1, 2013, at 18:44, Alfred Perlstein <alfred at ixsystems.com> wrote:
> I took a shot at fixing this issue with building aicasm as part of "buildkernel" of an older 9.0 src on a machine running HEAD.
> 
> aicasm.o: In function `__getCurrentRuneLocale': > /usr/include/runetype.h:96: undefined reference to `_ThreadRuneLocale'

I don't understand this error message... It seems like a linker error, but it also seems to refer to an incorrect include file?  Is this during linking or compiling?


> The issue seems to be two-fold:
> 
> 1) Paths are not fully set to pick up the bootstrap tools needed to build.

What do you mean, exactly?  In r230622 I explicitly set the PATH to ${BPATH}:${PATH}, which should be enough to pick up the bootstrap tools.  This is exactly the same path used to build the bootstrap-tools stage itself.  The kernel bootstrap tools (only aicasm, really) should be built by the host compiler, not the cross-tools compiler.


> 2) include files use the host's instead of the build trees.
> 
> The first problem is fixed by changing setting of PATH from "${BPATH}:${PATH}" to ${TMPPATH}.
> 
> The second is fixed by using -nostdinc and setting strict include paths using -I directives to the compiler:
> 
> CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm"

I don't think this is correct, as aicasm should be compiled by the host compiler, and linked with the host libc.  So if you start including headers from the source directory, there will be a mismatch between what those headers declare, and what is available in the host libc.



More information about the freebsd-hackers mailing list