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

Add LLVM-libc #32500

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add LLVM-libc #32500

wants to merge 3 commits into from

Conversation

alfredfo
Copy link
Contributor

No description provided.

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @alfredfo
Areas affected: ebuilds
Packages affected: sys-apps/libc-hdrgen, sys-devel/gnuconfig, sys-libs/llvm-libc

sys-apps/libc-hdrgen: @gentoo/proxy-maint (new package)
sys-devel/gnuconfig: @gentoo/base-system
sys-libs/llvm-libc: @gentoo/proxy-maint (new package)

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added new package The PR is adding a new package. assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. labels Aug 28, 2023
@alfredfo alfredfo force-pushed the gentoo-llvm-libc branch 3 times, most recently from 6c03444 to a38d8fc Compare August 28, 2023 21:39
Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

Also, please don't add old snapshots. They're going away anyway.

sys-apps/libc-hdrgen/libc-hdrgen-18.0.0.9999.ebuild Outdated Show resolved Hide resolved
sys-devel/llvm:${LLVM_MAJOR}
"

LLVM_COMPONENTS=( llvm libc cmake )
Copy link
Member

Choose a reason for hiding this comment

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

Do you really have to build it via LLVM? That sounds like a major bad design.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope GCC works too, but I thought so at first because some code relies on Clang internals (apparently same for GCC). I'll remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, do you mean llvm/ as root source directory? Yes, I am pretty sure. Also tells you to do that in docs.

From b0fbd0b9c6cc4453e37fd2253221473a34549437 Mon Sep 17 00:00:00 2001
From: Alfred Persson Forsberg <cat@catcream.org>
Date: Wed, 2 Aug 2023 02:37:38 +0200
Subject: [PATCH] config.sub: add LLVM libc support
Copy link
Member

Choose a reason for hiding this comment

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

Is that an upstream patch?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we really need to agree with the LLVM people on this and then send it upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I asked upstream about this and they said -llvm is fine for now. I'll ask again and try to get this upstreamed asap

Copy link
Member

Choose a reason for hiding this comment

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

Any update on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sent a message on #libc now, also mentioned that every autotools based build is currently broken due to "unknown system". I guess I'll wait for a code owner to tell if '-llvm' is fine for fullbuild mode.

Copy link
Contributor Author

@alfredfo alfredfo Oct 31, 2023

Choose a reason for hiding this comment

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

https://lists.gnu.org/archive/html/config-patches/2023-10/threads.html#00004 <- waiting for another response

Also merged llvm/llvm-project@d2f9268 and got code owner to agree on arch-vendor-kernel-llvm as triplet.

I guess we just wait for gnuconfig. @mgorny

@alfredfo
Copy link
Contributor Author

alfredfo commented Aug 29, 2023

@mgorny:

Also, please don't add old snapshots. They're going away anyway.

Aha okay, I just took the ones listed in llvm.org.eclass.

For new packages, should I only add the latest snapshot?

@mgorny
Copy link
Member

mgorny commented Aug 29, 2023

Yes. Ideally start with getting 9999 right. I'm going to add a new snapshot today.

@alfredfo alfredfo force-pushed the gentoo-llvm-libc branch 5 times, most recently from e953912 to dbbc095 Compare August 30, 2023 10:47
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-08-30 11:05 UTC
Newest commit scanned: dbbc095
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/0ba425bf94/output.html

sys-apps/libc-hdrgen/libc-hdrgen-18.0.0.9999.ebuild Outdated Show resolved Hide resolved

# This is only used for targeting libc/ headers in the current llvm-project directory
# Crossdev has already handled the headers for us
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=$(is_crosspkg OFF ON)
Copy link
Member

Choose a reason for hiding this comment

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

How does that actually work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/llvm/llvm-project/blob/6af39d914c8377241b44f4e2fdd75b5ffff9c882/compiler-rt/lib/scudo/standalone/CMakeLists.txt#L174

Crossdev already installs the headers when emerging libc with USE=headers-only.

This option should probably be called -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC_HEADERS_IN_TREE instead, or something shorter.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-09-19 03:36 UTC
Newest commit scanned: b2a4b87
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/d9762e9a5f/output.html

# CMake target to install libc-hdrgen only.
-DBUILD_SHARED_LIBS=OFF

-DLLVM_INCLUDE_TESTS=$(usex test)
Copy link
Member

Choose a reason for hiding this comment

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

What's the purpose of this if you aren't running tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added just for completeness, I'll remove this for now

)
fi

cmake_src_configure
Copy link
Member

Choose a reason for hiding this comment

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

CMake Error at CMakeLists.txt:245 (add_subdirectory):
add_subdirectory given source
  "/tmp/portage/sys-libs/llvm-libc-18.0.0_pre20231013/work/runtimes/../llvm/utils/llvm-lit"
  which is not an existing directory.

After adding the directory:

CMake Error at /tmp/portage/sys-libs/llvm-libc-18.0.0_pre20231013/work/libc/cmake/modules/LLVMLibCLibraryRules.cmake:110 (add_library):
  No SOURCES given to target: libc_for_scudo_integration_test
Call Stack (most recent call first):
  /tmp/portage/sys-libs/llvm-libc-18.0.0_pre20231013/work/libc/test/integration/scudo/CMakeLists.txt:12 (add_entrypoint_library)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above, will take another look once the gnuconfig stuff has been worked out

Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
alfredfo and others added 2 commits October 16, 2023 21:29
Co-authored-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-10-16 19:35 UTC
Newest commit scanned: 95d2878
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/e9b1a28575/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-10-16 19:50 UTC
Newest commit scanned: 6f43b00
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/97bdd17962/output.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). new package The PR is adding a new package. no bug found No Bug/Closes found in the commits.
Projects
None yet
5 participants