From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.28192.1655455316498480717 for ; Fri, 17 Jun 2022 01:41:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=bIxh2Z2O; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: n.jayaprakash@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655455316; x=1686991316; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sTP6vTCxWUVGc7O56RSiKKoNbI6WycLaUzzYExU48AQ=; b=bIxh2Z2OTajDJEvEwxqYpaETVvCcJs1eyd7tBvqka1diD6PX/EyrnHH5 twF2g8s+mDeYvrM4IJ50QGOvW4VWjX0kZRhnLa667rfCjixyS3aMdFB3X ceJyugLLd4cLxRAz/X4LyZ2PNMCfE0Wjdi0skVw7l0LsXBl46J3gVMBub yP7IG5K9BPWfoM8ptXFj28oRmi28dF9CJooCN6s5BTO4UDj2Rr5rJA/sM 16CjpMOHqaECtUbEf5T1SR4h8UJW3zBPI5W/wVnSxcffeyH3Nn3uCPcOC X8Vcd5nAIbGdrhNXFbcXCFC/zSU3v/XmJ7aEsh4SP8JpreYrhDj2EKCv6 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304907072" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304907072" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 01:41:56 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="641952031" Received: from njayapra-mobl1.gar.corp.intel.com ([10.215.203.157]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 01:41:53 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Michael D Kinney , Rebecca Cran , Jayaprakash N Subject: [edk2-libc Patch 1/1] edk2-libc/StdLib : Changes to Std LibC to facilitate 32 bit GCC builds Date: Fri, 17 Jun 2022 14:11:35 +0530 Message-Id: <20220617084135.415-2-n.jayaprakash@intel.com> X-Mailer: git-send-email 2.33.0.windows.1 In-Reply-To: <20220617084135.415-1-n.jayaprakash@intel.com> References: <20220617084135.415-1-n.jayaprakash@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3779 This comit fixes the Python interpreter build issues with GCC 32 bit compiler tool chain. The changes are needed in StdLibC as given below * Add __divmoddi4 to Gcc.c produced by newer GCC compilers * Add -fno-lto to IA32 GCC builds of LibC.inf to support use of GCC intrinsics from Gcc.c. * Moved Main/Ia32/ftol2.obj in LibC.inf from binaries section to Sources.IA32 required only for MSFT IA32 compiler tool chain Cc: Michael D Kinney Cc: Rebecca Cran Signed-off-by: Jayaprakash N --- StdLib/LibC/CRT/Gcc.c | 7 +++++++ StdLib/LibC/LibC.inf | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/StdLib/LibC/CRT/Gcc.c b/StdLib/LibC/CRT/Gcc.c index cbf4ec2..bc1a4b2 100644 --- a/StdLib/LibC/CRT/Gcc.c +++ b/StdLib/LibC/CRT/Gcc.c @@ -193,3 +193,10 @@ unsigned long long __umodti3(unsigned long long Dividend, unsigned long long Div return (unsigned long long) Remainder; } + +INT64 __divmoddi4 (INT64 num, INT64 den, INT64 *rem_p) +{ + DEBUG((DEBUG_INFO, "%a:\n", __func__)); + return DivS64x64Remainder (num, den, rem_p); +} + diff --git a/StdLib/LibC/LibC.inf b/StdLib/LibC/LibC.inf index 5bb2053..4771204 100644 --- a/StdLib/LibC/LibC.inf +++ b/StdLib/LibC/LibC.inf @@ -46,7 +46,8 @@ Main/Ia32/fpu_rmode.S | GCC Main/Ia32/isinfl.c Main/Ia32/isnanl.c - + Main/Ia32/ftol2.obj | MSFT + # Compiler helper (C RunTime) functions CRT/Ia32/llmul.c | MSFT # __allmul CRT/Ia32/llshl.c | MSFT # __allshl @@ -88,9 +89,6 @@ [Sources.AARCH64] Main/Arm/flt_rounds.c -[Binaries.IA32] - LIB|Main/Ia32/ftol2.obj|*|MSFT - [Packages] StdLib/StdLib.dec StdLibPrivateInternalFiles/DoNotUse.dec @@ -116,4 +114,5 @@ # [BuildOptions] MSFT:*_*_IA32_CC_FLAGS = /GL- + GCC:*_*_IA32_CC_FLAGS = -fno-lto GCC:*_*_ARM_CC_FLAGS = -fno-lto -- 2.33.0.windows.1