tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
-std=* for bsd.dep.mk
Hi
I found an issue when compiling NetBSD sources with pcc .. with a modified
pcc in any case. It is this.. if the compiler in use does not have GNU C
compatibility enabled by default, and requires a switch (eg -std=gnu99
which the build framework normally supplies), then when mkdep is run it
does use the C preprocessor internally but -std=gnu99 is not passed..
causing there to be issues because of the lack of eg __GNUC__ definitions
which that would bring in. The source that the depend files are based on,
is thus not quite the source that would have been compiled.
so, I would like to fix that by adding flags matching -std=* to the mkdep
commandline, for C and C++ sources
any objections to that?
iain
Index: share/mk/bsd.dep.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.dep.mk,v
retrieving revision 1.80
diff -u -p -r1.80 bsd.dep.mk
--- share/mk/bsd.dep.mk 5 Dec 2013 22:49:33 -0000 1.80
+++ share/mk/bsd.dep.mk 14 Jul 2014 18:47:11 -0000
@@ -61,7 +61,7 @@ _MKDEP_FILEFLAGS=
.c.d:
${_MKTARGET_CREATE}
${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
- ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
+ ${CFLAGS:M-std=*} ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
mv ${.TARGET}.tmp ${.TARGET}
@@ -85,7 +85,7 @@ _MKDEP_FILEFLAGS=
.C.d .cc.d .cpp.d .cxx.d:
${_MKTARGET_CREATE}
${MKDEPCXX} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
- ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
+ ${CXXFLAGS:M-std=*} ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
mv ${.TARGET}.tmp ${.TARGET}
Home |
Main Index |
Thread Index |
Old Index