Opened 3 weeks ago

Last modified 2 weeks ago

#69875 new defect

libgcc7 build failed (MacOS Big Sur)

Reported by: clegra Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc:
Port: libgcc7

Description (last modified by ryandesign (Ryan Carsten Schmidt))

under MacOS 11.7.10, libgcc7 repeatedly fails to build

--->  Building libgcc7
Error: Failed to build libgcc7: command execution failed 
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc7/libgcc7/main.log for details.
Error: Problem while installing libgcc7
Error: rev-upgrade failed: Error rebuilding gcc7

Attachments (1)

main.log (2.1 MB) - added by clegra 3 weeks ago.
log file referred to in the error message of libgcc7 build fail

Change History (9)

Changed 3 weeks ago by clegra

Attachment: main.log added

log file referred to in the error message of libgcc7 build fail

comment:1 Changed 3 weeks ago by clegra

Description: modified (diff)

while a prompt sometimes says that "libgcc7 is known to fail" and asks whether I want to build it, it is used/referred to for the installation of subversion which I need.

-- many thanks in advance for all indications and help

comment:2 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: libgcc7 build fail removed

gcc7 and libgcc7 are indeed for OS X 10.10 and earlier. They are not expected to be compatible with later macOS versions. Use a newer gcc port instead.

The error in the log is:

/usr/bin/clang++ -arch x86_64 -std=gnu++98   -g  -DIN_GCC    -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -no-pie -o build/gencondmd \
	    build/gencondmd.o ../build-x86_64-apple-darwin20/libiberty/libiberty.a
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 in gencondmd.o
  "_epilogue_completed", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_finite_math_only", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_fp_int_builtin_inexact", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_peephole2", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_pic", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_rounding_math", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_trapping_math", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_flag_unsafe_math_optimizations", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_insn", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_arch_features", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_cmodel", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_fpmath", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_indirect_branch_register", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_isa_flags", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_isa_flags2", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_pmode", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_stack_protector_guard", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_tls_dialect", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ix86_tune_features", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_operands", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_optimize", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_ptr_mode", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_reload_completed", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_reload_in_progress", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_rtx_class", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_target_flags", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_this_target_flag_state", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_word_mode", referenced from:
      ___cxx_global_var_init in gencondmd.o
  "_x86_prefetch_sse", referenced from:
      ___cxx_global_var_init 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
make[3]: *** Waiting for unfinished jobs....

Nothing in the dependency chain of the subversion port requires any gcc port—not with default variants on macOS 12 anyway.

comment:3 Changed 2 weeks ago by clegra

Thank you for your help, and i.p. for the info that subversion does not depend on libgcc.

I recognized, however, that emacs (which I need) depends on:

gcc7 @7.5.0

(seemingly via gcc10) and the (re-)installation of emacs then fails on this part.

I uninstalled libgcc7, and then cut leaves, which eliminated also libgcc8 and libgcc9 with no further leaves. But then "port upgrade outdated" recreated libgcc9 (with much efforts) with the dependency again on libgcc8 and libgcc7, which again failed.

I am aware of #61883 (and recognized that I had asked the same question there 3 years ago before), but even pdftk-java that is suggested there instead of pdftk depends on libgcc9 whose build then depends on libgcc7 and fails.

Would there be a specific emacs version for me on MacOS 11.7.10 that would not have this indirect dependency on libgcc7?

-- Many thanks for any indication in advance!

comment:4 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

emacs depends on gcc13, which depends on libgcc, which depends on libgcc13, and that should be it. I do not see gcc7 in its dependency chain, at least not on macOS 12 x86_64:

% port rdeps emacs | grep gcc
  gcc13
    gcc_select
    libgcc
      libgcc13
    gcc13-libcxx

emacs only needs gcc when its +nativecomp variant is used, which it is by default. You can turn it off by installing with sudo port install emacs -nativecomp.

comment:5 Changed 2 weeks ago by clegra

Thank you very much for the suggestion of the restricted build of emacs.

I uninstalled emacs, and then used the command you thankfully provided me with "sudo port install emacs -nativecomp", but it automatically recurs again on xfig and gcc7 of which I already know that it fails persistently. Please see the response below.

I should admit that I do not really understand/oversee the complexity involved. emacs works and that is fine for me. I would just want to prevent that every "sudo port upgrade outdated" runs into the libgcc7 problem ... which I unfortunately was still not able to remove.

In any case: much appreciation for your help!

sudo port uninstall emacs
Password:
--->  Deactivating emacs @29.3_0+nativecomp+treesitter
--->  Cleaning emacs
--->  Uninstalling emacs @29.3_0+nativecomp+treesitter
--->  Cleaning emacs

sudo port install emacs -nativecomp
--->  Computing dependencies for emacs
The following dependencies will be installed: 
 autoconf
 automake
Continue? [Y/n]: y
--->  Fetching archive for autoconf
--->  Attempting to fetch autoconf-2.72_0.any_any.noarch.tbz2 from https://packages.macports.org/autoconf
--->  Attempting to fetch autoconf-2.72_0.any_any.noarch.tbz2.rmd160 from https://packages.macports.org/autoconf
--->  Installing autoconf @2.72_0
--->  Activating autoconf @2.72_0
--->  Cleaning autoconf
--->  Fetching archive for automake
--->  Attempting to fetch automake-1.16.5_0.any_any.noarch.tbz2 from https://packages.macports.org/automake
--->  Attempting to fetch automake-1.16.5_0.any_any.noarch.tbz2.rmd160 from https://packages.macports.org/automake
--->  Installing automake @1.16.5_0
--->  Activating automake @1.16.5_0
--->  Cleaning automake
--->  Fetching archive for emacs
--->  Attempting to fetch emacs-29.3_0+treesitter.darwin_20.x86_64.tbz2 from https://packages.macports.org/emacs
--->  Attempting to fetch emacs-29.3_0+treesitter.darwin_20.x86_64.tbz2 from http://fco.it.packages.macports.org/emacs
--->  Attempting to fetch emacs-29.3_0+treesitter.darwin_20.x86_64.tbz2 from https://fra.de.packages.macports.org/emacs
--->  Fetching distfiles for emacs
--->  Attempting to fetch emacs-29.3.tar.gz from https://distfiles.macports.org/emacs
--->  Verifying checksums for emacs                                                  
--->  Extracting emacs
--->  Applying patches to emacs
--->  Configuring emacs
Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  alignof: found in emacs-29.3/config.log
  re_search: found in emacs-29.3/config.log
  re_compile_pattern: found in emacs-29.3/config.log
  re_set_syntax: found in emacs-29.3/config.log
  MIN: found in emacs-29.3/config.log
  __fpending: found in emacs-29.3/config.log
--->  Building emacs
--->  Staging emacs into destroot                        
--->  Installing emacs @29.3_0+treesitter                
--->  Activating emacs @29.3_0+treesitter
--->  Cleaning emacs
--->  Scanning binaries for linking errors
--->  Found 9 broken files, matching files to ports      
Warning: No port p5.26-net-ssleay found in the index; can't rebuild
--->  Found 2 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 xfig @3.2.9
 gcc7 @7.5.0
Continue? [Y/n]: n

comment:6 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

That output shows that emacs installed successfully, and that you already had xfig and gcc7 installed, and they are broken, and you are being invited to rebuild them. Note that the check for broken ports happens after you install any port and does not mean that those broken ports are related to the port you just installed.

It doesn't really matter why gcc7 is broken since we already know it is not compatible with your OS and cannot be built on your OS so you should uninstall it.

As for why xfig is broken and whether it will build on your OS, I don't know. We had successful builds on the buildbot on all OS versions so you should try to rebuild it and report any problems you encounter.

comment:7 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Also, note that you already had emacs successfully installed with the default variants (+nativecomp+treesitter) prior to uninstalling it. You could reinstall it with the default variants if you like.

comment:8 in reply to:  6 Changed 2 weeks ago by clegra

Thank you very much for the explanations. They were very helpful for me.

In particular for the information that broken ports are always checked after installation of specific ports, without that there has to be a relation to the installed ports.

Following your suggestion I uninstalled the specific version of xfig that was mentioned in my output (xfig @3.2.9), together with the specific version of gcc7@7.5.0 of gcc that caused the problem on my MacOS. Afterwards I reinstalled xfig. That went well. I also cut leaves, and since about that time the error messages concerning libgcc7 have disappeared after port installations and "sudo port upgrade".

I am very happy about that outcome, and for your help. I have learned a few important things more about the port system. In fact, I am very thankful for how quick and reliable it is possible to get help here. Usually there are years between tickets I open, but getting help quickly is my repeated very positive experience that I cherish. Thank you and the community here!

Note: See TracTickets for help on using tickets.