[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-12-01 Thread Fangrui Song via cfe-commits
MaskRay wrote: LGTM https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-29 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-29 Thread via cfe-commits
https://github.com/wangleiat approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-29 Thread Zhao Jiazhong via cfe-commits
zjiaz wrote: FWIW, `mcmodel=medium` option is used in [chromium's build config file](https://source.chromium.org/chromium/chromium/src/+/main:build/config/compiler/BUILD.gn;l=1451?q=mcmodel=chromium%2Fchromium%2Fsrc:build%2F), and now chromium's llvm toolchain has been affected by this issue:

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-24 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining updated https://github.com/llvm/llvm-project/pull/72514 >From 8dd5bebcd4681e5e7849743aba0ce90c2959ee23 Mon Sep 17 00:00:00 2001 From: Weining Lu Date: Thu, 16 Nov 2023 21:57:03 +0800 Subject: [PATCH 1/2] [Driver] Support -mcmodel= for LoongArch 7e42545 rejects

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-23 Thread Lu Weining via cfe-commits
SixWeining wrote: > [gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html) > says > > ‘large (Not implemented yet)’ ‘extreme’ This mode does not limit the size of > the code segment and data segment. The -mcmodel=extreme option is >

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -15,6 +15,15 @@ // RUN: not %clang -### -c --target=aarch64 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s // RUN: not %clang -### -c --target=aarch64 -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=ERR-KERNEL %s // RUN: not %clang

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: [gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html) says ‘large (Not implemented yet)’ ‘extreme’ This mode does not limit the size of the code segment and data segment. The -mcmodel=extreme option is incompatible with

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation , const JobAction , if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation , const JobAction , if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-22 Thread Fangrui Song via cfe-commits
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation , const JobAction , if (CM == "large" && RelocationModel != llvm::Reloc::Static) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-fno-pic"; +} else if

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
SixWeining wrote: > > And AFAIK, gcc side doesn't plan to implement the "large" code model. > > Why did we distinguish "large" and "extreme" in the first place? If we don't > need a different "large" code model then I guess we should make it an alias > of "extreme" for GCC too. @ChenghuaXu

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Xi Ruoyao via cfe-commits
xry111 wrote: > And AFAIK, gcc side doesn't plan to implement the "large" code model. Why did we distinguish "large" and "extreme" in the first place? If we don't need a different "large" code model then I guess we should make it an alias of "extreme" for GCC too.

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
SixWeining wrote: cc @xen0n @xry111 https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Lu Weining (SixWeining) Changes 7e42545 rejects unsupported mcmodel options, but small/medium/large should be supported models for LoongArch. In addition, to be compatible with gcc, mapping some of their values to clang's. The

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Lu Weining (SixWeining) Changes 7e42545 rejects unsupported mcmodel options, but small/medium/large should be supported models for LoongArch. In addition, to be compatible with gcc, mapping some of their values to clang's. The mapping

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
https://github.com/SixWeining created https://github.com/llvm/llvm-project/pull/72514 7e42545 rejects unsupported mcmodel options, but small/medium/large should be supported models for LoongArch. In addition, to be compatible with gcc, mapping some of their values to clang's. The mapping is: