feat(libbboeos): export full <string.h> surface#450
Merged
Conversation
Add memchr/memcmp/memcpy/memmove/memset/strcasecmp/strcat/strchr/ strcmp/strcpy/strdup/strerror/strlen/strncasecmp/strncat/strncmp/ strncpy/strrchr/strstr to the libbboeos pointer table. Phase 4 clang-built consumers (and future cc.py callers needing a non-builtin string fn) can now dispatch through [FUNCTION_<NAME>_PTR] instead of statically linking each body. cc.py-built programs are unchanged: the builtin path (rep movsb / repne scasb) still wins for memcpy/memcmp/memset/strlen because the extern-dispatch path only fires when no builtin matches. Relocates FUNCTION_POINTER_TABLE from FUNCTION_TABLE + 0x800 to + 0xE00 so .libbboeos.text + .rodata (~2.8 KB with all 18 new bodies pulled in) doesn't overlap the table. The whole user-space rebuilds against the new offset on each make_os.sh run, so the block sorts cleanly alphabetically — strcmp slides from PR #448's pinned offset 52 into its natural slot at +84. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d7228b2 to
008e3fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
user/libbboeos/string.c(memchr/memcmp/memcpy/memmove/memset/strcasecmp/strcat/strchr/strcpy/strdup/strerror/strlen/strncasecmp/strncat/strncmp/strncpy/strrchr/strstr).FUNCTION_POINTER_TABLEfromFUNCTION_TABLE + 0x800to+ 0xE00so the now-2.8 KB.libbboeos.text+.rodatadoesn't overlap the table.strcmp's slot stays pinned at offset 52 (locked by PR feat(cc): extern-call fallback for libbboeos exports #448 consumers); the 18 new entries land after it, sorted alphabetically among themselves.memcpy/memcmp/memset/strlenbecause libbboeos extern dispatch only fires when no builtin matches. The exports primarily exist for upcoming Phase 4 (clang programs againstlibbboeos_stubs.a).Test plan
./make_os.shcleantests/test_asm.py(42/42)tests/test_programs.py(89/89)tests/test_bboefs.py(6/6)tests/test_archive.py(12/12)tests/test_kernel_archive.py(12/12)tests/test_cc_compatibility.py(57/57)python3 -m pytest tests/unit/(458/458)🤖 Generated with Claude Code