A recent commit (260054) broke bootstrap on FreeBSD. The reason is an undefined reference to 'backtrace'. This function is available on FreeBSD too but not in libc. It is available in libexecinfo. A quick hack to linkage.m4 to add this library if found showed a 37 failure count instead of 7k+ without. I do not know the right to link an additional library for debug purposes. Also, this might be applicable to NetBSD too, don't have it here but the man page of backtrace notes that the function appeared in NetBSD 7.0 and FreeBSD 10.
Hmm, I think we are supposed to use libbacktrace instead?
Yes I did suggest that. For now I think we should just disable the use of backtrace anywhere except GNU/Linux.
I used this function cause it was already being used by the libstdc++ profile mode so I was expecting it to be quite safe. As profile mode is not used on bootstrap or in general I guess this problem never show up. I'll move to libbacktrace with proper checks. Waiting for the fix shall I revert the change ?
Created attachment 44187 [details] Remove backtrace usage during bootstrap. I wonder if this patch could fix the bootstrap ? I try to avoid the usage of backtrace during bootstrap. The problem will then be limited to usage of debug mode in users code. I still plan to use libbacktrace but it will take me some time to find out how.
Author: fdumont Date: Fri May 25 16:40:55 2018 New Revision: 260761 URL: https://gcc.gnu.org/viewcvs?rev=260761&root=gcc&view=rev Log: 2018-05-25 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/85768 * src/c++11/debug.cc: Remove backtrace usage. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/src/c++11/debug.cc
(In reply to François Dumont from comment #4) > I wonder if this patch could fix the bootstrap ? I try to avoid the usage of > backtrace during bootstrap. The problem will then be limited to usage of > debug mode in users code. In my case, the bootstrap wasn't broken, I just got tons and tons of testsuites failures -- so many, that the gcc-testresults@ list refused my mails due to size constraints. Looking at Andreas' original comment saying "A quick hack to linkage.m4 to add this library if found showed a 37 failure count instead of 7k+ without." he may have experienced the same, not an actual bootstrap failure?
Let's close this, as the bootstrap problem is fixed.