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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ECA8C433EF for ; Thu, 4 Nov 2021 13:33:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B84160FE3 for ; Thu, 4 Nov 2021 13:33:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9B84160FE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:56048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mics2-0002kp-ND for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 09:33:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1micGG-0008Pe-Ms for qemu-devel@nongnu.org; Thu, 04 Nov 2021 08:54:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1micGF-00023t-3S for qemu-devel@nongnu.org; Thu, 04 Nov 2021 08:54:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636030470; 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=GNVdmyBvJ25iGMkzIFiShT7CfytGwYFyADCsCEbFHhE=; b=eWvGQcGGzURNfjwTZpUF9ViXTQCh1oOWv0pCdXgDFxBeRzGiTzhBqZ6osyPIzI5GPWmpti 58cu11SLD2GSqDccA2j0yEFvpXKyW6V3gVe4CE6I6Sxjm/arFcKhRcaiw4QFvpO6U0/Dn0 1T8AzwA+0ULN9LMDB8LaruMZp9eQ7G8= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-0JXG_-d1O8KZQS-wfLiM6w-1; Thu, 04 Nov 2021 08:54:28 -0400 X-MC-Unique: 0JXG_-d1O8KZQS-wfLiM6w-1 Received: by mail-ed1-f71.google.com with SMTP id s12-20020a50dacc000000b003dbf7a78e88so5640974edj.2 for ; Thu, 04 Nov 2021 05:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GNVdmyBvJ25iGMkzIFiShT7CfytGwYFyADCsCEbFHhE=; b=lIi/PNAVhcZxa+QJteI1IqY96nke6YQSp00sGYA0WretgN7Fa3Iym6fJMTi46lG3Cm UbKS/quK7oKOsFhx5Z5TTwZH59+IFgbrbQZfQuT1fkBJCuo1YZ6WxCiqJo/NshxdNj9q DO5rNHWDgvnRLRSpQOoAF4lsath3+Zy31GXNFv0ofc0KSrhdRv4/4LFcpFB19/dP4Mx8 pO3gPdTR+M4cQ0aMJt7pwDyBlMym2N1dhbxUE/PxLURZ8sC+sCxTTk2zSVelmVZPSdJF Dgyr3TSRzh0lNj5XC5Fgo40DF0jCop7LmyPK+3kyg5QaqABWTU2Bc5uM85wBZGJBi/4Z HWLA== X-Gm-Message-State: AOAM530EiJYSDC2Mv5++SUHh9KnKNolZYvDQxvuCxfxuFZZw1a5tycji D56knLfqqLDVthrK3oGLrsIRqlDKnVh6BwT/J5qKPDBudbf4Ayo28tG+qb8Jn+DFGCeW3W7ipTP YMhzBLfNPGpwYGss= X-Received: by 2002:a17:906:6088:: with SMTP id t8mr63498839ejj.537.1636030467413; Thu, 04 Nov 2021 05:54:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj3DCU1X6lnQ5lsT4lZ62RXmN/vNTtcwDlBamAS9WNyMf6JI7uUjcS9Js9vmO57ABLxxhduA== X-Received: by 2002:a17:906:6088:: with SMTP id t8mr63498798ejj.537.1636030467061; Thu, 04 Nov 2021 05:54:27 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id qb21sm2993299ejc.78.2021.11.04.05.54.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Nov 2021 05:54:26 -0700 (PDT) Message-ID: Date: Thu, 4 Nov 2021 13:54:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: more bogus meson warnings To: Peter Maydell References: From: Paolo Bonzini In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.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 Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -54 X-Spam_score: -5.5 X-Spam_bar: ----- X-Spam_report: (-5.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.648, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.093, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 11/4/21 12:02, Peter Maydell wrote: > The link of the test program against libsnappy.a fails because > it is being linked with cc and nothing is putting the C++ stdlib > that libsnappy needs on the link line, so you get errors like: > > /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libsnappy.a(snappy.cc.o): > In function `snappy::internal::WorkingMemory::GetHashTable(unsigned > long, int*)': > (.text+0x15b): undefined reference to `operator new[](unsigned long)' That's interesting. So there was also a bug before moving the test to meson; statically-linked binaries would not use snappy even if linking would be done by a C++ compiler. This should fix it: diff --git a/meson.build b/meson.build index e330438270..cbc5c7a868 100644 --- a/meson.build +++ b/meson.build @@ -197,6 +197,9 @@ add_project_arguments('-iquote', '.', link_language = meson.get_external_property('link_language', 'cpp') if link_language == 'cpp' add_languages('cpp', required: true, native: false) + linker = cxx = meson.get_compiler('cpp') +else + linker = cc endif if host_machine.system() == 'darwin' add_languages('objc', required: false, native: false) @@ -1111,7 +1114,7 @@ if not get_option('snappy').auto() or have_system required: get_option('snappy'), kwargs: static_kwargs) endif -if snappy.found() and not cc.links(''' +if snappy.found() and not linker.links(''' #include int main(void) { snappy_max_compressed_length(4096); return 0; }''', dependencies: snappy) snappy = not_found > There's generally > nothing much the user can do about this, beyond file a bug report with > the distro if they're feeling enthusiastic. It could be filed in snappy as well, but yeah I'm not feeling enthusiastic about that. Besides in this case we're not even using the .pc file, but rather looking for -lsnappy by hand. Paolo