Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cygwin] Cygwin X86ISelLowering.cpp #74978

Closed
wants to merge 1 commit into from

Conversation

xu-chiheng
Copy link

@xu-chiheng xu-chiheng commented Dec 10, 2023

Fix the regression caused by commit c04a05d 2023-08-14, that, in Cygwin, Clang can't bootstrap.

Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
make[1]: *** [CMakeFiles/Makefile2:11572: include/llvm/TargetParser/CMakeFiles/RISCVTargetParserTableGen.dir/all] Error 2
Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
make[2]: *** [include/llvm/IR/CMakeFiles/intrinsics_gen.dir/build.make:311: include/llvm/IR/IntrinsicImpl.inc] Error 127
Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
make[2]: *** [include/llvm/IR/CMakeFiles/intrinsics_gen.dir/build.make:237: include/llvm/IR/IntrinsicEnums.inc] Error 127
make[2]: *** [include/llvm/Frontend/OpenACC/CMakeFiles/acc_gen.dir/build.make:172: include/llvm/Frontend/OpenACC/ACC.inc] Error 127
make[2]: *** [include/llvm/Frontend/OpenMP/CMakeFiles/omp_gen.dir/build.make:121: include/llvm/Frontend/OpenMP/OMP.h.inc] Error 127
make[2]: Leaving directory '/cygdrive/e/Note/Tool/llvm-release-build'
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:11520: include/llvm/Frontend/OpenACC/CMakeFiles/acc_gen.dir/all] Error 2
make[2]: *** [include/llvm/IR/CMakeFiles/intrinsics_gen.dir/build.make:459: include/llvm/IR/IntrinsicsAMDGPU.h] Error 127
Cygwin runtime failure: /cygdrive/e/Note/Tool/llvm-release-build/bin/llvm-min-tblgen.exe: Invalid relocation. Offset 0x7837bccad at address 0x7ff7902c1077 doesn't fit into 32 bits
make[2]: *** [include/llvm/Frontend/OpenMP/CMakeFiles/omp_gen.dir/build.make:172: include/llvm/Frontend/OpenMP/OMP.inc] Error 127
make[2]: Leaving directory '/cygdrive/e/Note/Tool/llvm-release-build'
make[2]: *** [include/llvm/IR/CMakeFiles/intrinsics_gen.dir/build.make:385: include/llvm/IR/IntrinsicsAArch64.h] Error 127
make[2]: Leaving directory '/cygdrive/e/Note/Tool/llvm-release-build'
make[1]: *** [CMakeFiles/Makefile2:11546: include/llvm/Frontend/OpenMP/CMakeFiles/omp_gen.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:11468: include/llvm/IR/CMakeFiles/intrinsics_gen.dir/all] Error 2
[ 9%] Linking CXX executable ../../bin/FileCheck.exe

I have build scripts and patches at https://github.com/xu-chiheng/Note .
I can use the build scripts and patches to build and bootstrap GCC(start from 13.0.0) and Clang/LLVM(start from 16.0.0), using GCC or Clang, on Cygwin and MinGW.
If you have interests, you can look at my other PRs at https://github.com/llvm/llvm-project/pulls/xu-chiheng .

Most patches come from upstream at

https://cygwin.com/git-cygwin-packages/
https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/clang.git;a=summary
git://cygwin.com/git/cygwin-packages/clang.git
https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/llvm.git;a=summary
git://cygwin.com/git/cygwin-packages/llvm.git

https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-clang
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-clang/PKGBUILD

https://src.fedoraproject.org/rpms/llvm.git

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 10, 2023

@llvm/pr-subscribers-backend-x86

Author: 徐持恒 Xu Chiheng (xu-chiheng)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/74978.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86ISelLowering.cpp (+1)
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index d69976342fcbd0..a6e03f23c71729 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -18300,6 +18300,7 @@ unsigned X86TargetLowering::getGlobalWrapperKind(
 
   // The following OpFlags under RIP-rel PIC use RIP.
   if (Subtarget.isPICStyleRIPRel() &&
+      !(Subtarget.isTargetWindowsCygwin() && Subtarget.isTargetWin64()) &&
       (OpFlags == X86II::MO_NO_FLAG || OpFlags == X86II::MO_COFFSTUB ||
        OpFlags == X86II::MO_DLLIMPORT))
     return X86ISD::WrapperRIP;

@xu-chiheng xu-chiheng changed the title [Cygwin] Fix the regression caused by commit c04a05d898982614a2df80d928b97ed4f8c49b60, that, in Cygwin, Clang can't bootstrap. [Cygwin] Dec 18, 2023
@xu-chiheng xu-chiheng changed the title [Cygwin] [Cygwin] Cygwin X86ISelLowering.cpp Dec 18, 2023
@xu-chiheng xu-chiheng force-pushed the cygwin-X86ISelLowering.cpp branch 2 times, most recently from 4813999 to a466a63 Compare December 23, 2023 17:32
Copy link
Collaborator

@asl asl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lacks tests and description what the problem is (e.g. what is the regression)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants