From owner-svn-src-head@freebsd.org Mon Mar 27 22:53:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7ADAD209D6; Mon, 27 Mar 2017 22:53:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B76E8199; Mon, 27 Mar 2017 22:53:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RMradV032488; Mon, 27 Mar 2017 22:53:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RMra2L032487; Mon, 27 Mar 2017 22:53:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703272253.v2RMra2L032487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Mar 2017 22:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316064 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 22:53:38 -0000 Author: imp Date: Mon Mar 27 22:53:36 2017 New Revision: 316064 URL: https://svnweb.freebsd.org/changeset/base/316064 Log: Fix build with path names with 'align' or 'nop' in them. clang is now inserting .file directives with the entire path in them. This is fine, except that our sed peephole optimizer removes them if ${SRCTOP} or ${OBJTOP} contains 'align' or 'nop', leading to build failures. The sed peephole optimizer removes useful things for boot2 when used with clang, so restrict its use to gcc. Also, gcc no longer generates nops to pad things, so there's no point in removing it. Specialize the optimization to just removing the .align 4 lines to preclude inadvertant path matching. Sponsored by: Netflix Commit brought to you the path: /home/xxx/NCD-3592-logsynopts/FreeBSD Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:34:43 2017 (r316063) +++ head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:53:36 2017 (r316064) @@ -91,10 +91,18 @@ boot2.o: boot2.s SRCS= boot2.c boot2.h +# Gcc (4.2.1 at least) benefits from removing the forced alignment +# clang doesn't. Make the removal as specific as possible to avoid +# false positives (like path names with odd names for debugging info). +# In the past, gcc benefited from nop removal, but not in 4.2.1. +# Think of this as a poor-man's peephole optimizer for gcc 4.2.1 boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c - sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s - rm -f boot2.s.tmp +.if ${COMPILER_TYPE} == "gcc" + sed -e '/\.align 4/d' < boot2.s.tmp > boot2.s +.else + cp boot2.s.tmp boot2.s +.endif boot2.h: boot1.out ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \