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]) by mx.groups.io with SMTP id smtpd.web11.23361.1684765891014992349 for ; Mon, 22 May 2023 07:31:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eNhbPy8Y; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684765890; 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: in-reply-to:in-reply-to:references:references; bh=aikYoA0ODZo4HDme8/Bpgbyp3xcbMg8uzlK1g8idip4=; b=eNhbPy8YeZpPvG1yqZx8gJjV2IxkA64dSG34+bohNpNIebYGxqEc348/mHzib5WsPzS3IM tKcZuQbfNc/sh8cM5M5MqHv4STkZ5Bb4Fha8biEEuL0g6VZiQDm5nhoK6iIx1rCIeAVJs3 SsDzZ83UKjvOF0ZplGtxaGHBE6E+2l8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-356-720ayTKrPa2Yyr8FPjc9Ww-1; Mon, 22 May 2023 10:31:27 -0400 X-MC-Unique: 720ayTKrPa2Yyr8FPjc9Ww-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 747513C0ED7F; Mon, 22 May 2023 14:31:20 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62F3C1121314; Mon, 22 May 2023 14:31:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 182571800606; Mon, 22 May 2023 16:31:18 +0200 (CEST) Date: Mon, 22 May 2023 16:31:18 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: ardb@kernel.org, Marvin =?utf-8?Q?H=C3=A4user?= , Pawel Polawski , Dongyan Qian , Sunil V L , Baoqi Zhang , Chao Li , Rebecca Cran , Ard Biesheuvel , Zhiguang Liu , Liming Gao , Yuwei Chen , Leif Lindholm , Michael D Kinney , Daniel Schaefer , Bob Feng , Oliver Steffen Subject: Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define Message-ID: References: <20230414080250.1357004-2-kraxel@redhat.com> <18EC1A6E-8B81-4564-83A5-DA8EC2BA54ED@posteo.de> <7twvlm4w6euyc637maj4mqskob5747wfu4tridl4jtxujruegg@r4jyw7vitl3w> MIME-Version: 1.0 In-Reply-To: <7twvlm4w6euyc637maj4mqskob5747wfu4tridl4jtxujruegg@r4jyw7vitl3w> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > > Recent clang does have a '-fdirect-access-external-data' switch which > > should suppress these references, maybe in combination with > > -fvisibility=hidden? > > I'll try that. Works (test patch below for reference). thanks, Gerd diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 503a6687c1f0..f19992f68a84 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -1929,7 +1929,7 @@ RELEASE_CLANGDWARF_X64_CC_FLAGS = DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 "-DEFI RELEASE_CLANGDWARF_X64_DLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_x86_64 -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=small -Wl,--apply-dynamic-relocs RELEASE_CLANGDWARF_X64_DLINK2_FLAGS = DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O3 -fuse-ld=lld -NOOPT_CLANGDWARF_X64_CC_FLAGS = DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -O0 DEF(CLANGDWARF_X64_TARGET) -g +NOOPT_CLANGDWARF_X64_CC_FLAGS = DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -O0 DEF(CLANGDWARF_X64_TARGET) -g -fdirect-access-external-data NOOPT_CLANGDWARF_X64_DLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_x86_64 -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=small -Wl,--apply-dynamic-relocs NOOPT_CLANGDWARF_X64_DLINK2_FLAGS = DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O0 -fuse-ld=lld