From nobody Wed Dec 22 10:06:39 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9D0241906D92; Wed, 22 Dec 2021 10:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JJprd4yh3z4Yq7; Wed, 22 Dec 2021 10:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937611B462; Wed, 22 Dec 2021 10:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BMA6dcL092964; Wed, 22 Dec 2021 10:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BMA6d2W092963; Wed, 22 Dec 2021 10:06:39 GMT (envelope-from git) Date: Wed, 22 Dec 2021 10:06:39 GMT Message-Id: <202112221006.1BMA6d2W092963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 21c171475da0 - stable/12 - Add clzdi2 to libsa on mips and powerpc, when built with gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 21c171475da0cc930a3bf802e2acb48ba1fb2c71 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640167602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=huReb9CUpxF6Jj7F+GoIdLSSEhpYeMejqCugRXtbaGw=; b=fRdK5uQUrqW8g7VKPpeRWpo4li7tDeMm1avc8TdCx6APi7rUebDGJe3WDEC0kTdG6CgvPJ qe1ogHdp9gGPnA6sCBFBvTnxvemYvPHxd9sQ1SRuVxhyXo7m2+rkUNjYVNgJVwUQJXxWp6 RNxVOZToI3zbd0OwRkK9/5YsULzcdPuSKl4IjgeijQolACWBy7rieUC2N36WRXmAO743/S GeqSuHH4LbYwTwp8eaTYE2pV8f1YBiJcxmGkDE809OC+3gl+uWJysNkl6JwLuSfx78k1D2 l0R3+99kKyyswGS1N3OIlUVxIlwFuZSXoLbk/AZu6ZGQn1iH0qo5wLYWLY3kIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640167602; a=rsa-sha256; cv=none; b=X3Vu43djHnhn/Jbhihpf7o4tCWu053B9TjmLY6Jd6UZtOaNZPxtkjCN2/ZZaVmMzg/tciB wr2oD27y6JEVYXw+n7QfTznwcFe5bixg+5lMManl4xrtnPvFXrWCAF1DQpOqdkzTFXr/Tw Nf0mWyHivMORZBdkhPXPNeuvWVoiwH9fPaW0MDK1O6CHtw7svonS7quVnl1cGgiLdmUDQK 0YVKs9F0zNVgY56Dl7Z9jGjrHx+0MwqWhLsRqt2zzRQt9bGETEwwmN9Zdwku2/ZtCZtlqR f62Y6zn1kvqJQg10dTrqitKXjiCEnZGkBfx3sd0c8LmhwExxx+ZR2X9k71VkoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=21c171475da0cc930a3bf802e2acb48ba1fb2c71 commit 21c171475da0cc930a3bf802e2acb48ba1fb2c71 Author: Dimitry Andric AuthorDate: 2021-12-13 15:52:55 +0000 Commit: Dimitry Andric CommitDate: 2021-12-22 10:01:31 +0000 Add clzdi2 to libsa on mips and powerpc, when built with gcc Otherwise, several programs that link to libsa will fail with: /usr/obj/usr/src/powerpc.powerpc/stand/libsa/libsa.a(umoddi3.o): In function `__umodXi3': /usr/src/contrib/llvm-project/compiler-rt/lib/builtins//int_div_impl.inc:48: undefined reference to `__clzdi2' /usr/src/contrib/llvm-project/compiler-rt/lib/builtins//int_div_impl.inc:48: undefined reference to `__clzdi2' /usr/obj/usr/src/powerpc.powerpc/stand/libsa/libsa.a(udivdi3.o): In function `__udivXi3': /usr/src/contrib/llvm-project/compiler-rt/lib/builtins//int_div_impl.inc:19: undefined reference to `__clzdi2' /usr/src/contrib/llvm-project/compiler-rt/lib/builtins//int_div_impl.inc:19: undefined reference to `__clzdi2' This is because base gcc 4.2 fails to inline the __builtin_clzll() calls in int_div_impl.inc. --- stand/libsa/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index e70a5ffb7a82..04d93525c6ad 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -66,6 +66,11 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/ # __clzsi2 and ctzsi2 for various builtin functions SRCS+= clzsi2.c ctzsi2.c +.if ${COMPILER_TYPE} == "gcc" && \ + (${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc") +# prevent "undefined reference to `__clzdi2'" in umoddi3.o and udivdi3.o +SRCS+= clzdi2.c +.endif # Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c