From owner-freebsd-ppc@freebsd.org Fri Oct 19 13:21:24 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C7CFE6479 for ; Fri, 19 Oct 2018 13:21:24 +0000 (UTC) (envelope-from sd.fertile@gmail.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49E727D457; Fri, 19 Oct 2018 13:21:24 +0000 (UTC) (envelope-from sd.fertile@gmail.com) Received: by mail-qt1-x829.google.com with SMTP id q41-v6so38170148qtq.10; Fri, 19 Oct 2018 06:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m7m8q9KXz/KgR48GdKoG1mQChEA4OrmSk08HZlbPDOc=; b=iLFg7bEM6b4FLpjQl0jbXfBwlGTI3hcJHKilnKGNpX14UT4lGKEinPtZUymi6c7Ljo 80d7CtcjnW+P9toPVy5Hn90LfVsw6HtsrvF06Nssv58wxqryZmCmLMRjcettEcunprGz WqCdq7nYLyVZfuXBSO2FdBHEYom4rlZo2YpA2jLxgJ7rvwcWhWa6rtaSjq+Gs1ZTmAP/ AJvwzAlRCSCuiJI3TC1VCLPX/KG46dqMnI4kzGuOWlfbUuwfDWFzhMM5CuEQ71LqEltJ LMUJ7MslVdI3Q2owmgUZ/Fy0poVlGgpbeQn+PIisQU9fJNzlxa2nKuKg761qI0X/wyLe 5zJg== 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=m7m8q9KXz/KgR48GdKoG1mQChEA4OrmSk08HZlbPDOc=; b=ijL1UmGpt1Nl5iz1D7h0HR0Fu+tBEBs3gfapVQS85f95Z95g5H4xVBtMB04/1i5oIw K8boE+w7jikgAKo+ELZlwmuTv26+m+UT1hTA7ZOKJLp7BNOi4tyOIeRIxAMj73/j/be4 q9xbGvj2vwCgu17d0ZNR5W2KIsAXpw0REoMHfcH8eoXLnwyM9XPL/TfmmH8Y8q/CWHCM DJXuo3zfs2hWDVt7OrGexWw8QU0RlO77e//wLZF12TtVC6PCHKcyNyjoCCCw8sOb7lGt cqswGr60xACfp1rQzorQATVhTXQ0bKgyIlKVohfayXTvwWInqU8Lej7IyBBk1hF6sRts r/ZQ== X-Gm-Message-State: ABuFfojSWwyRrKf+SiHQQJqnvocas/EcuoL676k/pWlNtiP32dsGlRDd vmKxCgNv4vPbaZ/iNgO5oZD8bndZqq420zw5gdo= X-Google-Smtp-Source: ACcGV62a6cQ6v0bjawA+j3BwRljHBzeq9zDOv0RwLzADgCYhhCFm5DYvJKJBXqUaYJgFyhxJZfLvUhsfhbg/y0D7OJE= X-Received: by 2002:ac8:2092:: with SMTP id 18-v6mr32810771qtd.192.1539955283562; Fri, 19 Oct 2018 06:21:23 -0700 (PDT) MIME-Version: 1.0 References: <23400842-E5CB-4251-BFE5-78D524A64012@yahoo.com> In-Reply-To: <23400842-E5CB-4251-BFE5-78D524A64012@yahoo.com> From: Sean Fertile Date: Fri, 19 Oct 2018 09:21:11 -0400 Message-ID: Subject: Re: Reasons to still not build buildworld buildkernel via system-clang --John Baldwin notes one I was unaware of To: marklmi@yahoo.com Cc: chmeeedalf@gmail.com, nwhitehorn@freebsd.org, freebsd-ppc@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2018 13:21:24 -0000 Clang isn't getting the tls model wrong, it actually generates pic code by default as if -fpic were specified. I think the original intent behind switching to pic by default was due to incorrectly thinking gcc was pic by default (I'm not sure if this was meant as only gcc on BSD or gcc on powerpc64 in general), as well as working around some problems that clangs non-pic codegen has/had for the ELF V1 abi. There are some patches on phabricator for switching the default back to non-pic codegen, but they leave the pic default for BSD: https://reviews.llvm.org/D53384 and https://reviews.llvm.org/D53383 According to what you and John are saying the pic default is incorrect for BSD as well. If thats the case please either comment on the reviews to let Stefan know, or let me know here and we can update the patches accordingly. Thanks Sean On Thu, Oct 18, 2018 at 11:27 AM Mark Millard via freebsd-ppc < freebsd-ppc@freebsd.org> wrote: > I described to John Baldwin what I know of for why clang is > not yet appropriate to buildworld buildkernel for powerpc64 > and powerpc: > > QUOTE > Unfortunately, clang is broken in other ways for buildworld > buildkernel use for targeting powerpc64 or powerpc: > > A) it silently ignores __builtin_eh_return(offset,handler) > and so produces system-library code that is broken > relative to handling thrown C++ exceptions. > > B) it produces types of linkage for buildkernel that > FreeBSD does not handle, leading to dynamic loads > of .ko files that crash the system. (Back in clang > 4 days it did not have this problem and I was > running kernels built by clang.) > END QUOTE > > John Baldwin reported back something of which I was unaware: > > QUOTE > It will also get the TLS model wrong for powerpc. Both MIPS and powerpc > have an implicit default to PIC mode and llvm interprets this implicit > PIC to mean that it should use dynamic TLS models (intended for use in > shared libraries) always. GCC only uses dynamic models if -fPIC is > explicitly passed on the command line. I have a hack to force the TLS > model > for static libraries and binaries for MIPS in bsd.*.mk that isn't in-tree, > but it really needs to be fixed in clang and llvm. > END QUOTE > > I wonder if there is anything in llvm's bugzilla about this, or > FreeBSD's bugzilla for that matter. > > Are there other known issues not covered by the above 3? > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > > _______________________________________________ > freebsd-ppc@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ppc > To unsubscribe, send any mail to "freebsd-ppc-unsubscribe@freebsd.org" >