Opened 6 years ago

Last modified 3 years ago

#56996 new defect

libgcc45, gcc47, gcc48: error: non-local symbol required in directive

Reported by: mopihopi Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: sierra Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), cjones051073 (Chris Jones), kencu (Ken), alaingirault, dbl001 (dbl)
Port: libgcc45, gcc47, gcc48

Description

Upgrading libgcc45 fails on macOS 10.12.6. On macOS 10.13 there is an error that it is "not supported on macOS High Sierra and newer", however this is on macOS 10.12 Sierra where libgcc45 @4.5.4_14 works. If it is no longer intended to work on Sierra then the error should be updated.

$ port installed libgcc45
The following ports are currently installed:
  libgcc45 @4.5.4_14 (active)
$ sudo port upgrade libgcc45
--->  Computing dependencies for libgcc45
--->  Fetching archive for libgcc45
--->  Attempting to fetch libgcc45-4.5.4_15.darwin_16.x86_64.tbz2 from https://packages.macports.org/libgcc45
--->  Attempting to fetch libgcc45-4.5.4_15.darwin_16.x86_64.tbz2 from http://sea.us.packages.macports.org/macports/packages/libgcc45
--->  Attempting to fetch libgcc45-4.5.4_15.darwin_16.x86_64.tbz2 from http://ywg.ca.packages.macports.org/mirror/macports/packages/libgcc45
--->  Fetching distfiles for libgcc45
--->  Verifying checksums for libgcc45
--->  Extracting libgcc45
--->  Applying patches to libgcc45
--->  Configuring libgcc45
--->  Building libgcc45
Error: Failed to build libgcc45: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1510
$ xcodebuild -version
Xcode 9.2
Build version 9C40b
$ 

The log file contains the following error:

:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/build/./gcc/ -B/opt/local/x86_64-apple-darwin16/bin/ -B/opt/local/x86_64-apple-darwin16/lib/ -isystem /opt/local/x86_64-apple-darwin16/include -isystem /opt/local/x86_64-apple-darwin16/sys-include -fgnu-runtime -c -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc -g -pipe -Os -W -Wall -Wwrite-strings -Wstrict-prototypes -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc/objc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc/../gcc/config -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc/../include /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc45/libgcc45/work/gcc-4.5.4/libobjc/linking.m  -fno-common -DPIC -o .libs/linking.o
:info:build <stdin>:95:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_SYMBOLS
:info:build                ^
:info:build <stdin>:126:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_METH_VAR_NAME_0
:info:build                ^
:info:build <stdin>:130:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_METH_VAR_TYPE_0
:info:build                ^
:info:build <stdin>:135:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_SELECTOR_TABLE
:info:build                ^
:info:build <stdin>:145:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_CLASS_NAME_0
:info:build                ^
:info:build <stdin>:149:16: error: non-local symbol required in directive
:info:build .no_dead_strip L_OBJC_MODULES
:info:build                ^
:info:build make[2]: *** [linking.lo] Error 1

Attachments (3)

gcc48-high-sierra.zip (11.3 KB) - added by kencu (Ken) 6 years ago.
gcc48 adapted to high sierra for testing 20180916
gcc48-patched-high-sierra-test-suite.txt (382.2 KB) - added by kencu (Ken) 6 years ago.
current version of the gcc48 test suite built on high sierra to get an idea of how it's working.
gcc48-10.11-test.txt (246.7 KB) - added by kencu (Ken) 6 years ago.
gcc48 test suite on El Cap (10.11) to compare

Download all attachments as: .zip

Change History (29)

comment:1 Changed 6 years ago by jmroot (Joshua Root)

Cc: MarcusCalhoun-Lopez added; mcalhoun@… removed

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

As far as I remember, gcc prior to version 5 doesn't build with Xcode 9 or later, regardless of OS version, and we should update the error message to reflect that. If you must use gcc, please use a newer one.

comment:3 Changed 6 years ago by jmroot (Joshua Root)

According to https://github.com/ruda/jonesforth-macintel/issues/1, "The error was the result of GNU Assembler interpreting all symbols starting with letter "L" as local."

