Skip to content

Conversation

@saturn691
Copy link
Contributor

Part of #145349. Requires #145358. Required by #146863. Once the mutex has been implemented, we can register functions to be called for exit with atexit.

@llvmbot
Copy link
Member

llvmbot commented Jul 7, 2025

@llvm/pr-subscribers-libc

Author: William Huynh (saturn691)

Changes

Part of #145349. Requires #145358. Required by #146863. Once the mutex has been implemented, we can register functions to be called for exit with atexit.


Full diff: https://github.com/llvm/llvm-project/pull/147290.diff

3 Files Affected:

  • (modified) libc/config/baremetal/aarch64/entrypoints.txt (+1)
  • (modified) libc/config/baremetal/arm/entrypoints.txt (+1)
  • (modified) libc/config/baremetal/riscv/entrypoints.txt (+1)
diff --git a/libc/config/baremetal/aarch64/entrypoints.txt b/libc/config/baremetal/aarch64/entrypoints.txt
index a8e653fdd5159..4c1b33a7b1c0e 100644
--- a/libc/config/baremetal/aarch64/entrypoints.txt
+++ b/libc/config/baremetal/aarch64/entrypoints.txt
@@ -218,6 +218,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.stdlib.abort
     libc.src.stdlib.abs
     libc.src.stdlib.aligned_alloc
+    libc.src.stdlib.atexit
     libc.src.stdlib.atof
     libc.src.stdlib.atoi
     libc.src.stdlib.atol
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index acafef17fa5d1..61a61f02c2095 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -218,6 +218,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.stdlib.abort
     libc.src.stdlib.abs
     libc.src.stdlib.aligned_alloc
+    libc.src.stdlib.atexit
     libc.src.stdlib.atof
     libc.src.stdlib.atoi
     libc.src.stdlib.atol
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 023826f12d723..758d5fe4c3e21 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -218,6 +218,7 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.stdlib.abort
     libc.src.stdlib.abs
     libc.src.stdlib.aligned_alloc
+    libc.src.stdlib.atexit
     libc.src.stdlib.atof
     libc.src.stdlib.atoi
     libc.src.stdlib.atol

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

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

does atexit work on baremetal right now?

@saturn691
Copy link
Contributor Author

Not yet, but once we get #145358 merged we can enable it.

Copy link
Member

@vhscampos vhscampos left a comment

Choose a reason for hiding this comment

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

LGTM as soon as the dependant changes are in.

@saturn691 saturn691 merged commit 35a4d82 into llvm:main Jul 31, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants