https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123976
--- Comment #131 from Sergey Fedorov <vital.had at gmail dot com> --- (In reply to Peter Dyballa from comment #129) > (In reply to Sergey Fedorov from comment #124) > > (In reply to Peter Dyballa from comment #120) > > > (In reply to Iain Sandoe from comment #119) > > > > P. S. BTW, if you build outside of *Ports, make sure to set the PATH so that > > /opt/local/bin is NOT in it. (Alternatively, all ports are deactivated.) > > Otherwise we are back to the same problem: arbitrary binaries can be picked. > > Sergey, I *have* practically switched off MacPorts, as documented. Only a > few ports are active, those that are needed to build GCC-16.1. I do not use > PPC Leopard productively, that would be too dangerous (mostly port is > fetching software from the internet, other files are files are provided by > my recent MacBook), so I can spend a few weeks or months in this state. 'ls > -l /opt/local/bin | wc -l' reports "309", 'ls -l /opt/local/sbin | wc -l' > gives zero (0). I even activated a set of ports to temporarily have xz to > outpack the GCC sources and deactivated that set afterwards. Right now these > ports are active: > > bzip2 @1.0.8_0 > cctools @949.0.1_3 > db48 @4.8.30_5 > expat @2.8.1_0 > gcc15 @15.2.0_0 > gcc_select @0.1_10 > gettext-runtime @1.0_0 > gmp @6.3.0_0 > isl @0.24_1 > ld64 @3_6+ld64_97 > ld64-97 @97.17_9+llvm34 > libedit @20251016-3.1_0 > libffi @3.4.8_0 > libgcc @15_0 > libgcc15 @15.2.0_0 > libiconv @1.18_0 > libmacho-headers @949.0.1_0 > libmpc @1.4.1_0 > libunwind-headers @5.0.1_0 > llvm-3.4 @3.4.2_17 > llvm_select @2_1 > llvm_select-3.4 @2_1 > lz4 @1.10.0_0 > mpfr @4.2.2_0 > ncurses @6.6_0 > openssl11 @1.1.1w_1 > python2_select @0.1_0 > python27 @2.7.18_10 > python_select @0.3_10 > sqlite3 @3.53.2_0 > xz @5.8.3_0 > zlib @1.3.2_0 > zstd @1.5.7_0 > > Suggest which to forcibly deactivate! None of these gcc15 ports should be active when you are building gcc15 or gcc16. Also libunwind-headers must not be there (it is probably used to build cctools on 10.5, but not needed at runtime, and is actually harmful). I think libmacho-headers is not needed for anything at runtime and also should be deactivated. Other ones are probably harmless. For the record, I stopped using upstream MacPorts on powerpc systems quite a while ago, since it is both suboptimal and on many instances just broken, so I cannot guarantee anything with regard to it. But as a general rule, when you build the primary compiler (or anything really important), it makes sense to start from `sudo port deactivate active`, and then `sudo port -v -N install libgcc15`, for example, will only activate/build what is really needed.
