Re: config(8) does not add post-processing for source file with compile-with command in sys/conf/files

2011-11-08 Thread Ryan Stone
On Tue, Oct 18, 2011 at 10:21 PM, Paul Ambrose ambrose...@gmail.com wrote:
 when I digged the a PR(bin/160275), I found in_proto.c and
 if_ethersubr.c ( see sys/conf/files ) does not get
 ${NORMAL_CTFCONVERT} post-processing in Makefile
 (/usr/obj/usr/src/sys/MYKERNEL/Makefile) generated by config(8), so
 the objs does not contain ctf section

Here's a second attempt at this one.  I think that this version is
much cleaner than the other options in this thread.  If it survives a
make universe I intend to commit this:

Index: usr.sbin/config/mkmakefile.c
===
--- usr.sbin/config/mkmakefile.c(revision 227341)
+++ usr.sbin/config/mkmakefile.c(working copy)
@@ -762,16 +762,21 @@
break;
}
snprintf(cmd, sizeof(cmd),
-   ${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}, ftype,
+   ${%s_%c%s}\n, ftype,
toupper(och),
ftp-f_flags  NOWERROR ? _NOWERROR : );
compilewith = cmd;
}
*cp = och;
if (strlen(ftp-f_objprefix))
-   fprintf(f, \t%s $S/%s\n\n, compilewith, np);
+   fprintf(f, \t%s $S/%s\n, compilewith, np);
else
-   fprintf(f, \t%s\n\n, compilewith);
+   fprintf(f, \t%s\n, compilewith);
+
+   if (!(ftp-f_flags  NO_OBJ))
+   fprintf(f, \t@${NORMAL_CTFCONVERT}\n\n);
+   else
+   fprintf(f, \n);
}
 }
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: config(8) does not add post-processing for source file with compile-with command in sys/conf/files

2011-10-21 Thread Paul Ambrose
There are many other compile-with  not started with ${NORMAL_C}, your
patch adds
${NORMAL_CTFCONVERT}  to them too, which could not be suitable for this.

2011/10/19 Ryan Stone ryst...@gmail.com:
 I have run into the same issue recently.  I have been testing the
 following patch(on 8.2-RELEASE) and it seems to have worked for me:

 --- mkmakefile.c 11:09:30.0 -0400
 +++ mkmakefile.c        2011-10-06 11:13:31.0 -0400
 @@ -742,15 +742,16 @@
                                break;
                        }
                        snprintf(cmd, sizeof(cmd),
 -                           ${%s_%c%s}\n.if defined(NORMAL_CTFCONVERT)  
 -                           !empty(NORMAL_CTFCONVERT)\n
 -                           \t${NORMAL_CTFCONVERT}\n.endif, ftype,
 +                           ${%s_%c%s}\n, ftype,
                            toupper(och),
                            ftp-f_flags  NOWERROR ? _NOWERROR : );
                        compilewith = cmd;
                }
                *cp = och;
 -               fprintf(f, \t%s\n\n, compilewith);
 +               fprintf(f, \t%s\n, compilewith);
 +               fprintf(f, .if defined(NORMAL_CTFCONVERT)  
 +                            !empty(NORMAL_CTFCONVERT)\n
 +                            \t${NORMAL_CTFCONVERT}\n.endif\n\n);
        }
  }

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: config(8) does not add post-processing for source file with compile-with command in sys/conf/files

2011-10-19 Thread Ryan Stone
I have run into the same issue recently.  I have been testing the
following patch(on 8.2-RELEASE) and it seems to have worked for me:

--- mkmakefile.c 11:09:30.0 -0400
+++ mkmakefile.c2011-10-06 11:13:31.0 -0400
@@ -742,15 +742,16 @@
break;
}
snprintf(cmd, sizeof(cmd),
-   ${%s_%c%s}\n.if defined(NORMAL_CTFCONVERT)  
-   !empty(NORMAL_CTFCONVERT)\n
-   \t${NORMAL_CTFCONVERT}\n.endif, ftype,
+   ${%s_%c%s}\n, ftype,
toupper(och),
ftp-f_flags  NOWERROR ? _NOWERROR : );
compilewith = cmd;
}
*cp = och;
-   fprintf(f, \t%s\n\n, compilewith);
+   fprintf(f, \t%s\n, compilewith);
+   fprintf(f, .if defined(NORMAL_CTFCONVERT)  
+!empty(NORMAL_CTFCONVERT)\n
+\t${NORMAL_CTFCONVERT}\n.endif\n\n);
}
 }
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


config(8) does not add post-processing for source file with compile-with command in sys/conf/files

2011-10-18 Thread Paul Ambrose
when I digged the a PR(bin/160275), I found in_proto.c and
if_ethersubr.c ( see sys/conf/files ) does not get
${NORMAL_CTFCONVERT} post-processing in Makefile
(/usr/obj/usr/src/sys/MYKERNEL/Makefile) generated by config(8), so
the objs does not contain ctf section

In /usr/src/usr.sbin/config/mkmakefile.c, line 746

}
compilewith = ftp-f_compilewith;
if (compilewith == 0) { // no compile-with
const char *ftype = NULL;

switch (ftp-f_type) {
case NORMAL:
ftype = NORMAL;
break;
case PROFILING:
if (!profiling)
continue;
ftype = PROFILE;
break;
default:
fprintf(stderr,
config: don't know rules for %s\n, np);
break;
}

 // only add post-processing  for  source file without compile-with

snprintf(cmd, sizeof(cmd),
${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}, ftype,
toupper(och),
ftp-f_flags  NOWERROR ? _NOWERROR : );
compilewith = cmd;
}
*cp = och;
if (strlen(ftp-f_objprefix))
fprintf(f, \t%s $S/%s\n\n, compilewith, np);
else
fprintf(f, \t%s\n\n, compilewith);
}
}

I wonder whether it was NOT allowed to add post-processing to files
with compile-with, license or other  issues?

if not a license issue, then I wonder if this fix is OK( I test it on
8-stable with gcc, and  9-stable  with both gcc and clang)

diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 2372839..25a85de 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -767,6 +767,14 @@ do_rules(FILE *f)
ftp-f_flags  NOWERROR ? _NOWERROR : );
compilewith = cmd;
}
+ //handle CTF issule with NORMAL_C and NORMAL_C_NOERROR
+ else if (!strncmp(compilewith, ${NORMAL_C,sizeof(${NORMAL_C))) {
+  snprintf(cmd, sizeof(cmd),
+%s\n\t@${NORMAL_CTFCONVERT}, compilewith);
+  compilewith = cmd;
+ }
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org