Skip to content

Instantly share code, notes, and snippets.

Created May 1, 2013 04:30
Show Gist options
  • Save anonymous/5493734 to your computer and use it in GitHub Desktop.
Save anonymous/5493734 to your computer and use it in GitHub Desktop.
By using -nostdinc and careful setting of -I we can build/use aicasm on older systems with incompatible headers. Otherwise building a 9.0 kernel on a HEAD system has the following error: > cc -O2 -pipe -nostdinc -I/usr/include -I. -I/usr/home/alfred/tn/9. 0/FreeBSD/src/sys/dev/aic7xxx/aicasm -g -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-form…
diff --git a/Makefile.inc1 b/Makefile.inc1
index e850cda..785e3180 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -830,17 +830,18 @@ buildkernel:
@echo ">>> stage 2.3: build tools"
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; \
- PATH=${BPATH}:${PATH} \
+ PATH=${TMPPATH} \
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
- ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
+ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm" \
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
.for target in obj depend all
+ @echo "---- aicasm: ${target} ----"
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
- PATH=${BPATH}:${PATH} \
+ PATH=${TMPPATH} \
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
- ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target}
+ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm" ${target}
.endfor
.endif
.if !defined(NO_KERNELDEPEND)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment