From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6537B210A for ; Sat, 24 Dec 2022 09:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671873423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1WJ5IG512JK4HdlC/w+MEPT5hs4wW6eIO1tcvJBoFHE=; b=F90mZhlT6A4P/+WBvMOsTfUQRosPffV66Drf29IkT+UX9MUmQ9g/eIT8fbMd+eICKynE4k UCrEnwBkD7+8QJEjb/bsx72dapi6ixfbEA4nWwpj2mc+7Oz/s0VsvfXXRH5Y3A+4BifQQB UpjU7T1r5bBMs7kvfBqBZEQQvb27Y/M= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-30-xZZa3sEHMb6J6_4f6Tk1vg-1; Sat, 24 Dec 2022 04:16:59 -0500 X-MC-Unique: xZZa3sEHMb6J6_4f6Tk1vg-1 Received: by mail-ed1-f69.google.com with SMTP id h18-20020a05640250d200b004758e655ebeso4953249edb.11 for ; Sat, 24 Dec 2022 01:16:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1WJ5IG512JK4HdlC/w+MEPT5hs4wW6eIO1tcvJBoFHE=; b=sxxcsL4EW4cDwX2vIU35GCrkoqdtZgKGUrH3CiO+6/fT3kq5U9kmNUy/HbIfeEt6Iq Lb2ZRfQHkplqv+EQF5HKpbo1QSe9khvImaJ7yjYKSvp7aSkmYcC1gf0tPQkO4ie9GuS3 rhC/71ceiNxT/2kKD07t/t4o+scnEuuiSYG5MGcpCPd6vfANHdkaPI2mfDl4gyNACC8m xWhfllV4Hsi54CsrQ4ULgcE7HGdQF6umal9q6+CoXUoWtJmwomio4vmHx4D20bA6y8SE ZJcvlCn46ocSUdSFmBfuNtrOSoGtEFbhPGED1Yxr+hLBTV9xLuqlNmQDcCmPoLrh29g2 2Hig== X-Gm-Message-State: AFqh2komjo5VHE+PKMWprgARndrupeyDmA87TAe3zJLrMFWtFUUzdJSB eEfYXYA5X+0QBnXXuYUv16VfdirgSQJYzwVwbZeaVJeZQi1eWdgpXDcIYXtQivrKjpX2M9hc4Yx wJD0HOqyo/4n+nQ== X-Received: by 2002:a17:906:2813:b0:7c0:f9ef:23a2 with SMTP id r19-20020a170906281300b007c0f9ef23a2mr12170067ejc.30.1671873418351; Sat, 24 Dec 2022 01:16:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxPdiaG4E8UewTBDKGwk+RrHY5iIcLLbOD+rhwdwS97aEIalcuCrM4uQvmfbCxpmo46L3Qww== X-Received: by 2002:a17:906:2813:b0:7c0:f9ef:23a2 with SMTP id r19-20020a170906281300b007c0f9ef23a2mr12170039ejc.30.1671873418109; Sat, 24 Dec 2022 01:16:58 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.googlemail.com with ESMTPSA id gf3-20020a170906e20300b007bff9fb211fsm2323104ejb.57.2022.12.24.01.16.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Dec 2022 01:16:57 -0800 (PST) Message-ID: Date: Sat, 24 Dec 2022 10:16:55 +0100 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides To: Sean Christopherson , Marc Zyngier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Tom Rix , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller , Aaron Lewis , Raghavendra Rao Ananta References: <20221213001653.3852042-1-seanjc@google.com> <20221213001653.3852042-10-seanjc@google.com> From: Paolo Bonzini In-Reply-To: <20221213001653.3852042-10-seanjc@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/13/22 01:16, Sean Christopherson wrote: > Explicitly disable the compiler's builtin memcmp(), memcpy(), and > memset(). Because only lib/string_override.c is built with -ffreestanding, > the compiler reserves the right to do what it wants and can try to link the > non-freestanding code to its own crud. > > /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc': > (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o: > tools/testing/selftests/kvm/lib/string_override.c:15: first defined here > clang: error: linker command failed with exit code 1 (use -v to see invocation) Hmm, that's weird though. I think it's an effect of ifunc and maybe even a linker bug. The patch makes sense anyway. Paolo