From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web11.28840.1678091880668535800 for ; Mon, 06 Mar 2023 00:38:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=guEWKhdt; spf=pass (domain: 9elements.com, ip: 209.85.208.46, mailfrom: patrick.rudolph@9elements.com) Received: by mail-ed1-f46.google.com with SMTP id s11so35131424edy.8 for ; Mon, 06 Mar 2023 00:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1678091879; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GGrOPADo27bvMwF2l/1agEDJkim9oKnaUda2amdDhPo=; b=guEWKhdtjlxDMqgiLzGP9T54TESa7+4w+JAEa3oxzRrLKTBeZliQppnPk3NUMePZF2 2pDIeI/TIS451vHqlD00pvInITlg7MUE3pelYxOZW/j3Z/K/QUMMNFwLj7xhcsaDD7Q0 nVJZGCw4DctzCOkRUV4fgzbWdD2LUY4RLamvZPyjd4t8fXZTJ8YXBp3FXx5A7JaIADL6 pN8Qi4dF9avL7OwQk/wAxXbkK2RorHoBvX2zGYUt74e9XLKSBYv+FLu2HRgGvnZhu+bv gDiEL+UxIeClheNPJeJSNinXmkjEPUr39Tt6qtiqHFdb489YhOBPIOOlk+f+ikc+RKve pCdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678091879; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GGrOPADo27bvMwF2l/1agEDJkim9oKnaUda2amdDhPo=; b=VD9/a22v7wkGYJCWYJQtgVeP3+Re32OqK3zYVQw7tOZyVjSLpcsRIUH3NPLEGq4II9 sbhxrwUvIhWoEGEi+OnclyF56bVnW4Mv68ziK6o5sCLpdcAxglIHg8lzi8PxOvrxoH6Q rMaWkH6LtdJZcrTVcQo2o4N2L3o59UfgPPr2ILnz7VeelWZMRSUgnpzX7S4d7fgg2NZO dOEKz9uzbzILwkEzGGqInoSd5p3RPR88yvhbfEx88EpB0pZLfQMxnw7ykK+fzrvfTYqI cDvJ4gxIANQrvP2juEfSq7lF+iRCAq3OocZwq4SmLhRzawV/SeHTDtFiPAOmL6/qrxq7 e97A== X-Gm-Message-State: AO0yUKXZl+kXx+M6KQ7qZl3PE5PojVLZD7kSqcOMsJFa6WHJcpksFAXm WkSFLOIbCXPTor0GFH2mBGTcjJm52qRrVsOSC+4= X-Google-Smtp-Source: AK7set/5SzvXHsAj+2S9HHnYvhmelOXxB82/H1A8ocgCC5wmigGH+UHVdwiaF02DZncnGFXRLZQpVw== X-Received: by 2002:a17:906:fe07:b0:8f2:da10:c69e with SMTP id wy7-20020a170906fe0700b008f2da10c69emr14044839ejb.52.1678091878984; Mon, 06 Mar 2023 00:37:58 -0800 (PST) Return-Path: Received: from fedora.. (ip-095-222-150-251.um34.pools.vodafone-ip.de. [95.222.150.251]) by smtp.gmail.com with ESMTPSA id hy3-20020a1709068a6300b008e57b5e0ce9sm4250515ejc.108.2023.03.06.00.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 00:37:58 -0800 (PST) From: "Patrick Rudolph" To: Cc: devel@edk2.groups.io, guo.dong@intel.com, ray.ni@intel.com, sean@starlabs.systems, james.lu@intel.com, gua.guo@intel.com Subject: [PATCH 1/3] BaseTools/Conf/tools_def: Fix linking using CLANGDWARF_IA32_X64 Date: Mon, 6 Mar 2023 09:37:55 +0100 Message-Id: <20230306083757.26274-1-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The clang toolchain might default to fPIE/fPIC, which prevents lld from linking the objects into a binary. Specify -fno-pie -fno-pic as done on GCC to fix linking. Test: Building the Universal Payload using the command 'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually works. Signed-off-by: Patrick Rudolph Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4356 --- BaseTools/Conf/tools_def.template | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 471eb67c0c..9b59bd75c3 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2888,7 +2888,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS =3D -Wl,--d= efsym=3DPECOFF_HEADER_SIZE=3D0x22 *_CLANGDWARF_IA32_RC_PATH =3D DEF(CLANGDWARF_IA32_PREFIX)llvm= -rc=0D =0D *_CLANGDWARF_IA32_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) -m32 -fno-= lto DEF(CLANG38_IA32_TARGET)=0D -*_CLANGDWARF_IA32_ASLDLINK_FLAGS =3D DEF(CLANGDWARF_IA32_X64_ASLDLIN= K_FLAGS) -Wl,-m,elf_i386 -fuse-ld=3Dlld=0D +*_CLANGDWARF_IA32_ASLDLINK_FLAGS =3D DEF(CLANGDWARF_IA32_X64_ASLDLIN= K_FLAGS) -Wl,-m,elf_i386 -fuse-ld=3Dlld -no-pie=0D *_CLANGDWARF_IA32_ASM_FLAGS =3D DEF(GCC5_ASM_FLAGS) -m32 -march= =3Di386 DEF(CLANG38_IA32_TARGET)=0D *_CLANGDWARF_IA32_RC_FLAGS =3D DEF(GCC_IA32_RC_FLAGS)=0D *_CLANGDWARF_IA32_OBJCOPY_FLAGS =3D=0D @@ -2897,17 +2897,17 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS =3D -Wl,-= -defsym=3DPECOFF_HEADER_SIZE=3D0x22 *_CLANGDWARF_IA32_ASLPP_FLAGS =3D DEF(GCC_ASLPP_FLAGS) DEF(CLANG3= 8_IA32_TARGET)=0D *_CLANGDWARF_IA32_VFRPP_FLAGS =3D DEF(GCC_VFRPP_FLAGS) DEF(CLANG3= 8_IA32_TARGET)=0D =0D -DEBUG_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -m32 = -Oz -flto -march=3Di586 DEF(CLANG38_IA32_TARGET) -g -malign-double=0D +DEBUG_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -fno-= pic -fno-pie -m32 -Oz -flto -march=3Di586 DEF(CLANG38_IA32_TARGET) -g -mali= gn-double=0D DEBUG_CLANGDWARF_IA32_DLINK_FLAGS =3D DEF(CLANGDWARF_IA32_X64_DLINK_F= LAGS) -flto -Wl,-O3 -Wl,-melf_i386 -Wl,--oformat,elf32-i386=0D -DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O3 -fuse-ld=3Dlld=0D +DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O3 -fuse-ld=3Dlld -no-pie=0D =0D -RELEASE_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -m32 = -Oz -flto -march=3Di586 DEF(CLANG38_IA32_TARGET) -malign-double=0D +RELEASE_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -fno-= pic -fno-pie -m32 -Oz -flto -march=3Di586 DEF(CLANG38_IA32_TARGET) -malign-= double=0D RELEASE_CLANGDWARF_IA32_DLINK_FLAGS =3D DEF(CLANGDWARF_IA32_X64_DLINK_F= LAGS) -flto -Wl,-O3 -Wl,-melf_i386 -Wl,--oformat,elf32-i386=0D -RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O3 -fuse-ld=3Dlld=0D +RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O3 -fuse-ld=3Dlld -no-pie=0D =0D -NOOPT_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -m32 = -O0 -march=3Di586 DEF(CLANG38_IA32_TARGET) -g -malign-double=0D +NOOPT_CLANGDWARF_IA32_CC_FLAGS =3D DEF(CLANG38_ALL_CC_FLAGS) -fno-= pic -fno-pie -m32 -O0 -march=3Di586 DEF(CLANG38_IA32_TARGET) -g -malign-dou= ble=0D NOOPT_CLANGDWARF_IA32_DLINK_FLAGS =3D DEF(CLANGDWARF_IA32_X64_DLINK_F= LAGS) -Wl,-O0 -Wl,-melf_i386 -Wl,--oformat,elf32-i386=0D -NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O0 -fuse-ld=3Dlld=0D +NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS =3D DEF(CLANGDWARF_IA32_DLINK2_FLAG= S) -O0 -fuse-ld=3Dlld -no-pie=0D =0D ##########################=0D # CLANGDWARF X64 definitions=0D --=20 2.39.1