From nobody Mon Feb 9 19:52:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com ARC-Seal: i=1; a=rsa-sha256; t=1566404066; cv=none; d=zoho.com; s=zohoarc; b=Rj97IWijvGq/6Ew1+CTvm1OrciZZv18unb3PdUrnqDzkHgXOlq92Tc+YMckcN7dyQjA0ha7L3L4KyEncuK/xAShPC90svyVlGZ7/FGrHQQ0wF2E8XAr+etjEABfjF5IYz/ce+3QEVB4dH6AOBxtWUSs76OBEFhV3IwaK9eEp1Kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404066; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8wmzrOscq3CPcUBTqUCrqDa05RNXc349ZrMbfIW6zIk=; b=BqACfnW3iaCmCvNnFwC8RQkBF8yg1HhP7XwY2gpgIvJzBZA+Rdw2o6SEyoDxuMf4yUAIG0KdAVVw66WIbjwt2rPOZkyEUJ1CoOnnxXXsYWREVt81UGAmhK1eR3JkAMoFRwM2qJpgaiwWpETEXWIyyDdQAjgrfkRmX1lijVdEOZk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566404066008155.83178596887308; Wed, 21 Aug 2019 09:14:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9512302C074; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85E7B17D39; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4D925180BAA1; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEEAC016890 for ; Wed, 21 Aug 2019 12:14:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B8E160623; Wed, 21 Aug 2019 16:14:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4607360603 for ; Wed, 21 Aug 2019 16:14:11 +0000 (UTC) Received: from mta-01.yadro.com (mta-02.yadro.com [89.207.88.252]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC25881F13 for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CA5C842EE4 for ; Wed, 21 Aug 2019 16:13:55 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NB5H6TacNfLE for ; Wed, 21 Aug 2019 19:13:54 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 0C86A42ED2 for ; Wed, 21 Aug 2019 19:13:54 +0300 (MSK) Received: from localhost (172.17.128.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Aug 2019 19:13:53 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1566404034; x=1568218435; bh=oTqyWWU9rrXRDR2cij/M/rzL3N54g2OnyjA hXBgTiPA=; b=osMN5/85nYMDazXTKaNdHtiqtaqECDowtRY0rDHVOGZ6mqDdMED 7P1Rb24falHLSbWb5L4aF+T8RcTzcn/DS5mhRKApqIrbohQpKFQFpyOS+BpU4lIv e8b6Nvq38/6GlVoW3ThOz5jaeISCSPikHY69rmpWb/KWTTpd6wPsTJR0= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:21 +0300 Message-ID: <20190821161323.1583-10-r.bolshakov@yadro.com> In-Reply-To: <20190821161323.1583-1-r.bolshakov@yadro.com> References: <20190821161323.1583-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.128.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, ACL 264 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 21 Aug 2019 16:14:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 21 Aug 2019 16:14:02 +0000 (UTC) for IP:'89.207.88.252' DOMAIN:'mta-02.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_NONE, SPF_PASS) 89.207.88.252 mta-02.yadro.com 89.207.88.252 mta-02.yadro.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 09/11] tests: Use flat namespace on macOS X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Aug 2019 16:14:25 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Test executables and mocks have assumption that any symbol can be replaced with LD_PRELOAD. That's not a case for macOS unless flat namespace is used, because every external symbol reference records the library to be looked up. And the symbols cannot be replaced unless dyld interposing is used. Setting DYLD_FORCE_FLAT_NAMESPACE changes symbol lookup behaviour to be similar to Linux dynamic linker. It's more lightweight solution than explicitly decorating all mock symbols as interpositions and building libvirt as interposable dynamic library. This fixes vircryptotest and allows to proceed other tests that rely on mocks a little bit further. Signed-off-by: Roman Bolshakov --- tests/testutils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testutils.h b/tests/testutils.h index 7660101991..b46bc86d84 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -119,9 +119,12 @@ int virTestMain(int argc, =20 #ifdef __APPLE__ # define PRELOAD_VAR "DYLD_INSERT_LIBRARIES" +# define FORCE_FLAT_NAMESPACE \ + setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1); # define MOCK_EXT ".dylib" #else # define PRELOAD_VAR "LD_PRELOAD" +# define FORCE_FLAT_NAMESPACE # define MOCK_EXT ".so" #endif =20 @@ -141,6 +144,7 @@ int virTestMain(int argc, return EXIT_FAILURE; \ } \ setenv(PRELOAD_VAR, newenv, 1); \ + FORCE_FLAT_NAMESPACE \ execv(argv[0], argv); \ } \ } while (0) --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list