comment:4 Changed 6 years ago by jmroot (Joshua Root)

Same error on the buildbot: https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/66746/steps/install-port

I wonder what changed since June when revision 14 built successfully.

comment:6 Changed 6 years ago by jmroot (Joshua Root)

Cc: cjones051073 added

My guess would be that this is due to cctools defaulting to +xcode.

comment:7 Changed 6 years ago by cjones051073 (Chris Jones)

cctools defaults to using the xcode variant when it detects an Xcode version 9 or newer. This variant means the port simply installs wrapper scripts that use the Xcode supplied toolchain, instead of building its own. The supplied log shows that Xcode 9.2 is being used on macOS 10.12 so this is why the xcode variant is being activated. This is what has changed since June, as prior to this cctools was installing its own tool kit that was based on Xcode 8 (and cannot be updated until Apple open sources the required tools). This is why the Xcode variant came about, as using tools older than the Xcode compiler was causing issues in a few places.

Do we really need libgcc45 on macOS 10.12 ? Searching the ports tree nothing is depending on it, so I would suggest just obsoleting this port on 10.12, as it is on 10.13. If a gcc compiler is required, use gcc8 instead...

Last edited 6 years ago by cjones051073 (Chris Jones) (previous) (diff)

comment:8 Changed 6 years ago by kencu (Ken)

I had suggested an Xcode test rather than an OS test three months ago 56511#comment:2, but I never got around to actually changing it.

comment:9 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: libgcc45 @4.5.4_15: fails to upgrade on macOS 10.12.6libgcc45 @4.5.4_15: error: non-local symbol required in directive

comment:10 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: sierra added

comment:11 Changed 6 years ago by kencu (Ken)

how about this test?

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 Changed 6 years ago by nbolyard

Should I go back to Xcode 8.something? will MacPorts 2.5.3 let me? I seem to recall that port told me I need 9.0 or later. Is that the error message that Ryan cited above?

comment:13 Changed 6 years ago by cjones051073 (Chris Jones)

Why do you care about such an outdated gcc version ? If its just preventing your update than manually uninstall the affected gcc4/libgcc4 ports. Nothing should be depending in them. If you need a gcc compiler for your own work, use something up to date, like gcc8.

Last edited 6 years ago by cjones051073 (Chris Jones) (previous) (diff)

comment:14 Changed 6 years ago by nbolyard

My employer forces me to use MacOS 10.12 and gcc 4.7

comment:15 Changed 6 years ago by cjones051073 (Chris Jones)

Thats frankly ridiculous

comment:16 Changed 6 years ago by nbolyard

But it's a fact. Will going back to Xcode 8 solve this problem for me?

comment:17 Changed 6 years ago by cjones051073 (Chris Jones)

Yes.

comment:18 Changed 6 years ago by cjones051073 (Chris Jones)

But might cause others...i cannot say for sure.

comment:19 Changed 6 years ago by kencu (Ken)

It's also possible to have two versions of Xcode installed on your system. You can select one or the other. It takes some "keeping things straight", but I've done it for many years.

That way you can use Xcode 9 most of the time, and just use Xcode 8 to build gcc47.

comment:20 Changed 6 years ago by kencu (Ken)

Looks like that advice didn't work, sorry for not trying it before spouting off. I'm not sure if this can be overridden or if it's a hard error, but it's not trivial anyway:

$ sudo xcode-select --switch /Volumes/4TBSSHD/Disk_Images/Xcode_related_files/xcode_833/Xcode.app/Contents/Developer

$ sudo port -v install gcc48
Error: The installed version of Xcode (8.3.3) is too old to use on the installed OS version. Version 9.3 or later is recommended on Mac OS X 10.13.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gcc48 failed

This was on 10.13. The same approach might work on 10.12, however.

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:21 Changed 6 years ago by kencu (Ken)

FYI, I tried building gcc48 on 10.13 against several different SDKs (10.10 through 10.12), and using gcc6 against different SDKs, but could never make that work.

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

