From owner-freebsd-current@FreeBSD.ORG Wed Oct 19 02:21:08 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F6D106564A for ; Wed, 19 Oct 2011 02:21:08 +0000 (UTC) (envelope-from ambrosehua@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id EBF028FC08 for ; Wed, 19 Oct 2011 02:21:07 +0000 (UTC) Received: by eyd10 with SMTP id 10so1569393eyd.13 for ; Tue, 18 Oct 2011 19:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=56x974nIIZN4j2drXiZKbhM94vJeSkKzhard7zlqmko=; b=FSg5Bhjomg2gYkqEUpF9vEp1RawowSgpVwLq2ng4QBJYgSaHh6Ta4PzJX/DjjSeF5f +jxYm19esjZzQcaQ3OqqrB9X3qJzgKvHaDZbmKq43inqGgyqj4z2WwkSwIRJo7mold7B fUfJX6bYf6GOk+Z+3tzyoJivDx7JdVJuUE9wA= MIME-Version: 1.0 Received: by 10.223.16.82 with SMTP id n18mr8020565faa.2.1318990866950; Tue, 18 Oct 2011 19:21:06 -0700 (PDT) Received: by 10.223.156.1 with HTTP; Tue, 18 Oct 2011 19:21:06 -0700 (PDT) Date: Wed, 19 Oct 2011 10:21:06 +0800 Message-ID: From: Paul Ambrose To: freebsd-current Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions Subject: config(8) does not add post-processing for source file with compile-with command in sys/conf/files X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2011 02:21:08 -0000 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; + }