[clang] [compiler-rt] [Driver][OHOS] Fix lld link issue (PR #121575)

2025-01-03 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121575 >From b3ba140c00891c36dc27bbdda23e19089b7a3a2f Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 13:07:24 -0500 Subject: [PATCH] [Driver][OHOS] Fix lld link issue The link error is becasue clang rt

[clang] [compiler-rt] [Driver][OHOS] Fix lld link issue (PR #121575)

2025-01-03 Thread Peng Huang via cfe-commits
https://github.com/phuang edited https://github.com/llvm/llvm-project/pull/121575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-03 Thread Peng Huang via cfe-commits
phuang wrote: I created a new [PR](!https://github.com/llvm/llvm-project/pull/121575) , PTAL. Thanks https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [compiler-rt] [Driver][OHOS] Fix lld link issue (PR #121575)

2025-01-03 Thread Peng Huang via cfe-commits
https://github.com/phuang edited https://github.com/llvm/llvm-project/pull/121575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] ohos: make configure fail if LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is OFF (PR #121575)

2025-01-03 Thread Peng Huang via cfe-commits
https://github.com/phuang created https://github.com/llvm/llvm-project/pull/121575 OHOS driver doesn't support old runtime libraries layout, so make cmake configure report error if LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is OFF. [Driver][OHOS] Fix lld link issue The link error is becasue clang rt

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-03 Thread Peng Huang via cfe-commits
phuang wrote: > We can disable the test on -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF layouts, > but I don't find a lit feature that. It cannot work, becasue in the failed case, llvm runtime `x86_64-unknown-linux-gnu` target is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF`, but at same

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121484 >From 14d95fba0e0142be90d8c72dc8baed7cefc2268d Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 10:21:00 -0500 Subject: [PATCH 1/2] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUN

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121484 >From 14d95fba0e0142be90d8c72dc8baed7cefc2268d Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 10:21:00 -0500 Subject: [PATCH 1/3] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUN

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: Updated the cmake script to output error message if LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is OFF for ohos targets. https://github.com/llvm/llvm-project/pull/121484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121484 >From 14d95fba0e0142be90d8c72dc8baed7cefc2268d Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 10:21:00 -0500 Subject: [PATCH 1/2] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUN

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: To add this cmake configure error, where should I look at? any hint? https://github.com/llvm/llvm-project/pull/121484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: > > Note: OHOS driver doesn't support the old layout, compiler-rt for > > ${arch}-linux-unknown-ohos targets have to be built with > > LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON > > Can we make `cmake` error out if you try to build for `*-linux-unknown-ohos` > with `LLVM_ENABLE_PER_T

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: I created a [PR](https://github.com/llvm/llvm-project/pull/121484) to fix the issue. @nico could you please try it? thanks https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang created https://github.com/llvm/llvm-project/pull/121484 …DIR=OFF The problem is because libclang_rt.builtins-{arch}.a for all the arches will be installed into the same folder with old compiler rt layout (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF) and OHOS driver will

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: Thanks for the repro command. I reproduced the problem and verified it can be fixed with adding `-ohos` suffix. https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: In that case, probably we have to add `-ohos` suffix in [ToolChain::buildCompilerRTBasename()](https://github.com/phuang/llvm-project/blob/main/clang/lib/Driver/ToolChain.cpp#L748) to fix this confliction. WDYT? https://github.com/llvm/llvm-project/pull/120159 __

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-01 Thread Peng Huang via cfe-commits
phuang wrote: I checked the log. And I don't think the failed test is caused by this PR. https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-01 Thread Peng Huang via cfe-commits
phuang wrote: Thanks for reviewing it. Could you please land it for me? Seems I cannot land it. https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-25 Thread Peng Huang via cfe-commits
phuang wrote: > We need a test to clang/test/Driver/ohos.c similar to linux-ld.c > clang_rt.crtbegin.o. > > You can add UNSUPPORTED: system-windows to ohos.c so that we don't need > backslashes. [ohos.c](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/ohos.c#L25 ) already has

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-19 Thread Peng Huang via cfe-commits
phuang wrote: @MaskRay friendly ping. thanks. https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
phuang wrote: > Without a test this should not land. [#118192 > (comment)](https://github.com/llvm/llvm-project/pull/118192#issuecomment-2539595603) Hi @MaskRay could you please suggest how to test the changes? Do you mean add I though ohos.c should already cover it. https://github.com/llvm/

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
https://github.com/phuang edited https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
phuang wrote: > Without a test this should not land. [#118192 > (comment)](https://github.com/llvm/llvm-project/pull/118192#issuecomment-2539595603) Hi @MaskRay could you please suggest how to test the changes? I though `ohos.c` should already cover it. https://github.com/llvm/llvm-project/pu

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/120159 >From db61f4b2fdc31d162a9a3b07e32dae8caa476152 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Mon, 16 Dec 2024 10:07:02 -0500 Subject: [PATCH] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" Thi

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
@@ -745,7 +745,13 @@ std::string ToolChain::buildCompilerRTBasename(const llvm::opt::ArgList &Args, std::string ArchAndEnv; if (AddArch) { StringRef Arch = getArchNameForCompilerRTLib(*this, Args); -const char *Env = TT.isAndroid() ? "-android" : ""; +const cha

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-17 Thread Peng Huang via cfe-commits
https://github.com/phuang edited https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-16 Thread Peng Huang via cfe-commits
phuang wrote: I still cannot repro the problem locally, but base on th log in http://45.33.8.238/linux/155432/step_6.txt . Looks like clang tries to search runtime library at "/usr/local/google/home/thakis/src/llvm-project/out/gn/lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a" (It is th

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2024-12-16 Thread Peng Huang via cfe-commits
https://github.com/phuang created https://github.com/llvm/llvm-project/pull/120159 The problem in original change is because OHOS::getCompilerRT() pickes a wrong builtin runtime (./lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a), if ./lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a d

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-16 Thread Peng Huang via cfe-commits
phuang wrote: I found out how to run the test, but I cannot reproduce the problem with my change. I run the test with below steps: 1: `cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lld"` 2: `ninja -C build` 3: `./build/bin/llvm-lit ./clang/test/Drive

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-16 Thread Peng Huang via cfe-commits
phuang wrote: > are there any prerequisite changes elsewhere that I need to port to it? HI @nico, how to repro the problem locally? Is there a doc for it? or could you please share steps? thanks https://github.com/llvm/llvm-project/pull/118192 ___ cf

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-13 Thread Peng Huang via cfe-commits
phuang wrote: I am out of town this week. I will take a look when I return. https://github.com/llvm/llvm-project/pull/118192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-09 Thread Peng Huang via cfe-commits
phuang wrote: > LGTM Could you please help merge the PR? I don't see how to do it from my side. Thanks. https://github.com/llvm/llvm-project/pull/118192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-08 Thread Peng Huang via cfe-commits
phuang wrote: Thanks for reviewing it. https://github.com/llvm/llvm-project/pull/118192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix lld link issue for OHOS (PR #118192)

2024-12-07 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/118192 >From 206f8f800df7e51648ec00b110f2437dca5a3ff6 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Tue, 15 Oct 2024 13:39:03 -0400 Subject: [PATCH 1/2] Fix build error for OHOS For ohos targets, libclang_rt.builtins

[clang] Fix build error for OHOS (PR #118192)

2024-11-30 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/118192 >From 206f8f800df7e51648ec00b110f2437dca5a3ff6 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Tue, 15 Oct 2024 13:39:03 -0400 Subject: [PATCH] Fix build error for OHOS For ohos targets, libclang_rt.builtins.a,

[clang] Fix build error for OHOS (PR #118192)

2024-11-30 Thread Peng Huang via cfe-commits
https://github.com/phuang edited https://github.com/llvm/llvm-project/pull/118192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix build error (PR #118192)

2024-11-30 Thread Peng Huang via cfe-commits
https://github.com/phuang created https://github.com/llvm/llvm-project/pull/118192 For ohos targets, libclang_rt.builtins.a, clang_rt.crtbegin.o and clang_rt.crtend.o are installed in clang/20/lib/${arch}-unknown-linux-ohos. However OHOS toolchain search them in clang/20/lib/${arch}-linux-ohos