#64316 closed defect (fixed)
gcc9 @9.4.0_1 & gcc10 @10.3.0_1: build failure: Undefined symbols for architecture x86_64
Reported by: | i0ntempest | Owned by: | i0ntempest |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | Cc: | mascguy (Christopher Nielsen), MarkCallow (Mark Callow), EJFielding (Eric Fielding), macdeport, cooljeanius (Eric Gallager), chillin- | |
Port: | gcc9 gcc10 |
Description
:info:build Undefined symbols for architecture x86_64: :info:build "_cfun", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_epilogue_completed", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_cf_protection", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_finite_math_only", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_fp_int_builtin_inexact", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_peephole2", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_pic", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_rounding_math", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_trapping_math", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_flag_unsafe_math_optimizations", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_insn", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_arch_features", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_cmodel", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_fpmath", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_isa_flags", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_isa_flags2", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_pmode", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_tls_dialect", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_ix86_tune_features", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_operands", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_optimize", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_reload_completed", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_reload_in_progress", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_rtx_class", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_target_flags", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_this_target_flag_state", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build "_x86_prefetch_sse", referenced from: :info:build ___cxx_global_var_init.99 in gencondmd.o :info:build ld: symbol(s) not found for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
Problem occured since the recent revbump. To build gcc10 I must force the target to be darwin 20, but otherwise I was able to build both of them before.
Attachments (8)
Change History (33)
Changed 3 years ago by i0ntempest
comment:1 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:2 Changed 3 years ago by BKpilot
comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | MarkCallow added |
---|---|
Port: | gcc9,gcc10 → gcc9 gcc10 |
Has duplicate #64571.
comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
It could be the well-known macOS 11+ libtool undefined symbols bug which we've already patched in umpteen other ports...
Changed 3 years ago by cmstuber (Chris Stuberg)
Attachment: | gcc9_gcc10_term_i-o.txt added |
---|
Changed 3 years ago by cmstuber (Chris Stuberg)
Attachment: | libgcc9_main.log added |
---|
Changed 3 years ago by cmstuber (Chris Stuberg)
Attachment: | gcc9_main.log added |
---|
Changed 3 years ago by cmstuber (Chris Stuberg)
Attachment: | gcc10_main.log added |
---|
comment:5 Changed 3 years ago by cmstuber (Chris Stuberg)
I've been having this issue as well since about the time this ticket was submitted.
From a clean macports install and having buildfromsource turned on, I attempted to build gcc9 first. libgcc10 builds successfully but libgcc9 does not, thus gcc9 will fail to build.
---> Fetching distfiles for libgcc10 ---> Verifying checksums for libgcc10 ---> Extracting libgcc10 ---> Configuring libgcc10 ---> Building libgcc10 ---> Staging libgcc10 into destroot ---> Installing libgcc10 @10.3.0_2 ---> Activating libgcc10 @10.3.0_2 ---> Cleaning libgcc10 ---> Fetching distfiles for libgcc9 ---> Attempting to fetch gcc-9.4.0.tar.xz from https://distfiles.macports.org/gcc9 ---> Verifying checksums for libgcc9 ---> Extracting libgcc9 ---> Applying patches to libgcc9 ---> Configuring libgcc9 Warning: Applying '--without-build-config' workaround to Xcode 13.2.1 / CLT 13.2.0.0.1.1637719136 Warning: If versions > 12.5 please check if it is still required ---> Building libgcc9 Error: Failed to build libgcc9: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port gcc9 failed
Without cleanup, I attempted to build gcc10 but got an immediate failure.
root@mac66 local # port install gcc10 ---> Computing dependencies for gcc10 ---> Building gcc10 Error: Failed to build gcc10: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/gcc10/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port gcc10 failed root@mac66 local #
Attaching terminal input/output, main.logs from libgcc9, gcc9, gcc10.
comment:6 Changed 3 years ago by EJFielding (Eric Fielding)
Cc: | EJFielding added |
---|
comment:7 Changed 3 years ago by EJFielding (Eric Fielding)
I recently upgraded a Mac to Monterey macOS 12.2.1 and had trouble with the MacPorts migration failing for the installation of gcc9
and gcc10
. It seems to be the same bug that people found previously in the build of libgcc9
. I updated my Xcode to v. 13.3 to see if that would help, but it did not. I also tried to install gcc8
but that installation wanted to install both libgcc8
and libgcc9
as dependencies, so it also failed.
Now I see that gcc11
was successfully installed, so I guess I can use that.
comment:8 Changed 3 years ago by kencu (Ken)
MacPorts used to specify a gcc version, like gcc9, to use for various ports.
Then as you upgrade your system and years went by, gcc9 (for example) is no longer supported on the newer OS, and the migration would break down.
The plan for this changed a while back, to try to not specify a definite gcc version that would become outdated, but just use the current default gcc version whatever it is, which is almost always the supported one, and the one you really want to use.
gcc9 is probably never going to be updated to build on these newer OS versions, but the truth is, you don't really want it anyway.
comment:9 Changed 3 years ago by EJFielding (Eric Fielding)
Thanks, @kencu. I remember the hassles of specific versions of gcc in many ports. I am glad to hear that is largely removed, and I don't need to think more about gcc9 or gcc10.
comment:10 Changed 3 years ago by macdeport
Cc: | macdeport added |
---|
comment:11 Changed 3 years ago by cooljeanius (Eric Gallager)
Hi, this bug currently blocks upgrades for mpich-default, openmpi-default, and R for me.
comment:12 Changed 3 years ago by cooljeanius (Eric Gallager)
Cc: | cooljeanius added |
---|
comment:13 Changed 3 years ago by EJFielding (Eric Fielding)
Yes, I was not able to run port upgrade outdated
yesterday on my Mac running 11.6.5 with Xcode 13.2.1. When it tried to rebuild gcc10
it failed with the same errors. I tried uninstall gcc10 libgcc10
and it told me this would break my openmpi-default
port that was built with +gcc10
. I finally went ahead and uninstalled gcc9 libgcc9 gcc10 libgcc10
. Then I uninstalled and reinstalled openmpi-default
. I also had to do that with OpenBLAS
. Those take a long time to rebuild, but now they are both successfully installed with +gcc11
. As I understand it, they are not going to fix gcc9 or gcc10 to compile on recent versions of Xcode.
comment:14 Changed 3 years ago by i0ntempest
gcc10 can now be successfully built on macOS 12 after the latest change which introduced 2 new patch files, one adding macOS 12 support and one fixing this undefined symbols problem. gcc9, with these two patches (tho one of the patch needs to be modified to exclude config.gcc from being patched), can now also be built. The two patches are attached if anyone needs them but use gcc11 first if you can.
Changed 3 years ago by i0ntempest
Attachment: | patch-genconditions.diff added |
---|
Changed 3 years ago by i0ntempest
Attachment: | patch-darwin21-support.diff added |
---|
comment:15 Changed 3 years ago by chillin-
Cc: | chillin- added |
---|
comment:16 Changed 3 years ago by i0ntempest
Owner: | set to i0ntempest |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:17 Changed 3 years ago by chillin-
An hour since closed, I still get the same undefined symbols/symbols not found build error for libgcc10, using Xcode@5.1.1 (5B1008), Macmini5,2 OS X 10.8.5
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]Undefined symbols for architecture x86_64: "_cfun", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_const_int_rtx", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_const_tiny_rtx", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_epilogue_completed", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_cf_protection", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_finite_math_only", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_fp_int_builtin_inexact", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_pic", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_rounding_math", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_trapping_math", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_flag_unsafe_math_optimizations", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_insn", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_arch_features", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_cmodel", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_excess_precision", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_fpmath", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_isa_flags", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_isa_flags2", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_pmode", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_tls_dialect", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_tune_features", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_ix86_unsafe_math_optimizations", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_operands", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_reload_completed", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_reload_in_progress", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_rtx_class", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_target_flags", referenced from: ___cxx_global_var_init.101 in gencondmd.o "_x86_prefetch_sse", referenced from: ___cxx_global_var_init.101 in gencondmd.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [build/gencondmd] Error 1 rm gcc.pod make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/work/build/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/work/build' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/work/build' make: *** [bootstrap-lean] Error 2 make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/work/build' Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/work/build" && /usr/bin/make -j4 -w bootstrap-lean Exit code: 2 Error: Failed to build libgcc10: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc10/libgcc10/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
identical log attached here (in closed duplicate): https://trac.macports.org/ticket/65089
comment:18 Changed 3 years ago by i0ntempest
Not sure if this will work but try applying the genconditions patch (at line 65 of gcc10 portfile) unconditionally.
comment:19 Changed 3 years ago by jmroot (Joshua Root)
That patch doesn't appear to take into account the different versioning schemes of Apple clang and llvm.org clang. It's likely mishandling some versions of one or the other.
Changed 3 years ago by macdeport
Attachment: | main.log.libgcc10.zip added |
---|
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10
comment:20 Changed 3 years ago by macdeport
libgcc10 10.3.0_3 < 10.3.0_4 02/05/22 20:30:59 ---> Computing dependencies for libgcc10 ---> Fetching archive for libgcc10 ---> Attempting to fetch libgcc10-10.3.0_4.darwin_14.x86_64.tbz2 from http://packages.macports.org/libgcc10 ---> Attempting to fetch libgcc10-10.3.0_4.darwin_14.x86_64.tbz2 from http://mse.uk.packages.macports.org/libgcc10 ---> Attempting to fetch libgcc10-10.3.0_4.darwin_14.x86_64.tbz2 from http://ema.uk.packages.macports.org/libgcc10 ---> Fetching distfiles for libgcc10 ---> Attempting to fetch gcc-10.3.0.tar.xz from http://distfiles.macports.org/gcc10 ---> Verifying checksums for libgcc10 ---> Extracting libgcc10 ---> Applying patches to libgcc10 ---> Configuring libgcc10 ---> Building libgcc10 Error: Failed to build libgcc10: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
... :info:build Undefined symbols for architecture x86_64: :info:build "_cfun", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_const_int_rtx", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_const_tiny_rtx", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_epilogue_completed", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_cf_protection", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_finite_math_only", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_fp_int_builtin_inexact", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_pic", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_rounding_math", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_trapping_math", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_flag_unsafe_math_optimizations", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_insn", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_arch_features", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_cmodel", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_excess_precision", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_fpmath", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_isa_flags", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_isa_flags2", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_pmode", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_tls_dialect", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_tune_features", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_ix86_unsafe_math_optimizations", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_operands", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_reload_completed", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_reload_in_progress", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_rtx_class", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_target_flags", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build "_x86_prefetch_sse", referenced from: :info:build ___cxx_global_var_init.101 in gencondmd.o :info:build ld: symbol(s) not found for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) :info:build make[3]: *** [build/gencondmd] Error 1 :info:build make[3]: *** Waiting for unfinished jobs.... :info:build rm gcc.pod :info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/work/build/gcc' :info:build make[2]: *** [all-stage1-gcc] Error 2 :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/work/build' :info:build make[1]: *** [stage1-bubble] Error 2 :info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/work/build' :info:build make: *** [bootstrap-lean] Error 2 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/work/build' :info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/work/build" && /usr/bin/make -j8 -w bootstrap-lean :info:build Exit code: 2 :error:build Failed to build libgcc10: command execution failed :debug:build Error code: CHILDSTATUS 11553 2 :debug:build Backtrace: command execution failed :debug:build while executing :debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring" :debug:build invoked from within :debug:build "command_exec -callback portprogress::target_progress_callback build" :debug:build (procedure "portbuild::build_main" line 8) :debug:build invoked from within :debug:build "$procedure $targetname" :error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc10/libgcc10/main.log for details.
comment:21 Changed 3 years ago by macdeport
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:22 Changed 3 years ago by mascguy (Christopher Nielsen)
This should be fixed with yesterday's commit:
https://github.com/macports/macports-ports/commit/5684395bada27da9f6eceebef0a6639297122b1a
Let me know if all is well now!
comment:23 follow-up: 24 Changed 3 years ago by chillin-
Fixed it for me. Apparently, I have a non-standard system... still trying to understand that, but it built and no longer shows as outdated. Thanks!
comment:24 follow-up: 25 Changed 3 years ago by mascguy (Christopher Nielsen)
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to chillin-:
Fixed it for me. Apparently, I have a non-standard system... still trying to understand that, but it built and no longer shows as outdated. Thanks!
Great, glad the issue is resolved!
Hello,
I am getting the same error messages as i0ntempest, i.e., undefined symbols in gencondmd.o, when I try to build libgcc77.5.0_1.darwin_20.x86_64.tbz2 (MacOS 11.6.2, Xcode 13.2.1 and MacPorts 2.7.1. Earlier today I was able to build gcc8, gcc9, gcc10, and gcc11 without problems.
The issue arises when I want to perform "sudo port upgrade outdated". Even if I do a "port clean libgcc7" first, the process "upgrade outdated" always starts with trying to install libgcc7.