Opened 22 months ago

Last modified 22 months ago

#71665 new defect

libgcc14 @14.2.0_1 does not build on PPC Leopard, Mac OS X 10.5.8, because of ld: bl PPC branch out of range

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: leopard ppc Cc:
Port: libgcc14

Description

opt/local/libexec/gcc10-bootstrap/bin/g++ -arch ppc -std=c++11 -no-pie   -g -fPIC -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -no-pie -static-libstdc++ -static-libgcc -L/opt/local/lib -Wl,-headerpad_max_install_names -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o darwin-c.o rs6000-c.o \
          cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a  -liconv ../libbacktrace/.libs/libbacktrace.a ../libiberty/pic/libiberty.a ../libdecnumber/libdecnumber.a  -L/opt/local/lib -lisl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lmpc -lmpfr -lgmp   -lz -L/opt/local/lib -lzstd
ld: warning: direct access in __Z24gimple_has_substatementsP6gimple to global weak symbol __Z24gimple_has_substatementsP6gimple means the weak symbol cannot be overriden at runtime. This was likely caused by different translation units being compiled with different visiblity settings.
.
.
.
ld: warning: direct access in __Z24gimple_has_substatementsP6gimple to global weak symbol __Z24gimple_has_substatementsP6gimple means the weak symbol cannot be overriden at runtime. This was likely caused by different translation units being compiled with different visiblity settings.
final section layout:
    __TEXT/__text addr=0x00004484, size=0x020524E4, fileOffset=0x00003484, type=1
    __TEXT/__text_startup addr=0x02056968, size=0x000000F8, fileOffset=0x02055968, type=1
    __TEXT/__text_cold_coal addr=0x02056A60, size=0x000000CC, fileOffset=0x02055A60, type=1
    __TEXT/__text_cold addr=0x02056B2C, size=0x000004B4, fileOffset=0x02055B2C, type=1
    __TEXT/__symbol_stub1 addr=0x02056FE0, size=0x000BA360, fileOffset=0x02055FE0, type=27
    __TEXT/__const addr=0x02111340, size=0x002020C0, fileOffset=0x02110340, type=0
    __TEXT/__cstring addr=0x02313400, size=0x0015C41C, fileOffset=0x02312400, type=12
    __TEXT/__eh_frame addr=0x0246F820, size=0x003EA7DC, fileOffset=0x0246E820, type=18
    __DATA/__dyld addr=0x0285A000, size=0x0000001C, fileOffset=0x02859000, type=29
    __DATA/__nl_symbol_ptr addr=0x0285A01C, size=0x000020A0, fileOffset=0x0285901C, type=28
    __DATA/__la_symbol_ptr addr=0x0285C0BC, size=0x0002E8D8, fileOffset=0x0285B0BC, type=26
    __DATA/__mod_init_func addr=0x0288A994, size=0x000000E4, fileOffset=0x02889994, type=32
    __DATA/__data addr=0x0288AA78, size=0x0002B9DC, fileOffset=0x02889A78, type=0
    __DATA/__const addr=0x028B6458, size=0x00087664, fileOffset=0x028B5458, type=0
    __DATA/__gcc_except_tab addr=0x0293DABC, size=0x00000837, fileOffset=0x0293CABC, type=0
    __DATA/__bss addr=0x0293E2F8, size=0x0002FBF0, fileOffset=0x00000000, type=24
    __DATA/__common addr=0x0296DEE8, size=0x000B6B20, fileOffset=0x00000000, type=24
