On 10/7/2020 5:48 AM, Mark Kettenis wrote:
Date: Tue, 6 Oct 2020 13:06:04 +0000
From: Miod Vallat <[email protected]>

Synopsis:       lib/csu/init_priority regress test failure on macppc
Category:       powerpc
Environment:
        System      : OpenBSD 6.8
        Details     : OpenBSD 6.8-current (GENERIC) #3: Tue Oct  6 07:58:23 GMT 
2020
                         
[email protected]:/usr/src/sys/arch/macppc/compile/GENERIC

        Architecture: OpenBSD.macppc
        Machine     : macppc
Description:
        The lib/csu/init_priority regress test fails when using clang, but
        passes when compiled with gcc.
How-To-Repeat:
        $ cd /usr/src/regress/lib/csu/init_priority && make
        c++ -O2 -pipe   -MD -MP  -c 
/usr/src/regress/lib/csu/init_priority/init_priority
_test.cc
        c++   -o init_priority_test init_priority_test.o
        ./init_priority_test
        12597
        14117
        17071
        20840
        28373
        31319
        40956
        47220
        6407
        8742
        assertion "log[i] >= log[i - 1]" failed: file 
"/usr/src/regress/lib/csu/init_priority/init_priority_test.cc", line 48, function "main"
        *** Signal SIGABRT in . (<bsd.regress.mk>:36 
'run-regress-init_priority_test')
        FAILED

        However, building with g++ causes the test to pass:
        $ make clean && CXX=g++ make
        rm -f a.out [Ee]rrs mklog *.core y.tab.h  init_priority_test  
init_priority_test.o    init_priority_test.d
        g++ -O2 -pipe   -MD -MP  -c 
/usr/src/regress/lib/csu/init_priority/init_priority_test.cc
        g++   -o init_priority_test init_priority_test.o
        ./init_priority_test
        6407
        8742
        12597
        14117
        17071
        20840
        28373
        31319
        40956
        47220

Fix:
        unknown.
On powerpc we're still using ld.bfd as the linker.  This issue doesn't
happen on powerpc64, where we use ld.lld instead.  It looks as if that
linker doesn't order the sections the same way as ld.lld is.

Ufortunately ld.lld doesn't produce binaries that out ld.so likes on
powerpc.  Investigating that, but I need to build llvm first, which
takes some time...


Is this still an issue with the new linker?

Reply via email to