This is an archive of the discontinued LLVM Phabricator instance.

[RISCV]: Adjust riscv64 GCC detector to also check for existence of crtbegin.o in the default multilib dir, like most other ports.
AbandonedPublic

Authored by MaskRay on Apr 13 2020, 8:25 AM.

Details

Summary

Adjust riscv64 GCC detector to also check for existence of
crtbegin.o in the default multilib dir, like most other ports.
Fixes FTBFS on riscv64, since on Ubuntu /usr/lib/gcc/riscv64-linux-gnu/10
exists but is empty (gcc-10-base is installed, but libgcc-10-dev is not).

This fixes build failures on debian/ubuntu riscv64 when the gcc-10 is only minimally installed.

Diff Detail

Event Timeline

LocutusOfBorg created this revision.Apr 13 2020, 8:25 AM

I think this makes sense and is correctly implemented but I would like other people to look at this.
It would also benefit from adding tests, rejecting the "minimally installed" scenario and accepting the proper install.

I think this makes sense and is correctly implemented but I would like other people to look at this.
It would also benefit from adding tests, rejecting the "minimally installed" scenario and accepting the proper install.

I don't think we should deal with that scenario, because the "minimally installed" gcc scenario works flawlessly, it happens IIRC when e.g. gcc defaults to VERSION+1 but libgcc is still at the old version.
But in any case, nothing we should worry about, it should work and build correctly in any case!

Could you add a testcase? It will helpful to see what issue fixed in this patch. thanks.

Hello, sorry but I don't really understand how to add a testcase...

eopXD added a comment.Jan 19 2023, 1:10 AM

Hello, sorry but I don't really understand how to add a testcase...

LLVM_DEBUG() and llvm::dbgs() under llvm/Support/Debug.h can help you emit any debug log. Under a test case you can use ; REQUIRES: asserts to catch these debug logs under Debug mode. Hope this can help you on this.

lenary removed a subscriber: lenary.Jan 19 2023, 2:10 AM
rkruppe removed a subscriber: rkruppe.Jan 19 2023, 9:58 AM

this is not needed anymore, we can close it.

MaskRay commandeered this revision.EditedAug 25 2023, 9:53 AM
MaskRay added a reviewer: LocutusOfBorg.

I wish that we have more descriptions of the environment and how this works, but I'll close this as instructed for now.
These subtle changes need testing.

MaskRay abandoned this revision.Aug 25 2023, 9:54 AM
evandro removed a subscriber: evandro.Aug 25 2023, 2:02 PM