From owner-p4-projects@FreeBSD.ORG Wed Jul 17 20:04:26 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 70F67125; Wed, 17 Jul 2013 20:04:26 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32AE6123 for ; Wed, 17 Jul 2013 20:04:26 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC3786A for ; Wed, 17 Jul 2013 20:04:26 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r6HK4PEJ084382 for ; Wed, 17 Jul 2013 20:04:25 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r6HK4PSP084379 for perforce@freebsd.org; Wed, 17 Jul 2013 20:04:25 GMT (envelope-from brooks@freebsd.org) Date: Wed, 17 Jul 2013 20:04:25 GMT Message-Id: <201307172004.r6HK4PSP084379@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 231231 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 20:04:26 -0000 http://p4web.freebsd.org/@@231231?ac=10 Change 231231 by brooks@brooks_zenith on 2013/07/17 20:03:42 Remove -O* from compile entries in the expanded form of config generated .oll rules. This is fragile if new compile macros are added but that's a fairly rare occurance in practice. A complete rethink of the kernel build process is probably warranted, but is not on today's agenda. Affected files ... .. //depot/projects/ctsrd/tesla/src/usr.sbin/config/mkmakefile.c#4 edit Differences ... ==== //depot/projects/ctsrd/tesla/src/usr.sbin/config/mkmakefile.c#4 (text+ko) ==== @@ -697,9 +697,9 @@ static void do_rules(FILE *f) { - char *cp, *np, och; + char *cp, *cwcp, *np, och, *tcp; struct file_list *ftp; - char *compilewith; + char *compilewith, *teslacompilewith; char cmd[128]; STAILQ_FOREACH(ftp, &ftab, f_next) { @@ -773,6 +773,39 @@ fprintf(f, "\n"); if (tesla && och == 'c') { + int i; + const char *compilers[] = { + "{NORMAL_C}", + "{NORMAL_C_NOWERROR}", + "{OFED_C}", + "{PROFILE_C}", + "{ZFS_C}", + NULL + }; + + cwcp = NULL; + for(i = 0; compilers[i] != NULL; i++) { + if ((cwcp = strstr(compilewith, compilers[i])) + == NULL) + continue; + /* Find the closing } */ + cwcp += strlen(compilers[i]) - 1; + break; + } + + if (cwcp != NULL) { + if ((tcp = teslacompilewith = + malloc(strlen(compilewith) + 6)) == NULL) + err(1, "malloc\n"); + strncpy(tcp, compilewith, + cwcp - compilewith); + tcp += cwcp - compilewith; + strcpy(tcp, ":N-O*"); + tcp += strlen(":N-O*"); + strcpy(tcp, cwcp); + } else + teslacompilewith = compilewith; + if (ftp->f_depends) fprintf(f, "%s%soll: $S/%s%c %s\n", ftp->f_objprefix, tail(np), np, och, @@ -783,11 +816,13 @@ if (strlen(ftp->f_objprefix)) fprintf(f, "\t%s $S/%s -S -emit-llvm -o ${.TARGET}\n", - compilewith, np); + teslacompilewith, np); else fprintf(f, "\t%s -S -emit-llvm -o ${.TARGET}\n", - compilewith); + teslacompilewith); fprintf(f, "\n"); + if (teslacompilewith != compilewith) + free(teslacompilewith); if (ftp->f_depends) fprintf(f, "%s%stesla: $S/%s%c %s\n",