Skip to content
Snippets Groups Projects
  • Iain Sandoe's avatar
    1609fdff
    libstdc++, Darwin: Handle a linker warning [PR112397]. · 1609fdff
    Iain Sandoe authored
    
    Darwin's linker warns when we make a direct branch to code that is
    in a weak definition (citing that if a different implementation of
    the weak function is chosen by the dynamic linker this would be an
    error).
    
    As the analysis in the PR shows, this can happen when we have hot/
    cold partitioning and there is an error path that is primarily cold
    but makes use of epilogue code in the hot section.  In this simple
    case, we can easily deduce that the code is in fact safe; however
    that is not something we can realistically implement in the linker.
    
    Since the user-replaceable allocators are implemented using weak
    definitions, this is a warning that is frequently flagged up in both
    the testsuite and end-user code.
    
    The chosen solution here is to suppress the hot/cold partitioning for
    these cases (it is unlikely to impact performance much c.f. the
    actual allocation).
    
    	PR target/112397
    
    libstdc++-v3/ChangeLog:
    
    	* configure: Regenerate.
    	* configure.ac: Detect if we are building for Darwin.
    	* libsupc++/Makefile.am: If we are building for Darwin, then
    	suppress hot/cold partitioning for the array allocators.
    	* libsupc++/Makefile.in: Regenerated.
    
    Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
    Co-authored-by: default avatarJonathan Wakely <jwakely@redhat.com>
    1609fdff
    History
    libstdc++, Darwin: Handle a linker warning [PR112397].
    Iain Sandoe authored
    
    Darwin's linker warns when we make a direct branch to code that is
    in a weak definition (citing that if a different implementation of
    the weak function is chosen by the dynamic linker this would be an
    error).
    
    As the analysis in the PR shows, this can happen when we have hot/
    cold partitioning and there is an error path that is primarily cold
    but makes use of epilogue code in the hot section.  In this simple
    case, we can easily deduce that the code is in fact safe; however
    that is not something we can realistically implement in the linker.
    
    Since the user-replaceable allocators are implemented using weak
    definitions, this is a warning that is frequently flagged up in both
    the testsuite and end-user code.
    
    The chosen solution here is to suppress the hot/cold partitioning for
    these cases (it is unlikely to impact performance much c.f. the
    actual allocation).
    
    	PR target/112397
    
    libstdc++-v3/ChangeLog:
    
    	* configure: Regenerate.
    	* configure.ac: Detect if we are building for Darwin.
    	* libsupc++/Makefile.am: If we are building for Darwin, then
    	suppress hot/cold partitioning for the array allocators.
    	* libsupc++/Makefile.in: Regenerated.
    
    Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
    Co-authored-by: default avatarJonathan Wakely <jwakely@redhat.com>