This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add a JSON based config option system.
ClosedPublic

Authored by sivachandra on Aug 29 2023, 8:56 PM.

Details

Summary

Few printf config options have been setup using this new config system
along with their baremetal overrides. A follow up patch will add generation
of doc/config.rst, which will contain the full list of libc config options
and short description explaining how they affect the libc.

Diff Detail

Event Timeline

sivachandra created this revision.Aug 29 2023, 8:56 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 29 2023, 8:56 PM
sivachandra requested review of this revision.Aug 29 2023, 8:56 PM
gchatelet added inline comments.Aug 30 2023, 7:56 AM
libc/CMakeLists.txt
103–104

Maybe it's clearer with a direct form "CMake command line option takes precedence over 'config.json' options".

113

typo

libc/cmake/modules/LibcConfig.cmake
27–29

Maybe state in the documentation that the function does nothing if the file is missing.

99–103

This is not super clear, can you rephrase without double negation? Also maybe an exemple would help.

sivachandra marked 4 inline comments as done.

Address comments.

Remove few debug commands.

phosek added inline comments.Aug 31 2023, 12:15 AM
libc/CMakeLists.txt
120

What's the reason for removing the variable from cache?

gchatelet added inline comments.Aug 31 2023, 1:56 AM
libc/cmake/modules/LibcConfig.cmake
27

typo

102

typo existence

104

its

123

?

sivachandra marked 3 inline comments as done.

Fix typos identified by the review.

sivachandra added inline comments.Aug 31 2023, 9:36 AM
libc/CMakeLists.txt
120

I think you saw the previous version which had those commands. I put them in to debug but are removed in the latest version.

libc/cmake/modules/LibcConfig.cmake
123

Didn't understand :)

gchatelet added inline comments.Sep 1 2023, 1:16 AM
libc/cmake/modules/LibcConfig.cmake
123

Sorry I should have been more explicit.

I can't parse This option is not be overriden, is this This option is not *to* be *overridden*?

Fix another typo.

libc/cmake/modules/LibcConfig.cmake
123

Oh! Fixed now.

gchatelet added inline comments.Sep 1 2023, 10:34 AM
libc/cmake/modules/LibcConfig.cmake
123

I think there's still one d missing in overriden, should be overridden :)

sivachandra marked an inline comment as done.

Fix yet another typo.

gchatelet accepted this revision.Sep 4 2023, 1:54 AM
This revision is now accepted and ready to land.Sep 4 2023, 1:54 AM
This revision was landed with ongoing or failed builds.Sep 5 2023, 7:19 AM
This revision was automatically updated to reflect the committed changes.