Skip to content

[Xcode 26.4] GenerateStateCpp emits symbol-less objects for stateless component libraries #57525

Description

@Malakof

Description

React Native Codegen 0.86.0 always emits a States.cpp translation unit, but GenerateStateCpp.js currently renders no state definitions (StateTemplate returns an empty string). For component libraries whose generated state source has no other definitions, Xcode 26.4.1 libtool reports the compiled object as symbol-less.

Environment

  • @react-native/codegen: 0.86.0
  • React Native: 0.86.0
  • Xcode: 26.4.1
  • SDK: iOS simulator
  • configuration: Release, new architecture

Reproduction

Generate component code for libraries such as rnscreens or safeareacontext, then build the generated ReactCodegen target in Release. The generated source contains only the header include and empty namespace.

libtool: warning: States-89020dfa9f92f64072c3fa149a6beab6.o has no symbols
libtool: warning: States-07dedd22012e4ff4426f2b40f6fb19ed.o has no symbols

Verified source-level fix

Have GenerateStateCpp emit a unique external-linkage function based on the sanitized library name, for example:

extern "C" void RnscreensStatesLinkerAnchor() {}

A regenerated Release object then exposes _RnscreensStatesLinkerAnchor in nm -g, and libtool no longer reports an empty object. This fixes the source without warning flags, suppression, or log filtering.

Activity

  1. react-native-bot commented on Jul 13, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. react-native-bot commented on Aug 7, 2026

    @react-native-bot
    Collaborator

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  3. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Aug 7, 2026
  4. react-native-bot commented on Sep 1, 2026

    @react-native-bot
    Collaborator

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  5. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 1, 2026
  6. react-native-bot commented on Sep 8, 2026

    @react-native-bot
    Collaborator

    This issue was closed because the author hasn't provided the requested feedback after 7 days.

  7. removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions