This is an archive of the discontinued LLVM Phabricator instance.

[crt][LoongArch] Support LoongArch when building without init_array
AbandonedPublic

Authored by tangyouling on Oct 28 2022, 7:41 PM.

Details

Summary

LoongArch LLVM and GCC are default using init_array, and this logic
is enabled only if CRT_HAS_INITFINI_ARRAY is not defined, so this
change will have no effect by defaul.

Which is controlled by cmake (in crt/CMakeLists.txt). In addition,
other architectures (x86, arm, aarch64, powerpc, riscv and sparc)
do allow such fallback option.

Depends on D136338

Diff Detail

Event Timeline

tangyouling created this revision.Oct 28 2022, 7:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 7:41 PM
tangyouling requested review of this revision.Oct 28 2022, 7:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 7:41 PM
Herald added subscribers: Restricted Project, pcwang-thead. · View Herald Transcript
xen0n added a comment.Oct 28 2022, 8:01 PM

So what's the expected use case then? Are there libc's that are going to benefit from this, or is it just for completeness?

So what's the expected use case then? Are there libc's that are going to benefit from this, or is it just for completeness?

Now there is no actual libc's from which to benefit, just for completeness.

DT_INIT_ARRAY/DT_FINI_ARRAY are enabled by default since https://gcc.gnu.org/r12-1328. I guess Clang has the similar change.

The other architectures have a fallback because they are supported by old GCC and Clang. For us, we don't support old GCC and Clang at all.

And I don't like to provide such a fallback to ancient mechanism in 2022...

DT_INIT_ARRAY/DT_FINI_ARRAY are enabled by default since https://gcc.gnu.org/r12-1328. I guess Clang has the similar change.

The other architectures have a fallback because they are supported by old GCC and Clang. For us, we don't support old GCC and Clang at all.

And I don't like to provide such a fallback to ancient mechanism in 2022...

Yes, let's drop this patch.

MaskRay requested changes to this revision.Oct 28 2022, 11:50 PM
This revision now requires changes to proceed.Oct 28 2022, 11:50 PM
xen0n added a comment.Oct 29 2022, 1:41 AM

Let's not do this then :)

tangyouling abandoned this revision.Nov 1 2022, 5:54 AM