From owner-svn-src-head@freebsd.org Tue Apr 7 04:45:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A44C2A8B91 for ; Tue, 7 Apr 2020 04:45:22 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48xFFs1987z44gL for ; Tue, 7 Apr 2020 04:45:20 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-vs1-f41.google.com with SMTP id u11so1415048vsg.2 for ; Mon, 06 Apr 2020 21:45:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7kGbUd1bcqTVwsiUpTwP0xRCThBi5Cinkr4Wsf/bdxI=; b=GSEpEa8AasPgBcI8CDidBwsFqbkeHhA2YapJxa16bBCWuRTeYga2cV2ou/Q3d972oh 3bQz0B/+dTaDD7R5d7DuRHwjaYHlGnjZpPTtKaeonJYYHh7QCnQXNHFkEEy5udJMv13x LtNBN1ZUZMyr1lQDv5SzTaQXs4p3kRKQTl7ah6SuLarLJ1h8/O+tm3CtMkRTpGjw6HKc keyNygDwEZUY0zNeJ0SAg1/L+t342b2EFR3UxQaVGcW4yqtaSg76yQ/DsoI1ZOsyFgT9 1P9BkJQskjnm13pExEePXl9l6EAqkrIJsDF1BIEcWTgPtIdYJfb4TmpRy6fDnhIDQhut v5PQ== X-Gm-Message-State: AGi0PuaXIgYZBo2N0/u+pKCmIly6QpZp5ApLl/XtaSasRa5uOmmG6m39 dCSIJaXekq0/GsvPL0SYay+UXDTwhlbYJZPthMJzUg== X-Google-Smtp-Source: APiQypKrss3yr+krGxLA+ROUaESfU+EPDITcUFqvZoKS39aiU5c7VTZxhTo8V0xW4hiXY7wgsJ+7BHwM2lTcUjgqoRM= X-Received: by 2002:a67:f8c4:: with SMTP id c4mr454118vsp.161.1586234719907; Mon, 06 Apr 2020 21:45:19 -0700 (PDT) MIME-Version: 1.0 References: <202004062338.036Nckt3022130@repo.freebsd.org> <9f2a2e90-0bb5-29b0-8b2b-c79caf6df903@FreeBSD.org> In-Reply-To: <9f2a2e90-0bb5-29b0-8b2b-c79caf6df903@FreeBSD.org> From: Maxim Sobolev Date: Mon, 6 Apr 2020 21:45:08 -0700 Message-ID: Subject: Re: svn commit: r359681 - in head: . share/mk To: Bryan Drewery Cc: Brooks Davis , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 48xFFs1987z44gL X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sobomax@sippysoft.com designates 209.85.217.41 as permitted sender) smtp.mailfrom=sobomax@sippysoft.com X-Spamd-Result: default: False [-1.05 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.946,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.93)[-0.933,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[19]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[41.217.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.17)[ipnet: 209.85.128.0/17(-0.40), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[sobomax@freebsd.org,sobomax@sippysoft.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[41.217.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[sobomax@freebsd.org,sobomax@sippysoft.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 07 Apr 2020 04:45:22 -0000 This broke Jenkins builds. :( https://ci.freebsd.org/job/FreeBSD-head-armv7-build/8689/ -Max On Mon, Apr 6, 2020 at 6:49 PM Bryan Drewery wrote: > On 4/6/2020 4:38 PM, Brooks Davis wrote: > > Author: brooks > > Date: Mon Apr 6 23:38:46 2020 > > New Revision: 359681 > > URL: https://svnweb.freebsd.org/changeset/base/359681 > > > > Log: > > Fix compilation with upstream clang builtin headers. > > > > By using -nobuiltininc and adding the clang builtin headers resource > dir > > to the end of the compiler header search path, we can still find > headers > > such as immintrin.h but find the FreeBSD version of > stddef.h/stdarg.h/.. > > first. > > > > This is a workaround until we are able to settle on and complete a plan > > to harmonize guard macros with LLVM. We've mostly worked out this on > > FreeBSD systems by removing select headers from the installed set of > > devel/llvm*, but that isn't a good solution for cross build. > > > > Submitted by: arichardson > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D17002 > > > > Modified: > > head/Makefile.inc1 > > head/share/mk/bsd.compiler.mk > > head/share/mk/bsd.sys.mk > > > > Modified: head/Makefile.inc1 > > > ============================================================================== > > --- head/Makefile.inc1 Mon Apr 6 23:28:24 2020 (r359680) > > +++ head/Makefile.inc1 Mon Apr 6 23:38:46 2020 (r359681) > > @@ -337,6 +337,7 @@ _TOOLCHAIN_METADATA_VARS= COMPILER_VERSION \ > > COMPILER_TYPE \ > > COMPILER_FEATURES \ > > COMPILER_FREEBSD_VERSION \ > > + COMPILER_RESOURCE_DIR \ > > LINKER_VERSION \ > > LINKER_FEATURES \ > > LINKER_TYPE \ > > > > Modified: head/share/mk/bsd.compiler.mk > > > ============================================================================== > > --- head/share/mk/bsd.compiler.mk Mon Apr 6 23:28:24 2020 > (r359680) > > +++ head/share/mk/bsd.compiler.mk Mon Apr 6 23:38:46 2020 > (r359681) > > @@ -143,7 +143,7 @@ _cc_vars+=XCC X_ > > # The value is only used/exported for the same environment that impacts > > # CC and COMPILER_* settings here. > > _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ > > - ${X_}COMPILER_FREEBSD_VERSION > > + ${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR > > ${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} > > ${X_}_cc_hash:= ${${X_}_cc_hash:hash} > > # Only import if none of the vars are set somehow else. > > @@ -201,6 +201,10 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown > > .endif > > .endif > > > > +.if !defined(${X_}COMPILER_RESOURCE_DIR) > > +${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} > -print-resource-dir 2>/dev/null || echo unknown > > +.endif > > + > > ${X_}COMPILER_FEATURES= > > .if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= > 30300) || \ > > (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= > 40800) > > @@ -224,6 +228,7 @@ X_COMPILER_TYPE= ${COMPILER_TYPE} > > X_COMPILER_VERSION= ${COMPILER_VERSION} > > X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION} > > X_COMPILER_FEATURES= ${COMPILER_FEATURES} > > +X_COMPILER_RESOURCE_DIR= ${COMPILER_RESOURCE_DIR} > > .endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) > > > > # Export the values so sub-makes don't have to look them up again, > using the > > > > Modified: head/share/mk/bsd.sys.mk > > > ============================================================================== > > --- head/share/mk/bsd.sys.mk Mon Apr 6 23:28:24 2020 (r359680) > > +++ head/share/mk/bsd.sys.mk Mon Apr 6 23:38:46 2020 (r359681) > > @@ -206,6 +206,21 @@ CWARNFLAGS+= -Wno-unknown-pragmas > > # This warning is utter nonsense > > CFLAGS+= -Wno-format-zero-length > > > > +.if ${COMPILER_TYPE} == "clang" > > +# The headers provided by clang are incompatible with the FreeBSD > headers. > > +# If the version of clang is not one that has been patched to omit the > > +# incompatible headers, we need to compile with -nobuiltininc and add > the > > +# resource dir to the end of the search paths. This ensures that > headers such as > > +# immintrin.h are still found but stddef.h, etc. are picked up from > FreeBSD. > > +# > > +# XXX: This is a hack to support complete external installs of clang > while > > +# we work to synchronize our decleration guards with those in the clang > tree. > > +.if ${MK_CLANG_BOOTSTRAP} == "no" && ${COMPILER_RESOURCE_DIR} != > "unknown" && \ > > + !defined(BOOTSTRAPPING) > > I just realized MK_CLANG_BOOTSTRAP is not going to be defined here > outside of the tree. Adding :Uno will fix it. Keep in mind this current > change and the next will affect ports. It looks like by default clang > will always get these flags added on. > > > +CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_DIR}/include > > +.endif > > +.endif > > + > > CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ > > -mllvm -simplifycfg-dup-ret > > .if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700 > > > > > -- > Regards, > Bryan Drewery > >