From owner-freebsd-current@freebsd.org Tue Sep 15 16:33:50 2020 Return-Path: Delivered-To: freebsd-current@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 39C3E3D8327 for ; Tue, 15 Sep 2020 16:33:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 4BrTM16QCHz4KZv; Tue, 15 Sep 2020 16:33:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 88CF23C0199; Tue, 15 Sep 2020 16:33:43 +0000 (UTC) Date: Tue, 15 Sep 2020 16:33:43 +0000 From: Brooks Davis To: Dimitry Andric Cc: Ronald Klop , FreeBSD Current Subject: Re: compiling with ports llvm11 breaks on mman.h: struct shm_larg epage_conf Message-ID: <20200915163343.GA65749@spindle.one-eyed-alien.net> References: <11FD9B3A-E977-4188-99BF-B05BFDCFE923@FreeBSD.org> <5A7AD7E7-70ED-4029-9CD7-EE366FAE3BE8@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <5A7AD7E7-70ED-4029-9CD7-EE366FAE3BE8@FreeBSD.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4BrTM16QCHz4KZv X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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: Tue, 15 Sep 2020 16:33:50 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 14, 2020 at 06:46:52PM +0200, Dimitry Andric wrote: > On 13 Sep 2020, at 20:56, Dimitry Andric wrote: > >=20 > > On 12 Sep 2020, at 23:00, Ronald Klop wrote: > >>=20 > >> On Sat, 12 Sep 2020 18:28:03 +0200, Dimitry Andric w= rote: > >>> On 12 Sep 2020, at 17:43, Ronald Klop wrote: > >>>>=20 > >>>> Because I'm tired of hours of compilation of llvm/clang I'm testing = compiling FreeBSD with llvm11 from a pkg. > > ... > > It is during the building world stage and happens with and without NO_C= LEAN. > >> Full command: > >> /usr/local/bin/clang11 -O2 -pipe -fno-common -DNO__SCCSID -DNO__RCS= ID -I/usr/src/lib/libc > >> /include -I/usr/src/include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINT= ERFACE_PRIVATE -I/usr/ > >> src/contrib/gdtoa -I/usr/src/contrib/libc-vis -DINET6 -I/usr/obj/usr/s= rc/amd64.amd64/lib/lib > >> c -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src= /lib/libmd -I/usr/src/ > >> contrib/jemalloc/include -DMALLOC_PRODUCTION -I/usr/src/contrib/tzcode= /stdtime -I/usr/src/li > >> b/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES= _BUILTIN -I/usr/src/li > >> b/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -MD = -MF.depend.shm_open.o > >> -MTshm_open.o -std=3Dgnu99 -Wno-format-zero-length -nobuiltininc -idir= after /usr/local/llvm11 > >> /lib/clang/11.0.0/include -fstack-protector-strong -Wsystem-headers -W= error -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty= -body -Wno-string-plus-int -Wno-unused- > >> const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parent= heses-equality -Wno-un > >> used-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-addr= ess-of-packed-member - > >> Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-argu= ments -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 -I/usr/src/lib/ms= un/x86 -I/usr/src/lib/msun/src -c /usr/ > >> src/lib/libc/sys/shm_open.c -o shm_open.o > >=20 > > After a pretty long build of the llvm11 port, I can at least reproduce = your error. It looks like the problem is that clang11 does not get any --sy= sroot parameter passed. > ... > > So except for the expected difference in the -idirafter option that poi= nts to the clang internal headers, the main problem is that for some reason= , clang11 does not get the -target and --sysroot options passed. >=20 > In the end it turns out that the problems is caused by setting CC (and CX= X, etc) in make.conf. This has the unfortunate side-effect that any XCFLAGS= are overridden during the world stages, such that the all-important --sysr= oot flags is not added. >=20 > In short, never set CC, CXX, CPP or LD in your make.conf or build environ= ment, but use XCC, XCXX, XCPP and XLD instead. Better yet, install one of t= he llvm packages from the devel category, and set CROSS_TOOLCHAIN. >=20 > Keep an eye on https://wiki.freebsd.org/ExternalToolchain, which still ha= s a little bit of outdated information, but is hopefully going to be update= d soon. I've made some modest updates to this page to reflect building with modern LLVM ports. -- Brooks --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfYOzmAAoJEKzQXbSebgfAxlIH/3dIwD1ruFJ7gG13JeaVTpga EVFcOP67Je3gbdIL5BST7lPQuoUKzJ8Sfip2rBZKNwkw/3IJZDQa31CAX8KWb8OK LIviyr8prLXpiL3HOkIHNf33rfFrEwGqoyG0QEHP0YRwjsXwvkogdSzFkzU2eNe9 v2QJxvYvZ6iC+7Z84JvknWOSvBgq6KeWyq62GYWfl2WkbinmbUSIZ5LIX4QNJfLI 7RtTm4M16UVsd2bHvtfvqDqI5m8XWQOwrZhLGExFNrBDtM8AJsqcfrPSyp0yQzfa VZOP496R3yFWhRbjR0JeLFbm/9FqvsBmu9FBA4XpmyZj1bsL1UcMsZpwQXS1Blo= =+TBN -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--