Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit all new and delete implementation when AVR core provides it #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 29, 2022

  1. Revert "change include directives to use double quotes"

    This does not seem to be a complete and proper fix for the conflict
    between uclibc++ new/delete and the ones defined by the AVR core, since
    it only fixes conflicts in the header files, but source files might
    still produce linker errors.
    
    So better revert it and stay closer to upstream uclibc++ sources.
    
    This reverts commit 84b4a91.
    matthijskooijman committed Jun 29, 2022
    Configuration menu
    Copy the full SHA
    a815fbd View commit details
    Browse the repository at this point in the history
  2. fix: Only define new/del when AVR core does not provide <new>

    Since AVR core 1.8.3, it provides an (incomplete) new header that breaks
    compilation of the uclibc++ new/delete .cpp files. Since 1.8.4 it
    provides a complete new header, but that also introduces a linker
    duplicate symbol issue for std::nothrow.
    
    This commit adds a USING_NEW_FROM_UCLIBC define to our new include file,
    which allows detecting which version of the new include is used. That
    define is used to completely skip all new/delete code (all new_*.cpp and
    del_*.cpp files) when the new header from the AVR-core is used.
    
    This should fix all conflicts, except:
     - On AVR core 1.8.3, new/delete is now incomplete. However, the missing
       functions (array placement new, placement delete, nothrow versions
       and delete with size) are probably not commonly used.
     - If another library *also* offers <new>, then things might break in
       different ways. Again, this is a rare corner case.
     - This no longer provides set_new_handler, which the AVR core declares
       but does not define. However, since the uclibc++ version did not
       actually *use* the handler passed, not defining it is probably
       better.
    matthijskooijman committed Jun 29, 2022
    Configuration menu
    Copy the full SHA
    7e5274f View commit details
    Browse the repository at this point in the history