Opened 5 months ago

#64162 new defect

gcc11 @11.2.0_2 cannot be used on macOS 12.0.1, Monterey, at least not outside of MacPorts

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: monterey Cc:
Port: gcc11


GNU Emacs 28.0.90 and 29.0.50 (port emacs-devel) show a bug when compiled on Monterey: the calendar mode-line has a white background where the "buttons" ?, ., or o are. This happens in X11 and also for the NS variant (without metal). The attached screenshot shows it. OK looks GNU Emacs 28.0.50 – compiled on Big Sur.

So I want to see whether this issue comes from the macOS or from the compiler or from the version of GNU Emacs. Clang 13, which seems to work OK on Monterey, makes this bug appear. Trying to use GCC 11 (GCC 10 does not yet build on Monterey) the configure stage fails here:

checking AppKit/AppKit.h usability... no
checking AppKit/AppKit.h presence... yes
configure: WARNING: AppKit/AppKit.h: present but cannot be compiled
configure: WARNING: AppKit/AppKit.h:     check for missing prerequisite headers?
configure: WARNING: AppKit/AppKit.h: see the Autoconf documentation
configure: WARNING: AppKit/AppKit.h:     section "Present But Cannot Be Compiled"
configure: WARNING: AppKit/AppKit.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to ##
configure: WARNING:     ## ------------------------------------ ##
checking for AppKit/AppKit.h... no
configure: error: The include files (AppKit/AppKit.h etc) that
are required for a Nextstep build are missing or cannot be compiled.
Either fix this, or re-configure with the option '--without-ns'.

Since I am configuring with CFLAGS=-H` I can see which C header files are used to compile the test files, for which I am using:

gcc version 11.2.0 (MacPorts gcc11 11.2.0_2) 
COLLECT_GCC_OPTIONS='-g' '-H' '-pipe' '-fPIC' '-fno-common' '-Os' '-fomit-frame-pointer' '-I' '/opt/local/include' '-v' '-L/opt/local/lib' '-m64' '-mmacosx-version-min=12.0.0'  '-mtune=core2' '-dumpdir' 'a-'
 /opt/local/libexec/gcc/x86_64-apple-darwin21/11.2.0/cc1 -quiet -v -I /opt/local/include -H -D__DYNAMIC__ conftest.c -fPIC -feliminate-unused-debug-symbols -quiet -dumpdir a- -dumpbase conftest.c -dumpbase-ext .c -m64 -mmacosx-version-min=12.0.0 -mtune=core2 -g -Os -version -fPIC -fno-common -fomit-frame-pointer -o - |
 /opt/local/bin/as -arch x86_64 -v -I /opt/local/include -force_cpusubtype_ALL -mmacosx-version-min=12.0 -o /var/folders/dq/9fbvqzn50cs6znm9h1vd3l6w0000gp/T//ccUWGV5C.o
GNU C17 (MacPorts gcc11 11.2.0_2) version 11.2.0 (x86_64-apple-darwin21)
	compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.22.1-GMP
... /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h
.... /opt/local/lib/gcc11/gcc/x86_64-apple-darwin21/11.2.0/include-fixed/limits.h
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10,
                 from conftest.c:105:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:559:29: error: expected identifier or '(' before '^' token
  559 | typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
      |                             ^
... /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h
.... /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h
..... /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h
...... /opt/local/lib/gcc11/gcc/x86_64-apple-darwin21/11.2.0/include/stddef.h
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10,
                 from conftest.c:105:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: error: unknown type name 'nullable'
   19 | - (id)copyWithZone:(nullable NSZone *)zone;
      |                     ^~~~~~~~

This is just the start of a very long list of errors (36 k lines) that I am attaching. C++ or Objective C are not my languages

Attachments (2)

Buggy and OK calendar mode-line.pdf (1.3 MB) - added by ballapete (Peter "Pete" Dyballa) 5 months ago.
Bug in calendar mode-line
configure failure.log (4.0 MB) - added by ballapete (Peter "Pete" Dyballa) 5 months ago.
failure to compile the configure test file

Change History (2)

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

Bug in calendar mode-line

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

Attachment: configure failure.log added

failure to compile the configure test file

Note: See TracTickets for help on using tickets.