From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39276C2B9F7 for ; Tue, 25 May 2021 00:55:34 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8958C613BF for ; Tue, 25 May 2021 00:55:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8958C613BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D196482EC5; Tue, 25 May 2021 02:54:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="KIW2PU4h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D94082F0A; Tue, 25 May 2021 02:54:55 +0200 (CEST) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 35C5582F13 for ; Tue, 25 May 2021 02:54:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x832.google.com with SMTP id 1so22058517qtb.0 for ; Mon, 24 May 2021 17:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xKukHPMR/iipTQ6zrszPqmbiBtZe215iY00J6k4dFdQ=; b=KIW2PU4hr+4pxgSTY4HdE8NRuu/gJLUiuROdiEFGE/e20IIgPQWsQ0FxDpEjolnpuq P7P8BfhboaeLZ8SM699JLtldrtWINNyNPWstWVQvlSp9HqFxxkUyU+8Qc5XwRHgwZaYw OD/4ISOwccQrH4O0KDP67reoyrzyw3i7u5FOw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xKukHPMR/iipTQ6zrszPqmbiBtZe215iY00J6k4dFdQ=; b=gAZj1f0UpMogpx+LDWXD9zweqn6muRJ4O+9CgIAjc3Fg8FHyzQ67g6CR7YKAkEXI/1 4rQF63+LFqbeZuM3UFgssnqmQ65LlcIklyv5orMHXMwkc45o/El2QVQ0PqAqrUpU+oaN inF0/oOVr0mzS+3lct4CnRbWbD4tecDBV/rUQXsGYi1/32A7iBt97wsD42WJb2wcDIwM zYZeEE72zAid4p/2jU3CKI1gtrd1ct1cXFeeE5VONYC1iTYAGe/ACarbD6bTnxWVuoB0 J0nNKyaT+boAn6upwvcvu0/WGyXtJFNtxL82WJ7bdC5A0jTs2Tm2lrJWcdFp1ajNtTE1 U30A== X-Gm-Message-State: AOAM531bg8f9SzJvwDKK734NlaFBMEoSDvdPXEodB0G4XbMNHQDEYWFD ByVDJSnoSsug51rkTvLEANkGpg== X-Google-Smtp-Source: ABdhPJw/2w33CaRdOGfkQ5V2epitE2E3RLwmDlmC+JwT1Y+FjtMoyJeMVS7ahN2v4al7+MMfXXD0AA== X-Received: by 2002:ac8:5846:: with SMTP id h6mr29060664qth.215.1621904085677; Mon, 24 May 2021 17:54:45 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5ce8-9acb-4a3a-47a0.res6.spectrum.com. [2603:6081:7b01:cbda:5ce8:9acb:4a3a:47a0]) by smtp.gmail.com with ESMTPSA id x28sm11810120qtm.71.2021.05.24.17.54.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 May 2021 17:54:45 -0700 (PDT) Date: Mon, 24 May 2021 20:54:42 -0400 From: Tom Rini To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: u-boot@lists.denx.de, Simon Glass , Heiko Schocher , Patrick Delaunay , Patrice CHOTARD , Miquel Raynal , Pali =?iso-8859-1?Q?Roh=E1r?= , Stefan Roese , Heinrich Schuchardt , Alexander Graf , Marek Vasut , Neil Armstrong , Ryder Lee , Adam Ford , Bin Meng , Harald Seiler , Tim Harvey Subject: Re: [PATCH u-boot v4 06/36] string: make memcpy(), memset(), memcmp() and memmove() visible for LTO Message-ID: <20210525005442.GL17669@bill-the-cat> References: <20210520112425.25166-1-marek.behun@nic.cz> <20210520112425.25166-7-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qVhGS7jFLE0UpPL1" Content-Disposition: inline In-Reply-To: <20210520112425.25166-7-marek.behun@nic.cz> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean --qVhGS7jFLE0UpPL1 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 20, 2021 at 01:23:55PM +0200, Marek Beh=FAn wrote: > It seems that sometimes (happening on ARM64, for example with > turris_mox_defconfig) GCC, when linking with LTO, changes the symbol > names of some functions, for example lib/string.c's memcpy() function to > memcpy.isra.0. >=20 > This is a problem however when GCC for a code such as this: > struct some_struct *info =3D get_some_struct(); > struct some struct tmpinfo; > tmpinfo =3D *info; > emits a call to memcpy() by builtin behaviour, to copy *info to tmpinfo. >=20 > This then results in the following linking error: > .../lz4.c:93: undefined reference to `memcpy' > .../uuid.c:206: more undefined references to `memcpy' follow >=20 > GCC's documentation says this about -nodefaultlibs option: > The compiler may generate calls to "memcmp", "memset", "memcpy" and > "memmove". These entries are usually resolved by entries in libc. > These entry points should be supplied through some other mechanism > when this option is specified. >=20 > Make these functions visible by using the __used macro to avoid this > error. >=20 > Signed-off-by: Marek Beh=FAn > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! --=20 Tom --qVhGS7jFLE0UpPL1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmCsStIACgkQFHw5/5Y0 tyzebgv+J4gyAZI/EnT59iqLwvsNODn4AMtprLv4HEQW9LLRwT+SSBUNCb4g0ivb eIadYDSi25a6iTmHahYO6BTbFXkDblZY0gnw7DEPKecIDtI8/kxIq+zk5qMgLSDu w7FSQJbUuiS67tg+J3kLHSj4+gxPE583+RD+6g2+AsHxP5/IOnniJCyWhLkWpbG8 iHupXcy8JsjJadNy0a2C4vGxde+Zdhs7m3xdLhnWYILZUnZjpzKLKrnXus2kp5C1 psrlQxEnTDGIf3sT+Y7gxWixQ6tQWIn8JFPbYupxVcb3GMc6F/w4l3NxaHl/gl5s u3vWyWEM1plI0dd81PkmIwowGYMe7ChT5SrWLxh4aIETQqatOBwBTVx6FkZ9+qAJ EN1dRKXn6VFhvd35XlXUey4uOSCLDqkHt/d51IjuGBqjkjLKM4fbad/zC1rfQ/Xx HguYkSKEQ3dT5PH0SYVfoTQY7ef7qiKSQZhMLSSUniZjR5kUH2i5jmaTV7O/i7oN /AgU4jZ1 =bSXO -----END PGP SIGNATURE----- --qVhGS7jFLE0UpPL1--