git: crt1.o: Fix compilation failure with -DGCRT on clang

John Marino marino at crater.dragonflybsd.org
Wed Nov 5 13:52:04 PST 2014


commit 98b5f2ced1473d884397cff7d822d7b2187a78e3
Author: John Marino <draco at marino.st>
Date:   Wed Nov 5 22:48:48 2014 +0100

    crt1.o: Fix compilation failure with -DGCRT on clang
    
    Clang has been failing to compile the crt1.c with GCRT macro defined.  The
    error message stated the "eprol" label was being defined twice.  Clang was
    performing an alternative conditional optimization which duplicated the
    assembly including our inserted eprol label.
    
    The workaround is to relocate the eprol label after the handle_static_init
    function to get it out of the optimization loop.  The trade-off of this
    workaround is that handle_static_init() can no longer be profiled.  The
    formerly preceding monstartup belongs to gmon and it controls the range of
    PCs the profiling code considers.
    
    Suggested by:	dillon

Summary of changes:
 lib/csu/x86_64/crt1.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/98b5f2ced1473d884397cff7d822d7b2187a78e3


-- 
DragonFly BSD source repository



More information about the Commits mailing list