Skip to content

[libc] Enable floating point support for baremetal printf#101912

Closed
petrhosek wants to merge 1 commit into
llvm:mainfrom
petrhosek:libc-baremetal-printf-float
Closed

[libc] Enable floating point support for baremetal printf#101912
petrhosek wants to merge 1 commit into
llvm:mainfrom
petrhosek:libc-baremetal-printf-float

Conversation

@petrhosek
Copy link
Copy Markdown
Member

@petrhosek petrhosek commented Aug 4, 2024

It's somewhat common for baremetal projects to use floating point so printf support is actually desirable.

fixes #100816

It's somewhat common for baremetal projects to use floating point so
printf support is actually desirable.
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Aug 4, 2024

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

It's somewhat common for baremetal projects to use floating point so printf support is actually desirable.


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

1 Files Affected:

  • (modified) libc/config/baremetal/config.json (-3)
diff --git a/libc/config/baremetal/config.json b/libc/config/baremetal/config.json
index f0ff268b56275..f5b260d805c93 100644
--- a/libc/config/baremetal/config.json
+++ b/libc/config/baremetal/config.json
@@ -5,9 +5,6 @@
     }
   },
   "printf": {
-    "LIBC_CONF_PRINTF_DISABLE_FLOAT": {
-      "value": true
-    },
     "LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": {
       "value": true
     },

Copy link
Copy Markdown
Member

@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.

This will work, but I will warn you that printf float support will increase binary size significantly.

@jhuber6
Copy link
Copy Markdown
Contributor

jhuber6 commented Aug 5, 2024

This will work, but I will warn you that printf float support will increase binary size significantly.

Yeah, It's disabled on the GPU because it makes compilation take forever even with the long double table turned off. I floated the idea of allowing strfromd to work even w/ it disabled for printf but never got around to it.

@petrhosek
Copy link
Copy Markdown
Member Author

Superseded by #199758.

@petrhosek petrhosek closed this May 27, 2026
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.

[libc] printf doesn't print floating point numbers on cortex-m33

5 participants