tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

-std=* for


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?

Index: share/mk/
RCS file: /cvsroot/src/share/mk/,v
retrieving revision 1.80
diff -u -p -r1.80
--- share/mk/ 5 Dec 2013 22:49:33 -0000       1.80
+++ share/mk/ 14 Jul 2014 18:47:11 -0000
@@ -61,7 +61,7 @@ _MKDEP_FILEFLAGS=
        ${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:
        ${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