<style>p {margin:0 0 14px 0}.default-font-1734189134165 {font-size: 14px;font-family: 宋体, arial, Verdana, sans-serif}</style><div class="default-font-1734189134165"><span style="text-wrap:wrap;">Package: ghc</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Version: 9.6.6-3</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Severity: important</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Tags: ftbfs help</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">User: </span><a data-auto-link="1" href="mailto:debian-loongarch@lists.debian.org" style="text-wrap:wrap;">debian-loongarch@lists.debian.org</a><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Usertags: loong64</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Hi maintainers,</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">We have cherry-picked 5 commits from upstream for the B26 overflow issue.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The local validation result is: haskell-pandoc build passes by building ghc-->haskell-*-->haskell-pandoc.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">We intend to remove the previous patch backported by fanpeng as follows.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">```</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">ghc (9.6.6-3) unstable; urgency=medium</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;"> [ fanpeng <</span><a data-auto-link="1" href="mailto:fanpeng@loongson.cn" style="text-wrap:wrap;">fanpeng@loongson.cn</a><span style="text-wrap:wrap;">> ]</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;"> * debian/patches/7e2d3eb507da184cf3337d36715fd82a81643d91.patch:</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;"> - upstream fix for loong64 build failures (Closes: #1085966)</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">```</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The attached new patches fix the "B26 overflow" problem by simply adding the -mcmodel=medium moduleflag to LLVM IR. </span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Adding the moduleflag to the generated LLVM IR is already implemented in the ghc upstream, but not in ghc-9.6.6. So we need to backport these patches to ghc-9.6.6 in order to pass the -mcmodel=medium moduleflag to the LLVM </span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">IR. In addition, for the behavior “pass -mcmodel=medium moduleflag to LoongArch's LLVM </span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">IR”, we have implemented the code, and we have pushed the patch to ghc upstream already, so what we are doing this time is just backporting.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">A few of our guidelines for submitting these patches are as follows, in order of priority.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">1. Don't modify public Functionality, such as Functionality of other architectures except LoongArch.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">2. Backporting code directly from upstream to ghc-9.6.6, try not to modify patches.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">3. Backport and modify as little as possible.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The attachment includes 5 patches as follows</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The number at the top of the patch name indicates the order in which the patches should be applied.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Both 1) and 2) are directly backported from upstream. 3) is the changed upstream patch, in fact the content is the same as the upstream patch, but due to the inconsistency between ghc-9.6.6 and ghc upstream's baseline, i.e., the line number of the upstream patch does not match the code in ghc-9.6.6, so we have to manually apply the content of upstream patch. 4) The modified upstream patch (the one we committed to upstream) has the same problem as 3), the line number of the upstream patch does not match the code in ghc-9.6.6, so we have to apply the content of upstream patch manually. And some minor modifications were made. 1)-4) are backported from upstream. Their corresponding upstream commitIDs are stored in the corresponding patch files. 5) is for the debian/rules change</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The details of the attached patches are as follows:</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">- patch: 0001-llvmGen-Add-export-list-to-GHC.Llvm.MetaData.patch</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Cherry-pick from upstream</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The corresponding upstream commit is: fcfc1777c22ad47613256c3c5e7304cfd29bc761</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Role: required to add a moduleflag to the llvm IR.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">- patch: 0002-llvmGen-Allow-LlvmLits-in-MetaExprs.patch</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Cherry-pick from upstream</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The corresponding upstream commit is: 5880fff6d353a14785c457999fded5a7100c9514</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Role: required to add a moduleflag to the llvm IR.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">- patch: 0003-llvmGen-Introduce-infrastructure-for-module-flag-metadata.patch</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Cherry-pick from upstream</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The corresponding upstream commit is: a6a3874276ced1b037365c059dcd0a758e813a5b</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Role: required to add a moduleflag to the llvm IR.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">- patch: 0004-llvmGen-Introduce-infrastructure-for-module-flag-metadata.patch</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Cherry-pick from upstream with little change.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">The corresponding upstream commit is: a6a3874276ced1b037365c059dcd0a758e813a5b</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Role: required to add a moduleflag to the llvm IR.</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">NOTE: We made a little change on the upstream patch because we have to: without the change, a large number of patches would need to be backported to ghc-9.6.6 so that the upstream patch(a6a3874276ced1b037365c059dcd0a758e813a5b) could be backported to ghc-9.6.6, and one of these would break the public interface, i.e., the stack alignment ghc option would be removed. We don't want that happen, so we have to made the change on the upstream patch. </span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">- patch: 0005-rules-pass-mcmodel-medium-option-to-C-files-on-LoongArch</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Not cherry-pick from upstream</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Role: 1) C files in rts are compiled using the C compiler, and 2) when compiling some software, the object files generated by some C code are linked together with the program's object files. This patch passes the -mcmodel=medium option to the C compiler.</span><br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Best regards,</span><br style="text-wrap:wrap;">
<span style="text-wrap:wrap;">Xin Wang</span></div><br><br><i style="font-variant-numeric: normal; font-variant-east-asian: normal; widows: 1; font-family: 宋体, Tahoma; font-size: 14px; line-height: 16.8px;"><font color="#c0c0c0"><span style="font-size: 10pt; font-family: 宋体;">本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部</span><span style="font-size: 10pt; font-family: 宋体;">分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。</span><span lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"> <br>This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. </span></font></i>