https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102865

            Bug ID: 102865
           Summary: gcc-12.0 HEAD fails to compile on x86_64 Darwin:
                    unknown machine mode ‘HF’
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alpha+gcc at alphaservcomputing dot solutions
  Target Milestone: ---

Created attachment 51639
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51639&action=edit
Attempted (not very elegant) fix

Latest GCC fails to build since 3ccb523bdd78e6ba3c133064be90cdf19dcbf896 on
MacOS x86_64 without HF.

Configuration:
`./configure --with-system-zlib --disable-bootstrap --with-newlib
--disable-multiarch --disable-multilib --enable-languages=fortran --disable-lto
--with-native-system-header-dir=/usr/include
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk`
(CFLAGS/CPPFLAGS: `-fexceptions -Wformat -Werror=format-security
-mmacosx-version-min=10.12
-fdebug-prefix-map=/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src=.
-I/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/buildenv/include
-O2 -Wno-error=format-security -fno-exceptions -Wfatal-errors`)

Build Failure:
```
/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src/host-x86_64-apple-darwin18.7.0/gcc/xgcc
-B/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src/host-x86_64-apple-darwin18.7.0/gcc/
-B/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/root/x86_64-apple-darwin18.7.0/bin/
-B/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/root/x86_64-apple-darwin18.7.0/lib/
-isystem
/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/root/x86_64-apple-darwin18.7.0/include
-isystem
/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/root/x86_64-apple-darwin18.7.0/sys-include

-fdebug-prefix-map=/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src=.
 -g -fexceptions -Wformat -Werror=format-security -mmacosx-version-min=10.12
-fdebug-prefix-map=/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src=.
-I/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/buildenv/include
-O2 -Wno-error=format-security -fno-exceptions -Wfatal-errors -O2  -g
-fexceptions -Wformat -Werror=format-security -mmacosx-version-min=10.12
-fdebug-prefix-map=/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/src=.
-I/private/var/folders/0s/n3s60vpj3xlb2k5v7yv9vc0c0000gq/T/qbws-xein9n_m/buildenv/include
-O2 -Wno-error=format-security -fno-exceptions -Wfatal-errors -DIN_GCC    -W
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag
-Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag
-Wold-style-definition  -isystem ./include   -mmacosx-version-min=10.8
-fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  
-mmacosx-version-min=10.8 -fno-common -I. -I.
-I../../host-x86_64-apple-darwin18.7.0/gcc -I../.././libgcc -I../.././libgcc/.
-I../.././libgcc/../gcc -I../.././libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS
-o sfp-exceptions_s.o -MT sfp-exceptions_s.o -MD -MP -MF sfp-exceptions_s.dep
-DSHARED  -c ../.././libgcc/config/i386/sfp-exceptions.c
In file included from ../.././libgcc/config/i386/sfp-exceptions.c:25:
../.././libgcc/config/i386/sfp-machine.h:82:1: error: unknown machine mode ‘HF’
   82 | typedef float alias_HFtype __attribute__ ((mode (HF)));
      | ^~~~~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [sfp-exceptions_s.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-target-libgcc] Error 2
make: *** [all] Error 2
```

System:
```
$ uname -a
Darwin mac-build-003 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14
PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

$ sysctl -a | grep machdep.cpu
machdep.cpu.max_basic: 22
machdep.cpu.max_ext: 2147483656
machdep.cpu.vendor: GenuineIntel
machdep.cpu.brand_string: Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
machdep.cpu.family: 6
machdep.cpu.model: 158
machdep.cpu.extmodel: 9
machdep.cpu.extfamily: 0
machdep.cpu.stepping: 10
machdep.cpu.feature_bits: 9221960262849657855
machdep.cpu.leaf7_feature_bits: 43806655 1073741824
machdep.cpu.leaf7_feature_bits_edx: 2617254912
machdep.cpu.extfeature_bits: 1241984796928
machdep.cpu.signature: 591594
machdep.cpu.brand: 0
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA
CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ
DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC
MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
machdep.cpu.leaf7_features: RDWRFSGS TSC_THREAD_OFFSET SGX BMI1 HLE AVX2 SMEP
BMI2 ERMS INVPCID RTM FPU_CSDS MPX RDSEED ADX SMAP CLFSOPT IPT SGXLC MDCLEAR
TSXFA IBRS STIBP L1DF SSBD
machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP
TSCI
machdep.cpu.logical_per_package: 16
machdep.cpu.cores_per_package: 8
machdep.cpu.microcode_version: 180
machdep.cpu.processor_flag: 5
machdep.cpu.mwait.linesize_min: 64
machdep.cpu.mwait.linesize_max: 64
machdep.cpu.mwait.extensions: 3
machdep.cpu.mwait.sub_Cstates: 286531872
machdep.cpu.thermal.sensor: 1
machdep.cpu.thermal.dynamic_acceleration: 1
machdep.cpu.thermal.invariant_APIC_timer: 1
machdep.cpu.thermal.thresholds: 2
machdep.cpu.thermal.ACNT_MCNT: 1
machdep.cpu.thermal.core_power_limits: 1
machdep.cpu.thermal.fine_grain_clock_mod: 1
machdep.cpu.thermal.package_thermal_intr: 1
machdep.cpu.thermal.hardware_feedback: 0
machdep.cpu.thermal.energy_policy: 1
machdep.cpu.xsave.extended_state: 31 832 1088 0
machdep.cpu.xsave.extended_state1: 15 832 256 0
machdep.cpu.arch_perf.version: 4
machdep.cpu.arch_perf.number: 8
machdep.cpu.arch_perf.width: 48
machdep.cpu.arch_perf.events_number: 7
machdep.cpu.arch_perf.events: 0
machdep.cpu.arch_perf.fixed_number: 3
machdep.cpu.arch_perf.fixed_width: 48
machdep.cpu.cache.linesize: 64
machdep.cpu.cache.L2_associativity: 4
machdep.cpu.cache.size: 256
machdep.cpu.tlb.inst.large: 8
machdep.cpu.tlb.data.small: 64
machdep.cpu.tlb.data.small_level1: 128
machdep.cpu.address_bits.physical: 39
machdep.cpu.address_bits.virtual: 48
machdep.cpu.core_count: 6
machdep.cpu.thread_count: 6
machdep.cpu.tsc_ccc.numerator: 250
machdep.cpu.tsc_ccc.denominator: 2
```

Patch that caused the regression:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3ccb523bdd78e6ba3c133064be90cdf19dcbf896

Attached is a [not-very elegant] fix (macro hell makes this hard).
  • [Bug bootstrap/... alpha+gcc at alphaservcomputing dot solutions via Gcc-bugs

Reply via email to