Nelson, I have backported the relevant patches as far as gcc48, which installs for me on High Sierra and does a reasonable if not perfect job in the gcc test suite. I'm not saying this is perfect just now -- call it a work in progress -- but it builds, installs, and runs in the current MacPorts environment. Might still turn out to need some tweaking for some later patch that is helpful that I didn't include. I'll put it here for you to consider, test as you need to, and use if you want. It's not gcc47 -- but it's probably a good start on what gcc47 would need.

Changed 6 years ago by kencu (Ken)

Attachment: gcc48-high-sierra.zip added

gcc48 adapted to high sierra for testing 20180916

Changed 6 years ago by kencu (Ken)

current version of the gcc48 test suite built on high sierra to get an idea of how it's working.

comment:23 Changed 6 years ago by kencu (Ken)

The gcc48 testsuite on 10.13 High Sierra Xcode9 finished, and actually looks fairly decent to me:

		=== gcc Summary ===

# of expected passes		93246
# of unexpected failures	552
# of expected failures		266
# of unresolved testcases	227
# of unsupported tests		1629

		=== g++ Summary ===

# of expected passes		48910
# of unexpected failures	3442
# of unexpected successes	4
# of expected failures		292
# of unresolved testcases	103
# of unsupported tests		1069

		=== gfortran Summary ===

# of expected passes		43985
# of unexpected failures	70
# of expected failures		56
# of unresolved testcases	11
# of unsupported tests		72

		=== objc Summary ===

# of expected passes		5723
# of unexpected failures	110
# of expected failures		6
# of unresolved testcases	111
# of unsupported tests		91

		=== obj-c++ Summary ===

# of expected passes		2972
# of unexpected failures	69
# of expected failures		18
# of unresolved testcases	60
# of unsupported tests		74

		=== go tests ===

Schedule of variations:
    unix

Running target unix
Running /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc48/gcc48/work/gcc-4.8.5/gcc/testsuite/go.dg/dg.exp ...
ERROR: GOC_UNDER_TEST (gccgo) does not exist

comment:24 Changed 6 years ago by kencu (Ken)

For comparison, here is the gcc48 test suite on 10.11, where gcc48 is available via MacPorts:

		=== gcc Summary ===

# of expected passes		92061
# of unexpected failures	207
# of expected failures		266
# of unresolved testcases	36
# of unsupported tests		2453

		=== g++ Summary ===

# of expected passes		52293
# of unexpected failures	135
# of expected failures		292
# of unresolved testcases	17
# of unsupported tests		1061

		=== gfortran Summary ===

# of expected passes		43985
# of unexpected failures	70
# of expected failures		56
# of unresolved testcases	11
# of unsupported tests		72

		=== objc Summary ===

# of expected passes		5725
# of unexpected failures	108
# of expected failures		6
# of unresolved testcases	111
# of unsupported tests		91

		=== obj-c++ Summary ===

# of expected passes		2996
# of unexpected failures	45
# of expected failures		18
# of unresolved testcases	60
# of unsupported tests		74

I note there are quite a few more unexpected failures on 10.13 vs 10.11 in c++ . The details of which tests failed are in the full summaries. The other suites are pretty comparable.

Changed 6 years ago by kencu (Ken)

Attachment: gcc48-10.11-test.txt added

gcc48 test suite on El Cap (10.11) to compare

comment:25 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kencu alaingirault dbl001 added
Port: gcc47 gcc48 added
Summary: libgcc45 @4.5.4_15: error: non-local symbol required in directivelibgcc45, gcc47, gcc48: error: non-local symbol required in directive

Has duplicates #60087 and #61398.

Ken, since you've developed fixes, why not commit them?

comment:26 Changed 3 years ago by kencu (Ken)

Yeah, perhaps I will. Rebuilding gcc48 fails on even older systems when clang >= 5.0 is installed, as it goes to clang as assembler, which shows this error -- so I had to patch this again myself just now to rebuild gcc48 on SnowLeopard.

Note: See TracTickets for help on using tickets.