[Bug debug/68771] Darwin: Profile guided optimisation with cold sections and invalid symbol redefinition

zerolo at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 19 13:31:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68771

--- Comment #2 from Daniel Vollmer <zerolo at gmail dot com> ---
I'm having even more trouble to get this to work using a current gcc-7
(Homebrew GCC 7.3.0) 7.3.0.


First, I see some warnings in step 1) of the form

ld: warning: direct access in function
'__GLOBAL__sub_I_65535_0_Preprocessor.cpp.lto_priv.322' from file
'/var/folders/02/yl3m8d4d0397mk6dxn6dpcqw0000gp/T//ccm0fMqG.ltrans3.ltrans.o'
to global weak symbol
'__ZZN5Eigen8internal20manage_caching_sizesENS_6ActionEPlS2_E13m_l2CacheSize'
from file
'/var/folders/02/yl3m8d4d0397mk6dxn6dpcqw0000gp/T//ccm0fMqG.ltrans18.ltrans.o'
means the weak symbol cannot be overridden at runtime. This was likely caused
by different translation units being compiled with different visibility
settings.

even though visibility settings should be identical AFAICT.


The real blocker is exiting the binary (more accurately: Python extension) in
step 2) as it seems to hang (hanging for about 5mins now, for a profile run
that took 30secs) in

Call graph:
    2508 Thread_3830138   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2507 start  (in libdyld.dylib) + 8  [0x7fff772d111c]
    + ! 2507 exit  (in libsystem_c.dylib) + 55  [0x7fff7737e362]
    + !   2507 __cxa_finalize_ranges  (in libsystem_c.dylib) + 351 
[0x7fff7737e051]
    + !     2507 dyld::runAllStaticTerminators(void*)  (in dyld) + 64 
[0x10d65a613]
    + !       2507 __gcov_exit  (in libFlucs.dylib) + 146  [0x110a54062] 
libgcov-driver.c:871
    + !         919 gcov_do_dump  (in libFlucs.dylib) + 310,262,... 
[0x110a52c66,0x110a52c36,...]  libgcov-driver.c:171
    + !         595 gcov_do_dump  (in libFlucs.dylib) + 277,391,... 
[0x110a52c45,0x110a52cb7,...]  libgcov-driver.c:167
    + !         520 gcov_do_dump  (in libFlucs.dylib) + 274,322,... 
[0x110a52c42,0x110a52c72,...]  libgcov-driver.c:173
    + !         205 gcov_do_dump  (in libFlucs.dylib) + 377,259,... 
[0x110a52ca9,0x110a52c33,...]  libgcov-driver.c:172
    + !         96 gcov_do_dump  (in libFlucs.dylib) + 432,470,... 
[0x110a52ce0,0x110a52d06,...]  libgcov-driver.c:332
    + !         66 gcov_do_dump  (in libFlucs.dylib) + 439,436 
[0x110a52ce7,0x110a52ce4]  libgcov-driver.c:334
    + !         44 gcov_do_dump  (in libFlucs.dylib) + 493,227,... 
[0x110a52d1d,0x110a52c13,...]  libgcov-driver.c:316
    + !         28 gcov_do_dump  (in libFlucs.dylib) + 442  [0x110a52cea] 
libgcov-driver.c:335
    + !         13 gcov_do_dump  (in libFlucs.dylib) + 351,366 
[0x110a52c8f,0x110a52c9e]  libgcov-driver.c:329
    + !         7 gcov_do_dump  (in libFlucs.dylib) + 293  [0x110a52c55] 
libgcov-driver.c:317
    + !         5 gcov_do_dump  (in libFlucs.dylib) + 482,484 
[0x110a52d12,0x110a52d14]  libgcov-driver.c:309
    + !         4 gcov_do_dump  (in libFlucs.dylib) + 77  [0x110a52b7d] 
libgcov-driver.c:302
    + !         : 4 strlen  (in libsystem_c.dylib) + 14  [0x7fff7732142e]
    + !         3 gcov_do_dump  (in libFlucs.dylib) + 224  [0x110a52c10] 
libgcov-driver.c:311
    + !         1 gcov_do_dump  (in libFlucs.dylib) + 234  [0x110a52c1a] 
libgcov-driver.c:313
    + !         1 gcov_do_dump  (in libFlucs.dylib) + 345  [0x110a52c89] 
libgcov-driver.c:325

So unfortunately I cannot even get to step 3) to repo the hot / cold section
issue.


More information about the Gcc-bugs mailing list