ld: bl PPC branch out of range (21808344 max is +/-16MB): from __ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKPKcjEEE8allocateEmPKv (0x00B8A654) to __ZSt17__throw_bad_allocv (0x02056B70) in __ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKPKcjEEE8allocateEmPKv from libbackend.a(auto-profile.o) for architecture ppc
collect2: error: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build'
make: *** [bootstrap-lean] Error 2
make: Leaving directory `/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build'
Command failed:  cd "/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build" && /usr/bin/make -w bootstrap-lean
Exit code: 2

Attachments (1)

main.log​ (1.7 MB) - added by ballapete (Peter "Pete" Dyballa) 22 months ago.
Main.log from PPC Leopard, Mac OS X 10.5.8

Download all attachments as: .zip

Change History (13)

Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log​ added

Main.log from PPC Leopard, Mac OS X 10.5.8

comment:1 Changed 22 months ago by kencu (Ken)

this error happens if ld64 is not installed correctly I believe.

Can I ask you exactly what you have installed for ld64?

comment:2 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

pete 225 /\ port installed | ggrep ld64
  ld64 @3_6+ld64_127 (active)
pete 226 /\ port installed -v ld64 ld64-127
The following ports are currently installed:
  ld64 @3_6+ld64_127 (active) requested_variants='+ld64_127' platform='darwin 9' archs='ppc' date='2024-02-08T13:05:33+0100'
  ld64-127 @127.2_14+llvm34 (active) requested_variants='+llvm34' platform='darwin 9' archs='ppc' date='2020-09-17T13:14:16+0200'

comment:3 Changed 22 months ago by kencu (Ken)

at the moment, I have this:

$ uname -a
Darwin LeopardG5.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh

$ port -v installed | grep ld64
  ld64 @3_4+ld64_97 requested_variants='' platform='darwin 9' archs='ppc' date='2023-07-30T15:00:59-0700'
  ld64 @3_6+ld64_97 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2023-11-15T11:52:04-0800'
  ld64-97 @97.17_9+llvm33 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2023-07-30T15:00:57-0700'

We have been going back and forth with ld64-97 and ld64-127 on Leopard PPC, and I believe a year or two ago we concluded that ld64-97 was best for PPC, as by ld64-127 Apple had moved seriously on into Intel land and PPC was not getting the testing and support it did before then. This is still an evolving issue I think, with more to be learned about it.

comment:4 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

ld64 +ld64_97 will install

 ld64-97
 libunwind-headers
 llvm-3.3

which could take some time. Is gcc10-bootstrap -universal OK or should I take some days off and try to build gcc10-bootstrap?

comment:5 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

After one and a half hours:

--->  Applying patch-gcc10-disable-macports-cctools-as-changes.diff
Executing:  cd "/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/gcc-14.2.0" && /usr/bin/patch -t -N -p0 < '/opt/local/var/macports/sources/nue.de.rsync.macports.org/macports/release/tarballs/ports/lang/gcc14/files/patch-gcc10-disable-macports-cctools-as-changes.diff'
patching file Makefile.in
Hunk #1 succeeded at 727 with fuzz 1 (offset 74 lines).
--->  Patching Makefile.in: s|^do-compare =|do-compare = /usr/bin/true|g
--->  Patching bootstrap-debug.mk: s|^do-compare =|do-compare = /usr/bin/true|g
--->  Patching bootstrap-debug-lean.mk: s|^do-compare =|do-compare = /usr/bin/true|g
--->  Patching bootstrap-debug-lib.mk: s|^do-compare =|do-compare = /usr/bin/true|g
--->  Configuring libgcc14
Error: libgcc14 cannot be built while libunwind-headers is active.
Error: Please forcibly deactivate libunwind-headers, e.g. by running:
Error: 
Error:     sudo port -f deactivate libunwind-headers
Error: 
Error: Then try again. You can reactivate libunwind-headers again later.
Error: Failed to configure libgcc14: libunwind-headers is active

comment:6 Changed 22 months ago by kencu (Ken)

yes, wish someone would figure out how to make that not happen --

sudo port -f deactivate libunwind-headers

on the other hand, you didn't actually lose 1.5 hours -- just do what it said and then you continue on building gcc10-bootstrap

comment:7 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

I could have been in bed – it's pretty late here – and seven or such hours would have been lost…

Can't system perform such things?

comment:8 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

GCC14 finally built. So this ticket can be closed.

comment:9 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

Is ld64-97 @97.17_9+llvm34 equivalent to ld64-97 @97.17_9+llvm33? It should be enough to have one useless compiler, Clang34/LLVM34…

comment:10 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

Actually libgcc and libgcc14 built. The build for gcc14 has only started a few hours ago…

  ld64 @3_6+ld64_127 requested_variants='+ld64_127' platform='darwin 9' archs='ppc' date='2024-02-08T13:05:33+0100'
  gcc10-bootstrap @10.5.0_0 (active) requested_variants='-universal' platform='darwin 9' archs='ppc' date='2024-12-27T22:23:35+0100'
  llvm-3.3 @3.3_13 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2024-12-28T23:06:39+0100'
  ld64-97 @97.17_9+llvm33 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2024-12-28T23:16:28+0100'
  ld64 @3_6+ld64_97 (active) requested_variants='+ld64_97' platform='darwin 9' archs='ppc' date='2024-12-28T23:17:16+0100'
  libgcc14 @14.2.0_1 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2024-12-31T00:56:21+0100'
  libgcc @9.0_0 (active) requested_variants='' platform='any any' archs='ppc' date='2024-12-31T01:05:32+0100'

comment:11 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

It built tonight: gcc14 @14.2.0_1 (active) requested_variants='' platform='darwin 9' archs='ppc' date='2025-01-02T04:23:13+0100'.

comment:12 Changed 22 months ago by ballapete (Peter "Pete" Dyballa)

I installed ld64-97 @97.17_9+llvm34 (active) requested_variants='+llvm34' platform='darwin 9' archs='ppc' date='2025-01-04T22:14:01+0100' to get rid of at least one useless Clang versiosn. Possibly it was used successfully to upgrade some ports.

IMO this issue can be closed.

Note: See TracTickets for help on using tickets.