Repository: spack/spack

Issue:
compiling GCC on mac os x
I'm trying to use spack on mac:
```uname -a
Darwin iMac-5K-Marcin.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
```

I have 3 compilers installed on my system:
```spack compilers
==> Available compilers
-- clang highsierra-x86_64 --------------------------------------
clang@9.0.0-apple

-- gcc highsierra-x86_64 ----------------------------------------
gcc@7.3.0  gcc@4.9.0
```

I want to compile `gcc@7.3.0` with spack. I have tried `spack install gcc@7.3.0%gcc@7.3.0` and `spack install gcc@7.3.0%clang`. Both end in error during gcc compilation: 

When compiling using gcc: `/usr/include/sys/syslog.h:227:124: error: expected ',' or ';' before '__asm'`

When compiling using clang the error log is much longer:
```==> Error: ProcessError: Command exited with status 2:
    'make' '-j8' 'bootstrap'

19 errors found in build log:
     9145      /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/c-family/c-format.c:2656:3
               5: note: in instantiation of member function 'object_allocator<f
               ormat_wanted_type>::allocate' requested here
     9146                    wanted_type_ptr = fwt_pool.allocate ();
     9147                                               ^
     9148      In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/c-fa
               mily/c-omp.c:26:
     9149      In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/core
               types.h:369:
     9150      In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/hash
               -table.h:561:
  >> 9151      /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/mem-stats.h:126:1: In file
                included from warning/Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/c-fa
               mily/c-format.c:26:
     9152      /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/alloc-pool.h:185:13: warni
               ng: using extended field designator is an extension [-Wextended-
               offsetof]
     9153                                            - offsetof (allocation_obj
               ect,
     9154                                              ^
     9155      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefau
               lt.xctoolchain/usr/lib/clang/9.1.0/include/stddef.h:120:24: note
               : expanded from macro 'offsetof'
     9156      #define offsetof(t, d) __builtin_offsetof(t, d)
     9157                             ^                     ~

     ...

     19988     29:
     19989     struct mem_usage/Users/marcinpolkowski/spack/var/spack/stage/gcc
               -7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.
               h:62:1: warning
     19990     : ^
     19991     class 'rtx_def' was previously declared as a struct [-Wmismatche
               d-tags]
     19992     class rtx_def;
     19993     ^
  >> 19994     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:55:8: /Users/m
               arcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxh
               d7zd2xcj2kjz2wq/gcc-7.3.0/gcc/hash-table.h:341:note: previous us
               e is here
     19995     struct rtx_def;
     19996            ^
     19997     1: note: did you mean struct here?
     19998     class mem_usage;
     19999     ^~~~~
     20000     struct

     ...

     31484     /Users/marcinpolkowski/spack/lib/spack/env/clang/clang++ -std=gn
               u++98 -fno-PIE -c   -g  -DIN_GCC    -fno-strict-aliasing -fno-ex
               ceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-na
               rrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format
               -attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-va
               riadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG
               _H -I. -I. -I/Users/marcinpolkowski/spack/var/spack/stage/gcc-7.
               3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/. -I/Users/marcinpolkowski/spack/var/
               spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0
               /gcc/../include -I./../intl -I/Users/marcinpolkowski/spack/var/s
               pack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/
               gcc/../libcpp/include -I/Users/marcinpolkowski/spack/opt/spack/d
               arwin-highsierra-x86_64/clang-9.0.0-apple/gmp-6.1.2-vvoefuai3hzh
               7eughdxbihgqsnpvizsn/include -I/Users/marcinpolkowski/spack/opt/
               spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpfr-4.0.1-u7z6
               iirwvjqyhopw226v57v6hzjjvaui/include -I/Users/marcinpolkowski/sp
               ack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpc-1.1
               .0-2da3zvtb3tf6og4w3rhqsagil5oa7tzv/include  -I/Users/marcinpolk
               owski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2
               kjz2wq/gcc-7.3.0/gcc/../libdecnumber -I/Users/marcinpolkowski/sp
               ack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/g
               cc-7.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/../libbacktrace -I/Users/marcinpolkow
               ski/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/i
               sl-0.19-4vwfte5d262cxd3n5o2fpctkbilnmbtg/include  -o gimple-ssa-
               warn-alloca.o -MT gimple-ssa-warn-alloca.o -MMD -MP -MF ./.deps/
               gimple-ssa-warn-alloca.TPo /Users/marcinpolkowski/spack/var/spac
               k/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc
               /gimple-ssa-warn-alloca.c
     31485     clang: warning: treating 'c' input as 'c++' when in C++ mode, th
               is behavior is deprecated [-Wdeprecated]
     31486     clang: warning: treating 'c' input as 'c++' when in C++ mode, th
               is behavior is deprecated [-Wdeprecated]
     31487     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimp
               le-ssa-split-paths.c:23:
     31488     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:62:1: warning:
                class 'rtx_def' was previously declared as a struct [-Wmismatch
               ed-tags]
     31489     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimp
               le-ssa-store-merging.c:107:
  >> 31490     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:62:1: class rt
               x_def;warning
     31491     : ^
     31492     class 'rtx_def' was previously declared as a struct [-Wmismatche
               d-tags]
     31493     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:55:8: note: pr
               evious use is here
     31494     class rtx_def;
     31495     ^
     31496     struct rtx_def;

     ...

     44558     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/cgra
               ph.h:24:
     44559     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/ipa-ref.h:26:1: warning: c
               lass 'symtab_node' was previously declared as a struct [-Wmismat
               ched-tags]
     44560     class symtab_node;
     44561     ^
     44562     ^
     44563     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:55:8: note: pr
               evious use is here
  >> 44564     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/tree-core.h:1673:9: struct
                rtx_def;note
     44565     :        ^previous use is here
     44566
     44567      struct symtab_node *symtab_node;
     44568             ^
     44569     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/ipa-
               prop.c:31:
     44570     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/cgraph.h:94:1: warning: 's
               ymtab_node' defined as a class here but previously declared as a
                struct [-Wmismatched-tags]

     ...

     50555     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/rtl.h:1183:29: note: expan
               ded from macro 'XWINT'
     50556     #define XWINT(RTX, N)               ((RTX)->u.hwint[N])
     50557                                          ^              ~
     50558     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/rtl.h:425:5: note: array '
               hwint' declared here
     50559         HOST_WIDE_INT hwint[1];
     50560         ^
  >> 50561     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/hwint.h:59:26: 4 warnings
               generated.
     50562     note: expanded from macro 'HOST_WIDE_INT'
     50563     #   define HOST_WIDE_INT long long
     50564                              ^
     50565     /Users/marcinpolkowski/spack/lib/spack/env/clang/clang++ -std=gn
               u++98 -fno-PIE -c   -g  -DIN_GCC    -fno-strict-aliasing -fno-ex
               ceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-na
               rrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format
               -attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-va
               riadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG
               _H -I. -I. -I/Users/marcinpolkowski/spack/var/spack/stage/gcc-7.
               3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/. -I/Users/marcinpolkowski/spack/var/
               spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0
               /gcc/../include -I./../intl -I/Users/marcinpolkowski/spack/var/s
               pack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/
               gcc/../libcpp/include -I/Users/marcinpolkowski/spack/opt/spack/d
               arwin-highsierra-x86_64/clang-9.0.0-apple/gmp-6.1.2-vvoefuai3hzh
               7eughdxbihgqsnpvizsn/include -I/Users/marcinpolkowski/spack/opt/
               spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpfr-4.0.1-u7z6
               iirwvjqyhopw226v57v6hzjjvaui/include -I/Users/marcinpolkowski/sp
               ack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpc-1.1
               .0-2da3zvtb3tf6og4w3rhqsagil5oa7tzv/include  -I/Users/marcinpolk
               owski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2
               kjz2wq/gcc-7.3.0/gcc/../libdecnumber -I/Users/marcinpolkowski/sp
               ack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/g
               cc-7.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/../libbacktrace -I/Users/marcinpolkow
               ski/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/i
               sl-0.19-4vwfte5d262cxd3n5o2fpctkbilnmbtg/include  -o lists.o -MT
                lists.o -MMD -MP -MF ./.deps/lists.TPo /Users/marcinpolkowski/s
               pack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/
               gcc-7.3.0/gcc/lists.c
     50566     clang: warning: treating 'c' input as 'c++' when in C++ mode, th
               is behavior is deprecated [-Wdeprecated]
     50567     25 warnings generated.

     ...

     52591     class rtx_def;
     52592     ^~~~~
     52593     struct
     52594     /Users/marcinpolkowski/spack/lib/spack/env/clang/clang++ -std=gn
               u++98 -fno-PIE -c   -g  -DIN_GCC    -fno-strict-aliasing -fno-ex
               ceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-na
               rrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format
               -attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-va
               riadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG
               _H -I. -I. -I/Users/marcinpolkowski/spack/var/spack/stage/gcc-7.
               3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/. -I/Users/marcinpolkowski/spack/var/
               spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0
               /gcc/../include -I./../intl -I/Users/marcinpolkowski/spack/var/s
               pack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/
               gcc/../libcpp/include -I/Users/marcinpolkowski/spack/opt/spack/d
               arwin-highsierra-x86_64/clang-9.0.0-apple/gmp-6.1.2-vvoefuai3hzh
               7eughdxbihgqsnpvizsn/include -I/Users/marcinpolkowski/spack/opt/
               spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpfr-4.0.1-u7z6
               iirwvjqyhopw226v57v6hzjjvaui/include -I/Users/marcinpolkowski/sp
               ack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/mpc-1.1
               .0-2da3zvtb3tf6og4w3rhqsagil5oa7tzv/include  -I/Users/marcinpolk
               owski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2
               kjz2wq/gcc-7.3.0/gcc/../libdecnumber -I/Users/marcinpolkowski/sp
               ack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/g
               cc-7.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/Users/marc
               inpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7z
               d2xcj2kjz2wq/gcc-7.3.0/gcc/../libbacktrace -I/Users/marcinpolkow
               ski/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/i
               sl-0.19-4vwfte5d262cxd3n5o2fpctkbilnmbtg/include  -o lra-remat.o
                -MT lra-remat.o -MMD -MP -MF ./.deps/lra-remat.TPo /Users/marci
               npolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd
               2xcj2kjz2wq/gcc-7.3.0/gcc/lra-remat.c
     52595     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lra-
               constraints.c:114:
     52596     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/rtl.
               h:3374:
  >> 52597     ./genrtl.h:435:3: In file included from /Users/marcinpolkowski/s
               pack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/
               gcc-7.3.0/gcc/lra-lives.c:32:
     52598     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/rtl.h:302:1: warning: 'rtx
               _def' defined as a struct here but previously declared as a clas
               s [-Wmismatched-tags]
     52599     struct GTY((desc("0"), tag("0"),
     52600     ^
     52601     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/coretypes.h:62:1: note: di
               d you mean struct here?
     52602     class rtx_def;
     52603     ^~~~~

     ...

     54492     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-cgraph.c:1458:13: warn
               ing: struct 'lto_input_block' was previously declared as a class
                [-Wmismatched-tags]
     54493     extern void lto_input_data_block (struct lto_input_block *, void
                *, size_t);
     54494                                       ^~~~~~
     54495                                       class
     54496     input_edge (struct lto_input_block *ib, vec<symtab_node *> nodes
               ,
     54497                 ^/Users/marcinpolkowski/spack/var/spack/stage/gcc-7.
               3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-streamer.
               h
  >> 54498     :868:26: /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-
               y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-streamer.hwar
               ning:: 371struct 'lto_input_block' was previously declared as a
               class [-Wmismatched-tags]:
     54499     7: note: previous use is here
     54500     class lto_input_block
     54501           ^
     54502     tree lto_input_tree_ref (struct lto_input_block *, struct data_i
               n *,
     54503                              ^
     54504     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-streamer.h:371:7: note
               : previous use is here

     ...

     71992     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:3043:3: warning:
               array index 1 is past the end of the array (which contains 1 ele
               ment) [-Warray-bounds]
     71993     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/target-hooks-macros.h:43:
                gs->op[1] = fn;50
     71994     :  ^      ~
     71995     note: expanded from macro 'HOOK_VECTOR_END'
     71996     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/asan
               .c:26:
     71997     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/targ
               et.h:200:
  >> 71998     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/target.def:3288:1: #define
                HOOK_VECTOR_END(DECL_NAME) HOOK_VECTOR_1(, DECL_NAME ;)}
     71999     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h
                                              ^:
     72000     371:3: note: array 'op' declared here
     72001       tree GTY((length ("%h.num_ops"))) op[1];
     72002       ^
     72003     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/tran
               s-mem.c:warning: empty macro arguments are a C99 feature [-Wc99-
               extensions]
     72004     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h26:

     ...

     92043     :1/Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375g
               eb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-streamer.h:: 371warn
               ing:: 7'mem_usage' defined as a struct here but previously decla
               red as a class [-Wmismatched-tags]
     92044     struct mem_usage
     92045     ^
     92046     : note: previous use is here
     92047     class lto_input_block
     92048           ^
  >> 92049     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/hash-table.h:341:1: /Users
               /marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5z
               xhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/lto-streamer.hnote:: 874did you
               mean struct here?:
     92050     24: note: did you mean class here?
     92051     class mem_usage;
     92052     ^~~~~
     92053     struct
     92054     tree lto_input_tree_1 (struct lto_input_block *, struct data_in
               *,
     92055                            ^~~~~~

     ...

     94257         ^
     94258     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/hwint.h:59:26: note: expan
               ded from macro 'HOST_WIDE_INT'
     94259     #   define HOST_WIDE_INT long long
     94260                              ^
     94261     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/tree
               -vect-stmts.c:27:
     94262     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/rtl.
               h:3374:
  >> 94263     ./genrtl.h:436:3: In file included from warning/Users/marcinpolk
               owski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2
               kjz2wq/gcc-7.3.0/gcc/tree-vect-patterns.c:39:
     94264     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/tree
               -vectorizer.h:25:
     94265     In file included from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/targ
               et.h:200:
     94266     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/target.def:3288:1: warning
               : empty macro arguments are a C99 feature [-Wc99-extensions]
     94267     HOOK_VECTOR_END (addr_space)
     94268     ^
     94269     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/target-hooks-macros.h:43:5
               0: note: expanded from macro 'HOOK_VECTOR_END'

     ...

     94781     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:346:3: note: arra
               y 'op' declared here
     94782       tree GTY((length ("%h.num_ops"))) op[1];
     94783       ^
     94784     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:2599:12: warning:
                array index 3 is past the end of the array (which contains 1 el
               ement) [-Warray-bounds]
     94785         return gs->op[3];
     94786                ^      ~
  >> 94787     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:346:3: array inde
               x 2 is past the end of the array (which contains 1 element) [-Wa
               rray-bounds]
     94788       gs->op[2] = label;
     94789       ^      ~
     94790     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:315:3: note: arra
               y 'op' declared here
     94791       tree GTY((length ("%h.num_ops"))) op[1];
     94792       ^
     94793     /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/gimple.h:3561:3: warning:
               array index 3 is past the end of the array (which contains 1 ele
               ment) [-Warray-bounds]

     ...

     107863    ^
     107864                                    struct symtab_node *ref = NULL);
     107865                                    ^
     107866    /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/cgraph.h:96:3: note: previ
               ous use is here
     107867      symtab_node
     107868      ^
  >> 107869    /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/tree-core.h:1673:9: /Users
               /marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5z
               xhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/cgraph.hnote:: 892previous use i
               s here:
     107870    6: warning: struct 'symtab_node' was previously declared as a cl
               ass [-Wmismatched-tags]
     107871     struct symtab_node *symtab_node;
     107872            ^
     107873                                     struct symtab_node *ref = NULL)
               ;
     107874                                     ^
     107875    /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb
               2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/gcc/cgraph.h:96:3: note: previ
               ous use is here

     ...

     112292    /private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinp
               olkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/
               ./gcc/xgcc -shared-libgcc -B/private/var/folders/vl/34dz_zrj5cnb
               nn6z6k03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8j
               v7lkb/gcc-7.3.0/spack-build/./gcc -nostdinc++ -L/private/var/fol
               ders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinpolkowski/spack-s
               tage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/x86_64-apple-dar
               win17.4.0/libstdc++-v3/src -L/private/var/folders/vl/34dz_zrj5cn
               bnn6z6k03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8
               jv7lkb/gcc-7.3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++
               -v3/src/.libs -L/private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl14
               0000gn/T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.
               3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++-v3/libsupc++
               /.libs -B/Users/marcinpolkowski/spack/opt/spack/darwin-highsierr
               a-x86_64/clang-9.0.0-apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2k
               jz2wq/x86_64-apple-darwin17.4.0/bin/ -B/Users/marcinpolkowski/sp
               ack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/gcc-7.3
               .0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/x86_64-apple-darwin17.4.0/li
               b/ -isystem /Users/marcinpolkowski/spack/opt/spack/darwin-highsi
               erra-x86_64/clang-9.0.0-apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xc
               j2kjz2wq/x86_64-apple-darwin17.4.0/include -isystem /Users/marci
               npolkowski/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-
               apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/x86_64-apple-da
               rwin17.4.0/sys-include    -x c++-header -nostdinc++ -g -O2  -I/p
               rivate/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinpol
               kowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/x8
               6_64-apple-darwin17.4.0/libstdc++-v3/include/x86_64-apple-darwin
               17.4.0 -I/private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/
               T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spa
               ck-build/x86_64-apple-darwin17.4.0/libstdc++-v3/include -I/Users
               /marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5z
               xhd7zd2xcj2kjz2wq/gcc-7.3.0/libstdc++-v3/libsupc++  -O2 -g -std=
               gnu++0x /Users/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y
               26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/libstdc++-v3/include/p
               recompiled/stdc++.h \
     112293    	-o x86_64-apple-darwin17.4.0/bits/stdc++.h.gch/O2ggnu++0x.gch
     112294    /private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinp
               olkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/
               ./gcc/xgcc -shared-libgcc -B/private/var/folders/vl/34dz_zrj5cnb
               nn6z6k03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8j
               v7lkb/gcc-7.3.0/spack-build/./gcc -nostdinc++ -L/private/var/fol
               ders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinpolkowski/spack-s
               tage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/x86_64-apple-dar
               win17.4.0/libstdc++-v3/src -L/private/var/folders/vl/34dz_zrj5cn
               bnn6z6k03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8
               jv7lkb/gcc-7.3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++
               -v3/src/.libs -L/private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl14
               0000gn/T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.
               3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++-v3/libsupc++
               /.libs -B/Users/marcinpolkowski/spack/opt/spack/darwin-highsierr
               a-x86_64/clang-9.0.0-apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2k
               jz2wq/x86_64-apple-darwin17.4.0/bin/ -B/Users/marcinpolkowski/sp
               ack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/gcc-7.3
               .0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/x86_64-apple-darwin17.4.0/li
               b/ -isystem /Users/marcinpolkowski/spack/opt/spack/darwin-highsi
               erra-x86_64/clang-9.0.0-apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xc
               j2kjz2wq/x86_64-apple-darwin17.4.0/include -isystem /Users/marci
               npolkowski/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-
               apple/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/x86_64-apple-da
               rwin17.4.0/sys-include    -x c++-header -nostdinc++ -g -O2  -I/p
               rivate/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinpol
               kowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/x8
               6_64-apple-darwin17.4.0/libstdc++-v3/include/x86_64-apple-darwin
               17.4.0 -I/private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/
               T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spa
               ck-build/x86_64-apple-darwin17.4.0/libstdc++-v3/include -I/Users
               /marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5z
               xhd7zd2xcj2kjz2wq/gcc-7.3.0/libstdc++-v3/libsupc++  -O2 -g /User
               s/marcinpolkowski/spack/var/spack/stage/gcc-7.3.0-y26375geb2bip5
               zxhd7zd2xcj2kjz2wq/gcc-7.3.0/libstdc++-v3/include/precompiled/st
               dc++.h -o x86_64-apple-darwin17.4.0/bits/stdc++.h.gch/O2g.gch
     112295    In file included from /private/var/folders/vl/34dz_zrj5cnbnn6z6k
               03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/
               gcc-7.3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++-v3/inc
               lude/bits/stl_algo.h:62:0,
     112296                     from /private/var/folders/vl/34dz_zrj5cnbnn6z6k
               03fl140000gn/T/marcinpolkowski/spack-stage/spack-stage-n8jv7lkb/
               gcc-7.3.0/spack-build/x86_64-apple-darwin17.4.0/libstdc++-v3/inc
               lude/algorithm:62,
     112297                     from /Users/marcinpolkowski/spack/var/spack/sta
               ge/gcc-7.3.0-y26375geb2bip5zxhd7zd2xcj2kjz2wq/gcc-7.3.0/libstdc+
               +-v3/include/precompiled/stdc++.h:65:
  >> 112298    /private/var/folders/vl/34dz_zrj5cnbnn6z6k03fl140000gn/T/marcinp
               olkowski/spack-stage/spack-stage-n8jv7lkb/gcc-7.3.0/spack-build/
               x86_64-apple-darwin17.4.0/libstdc++-v3/include/bits/stl_tempbuf.
               h:60:10: fatal error: bits/stl_construct.h: No such file or dire
               ctory
     112299     #include <bits/stl_construct.h>
     112300              ^~~~~~~~~~~~~~~~~~~~~~
     112301    compilation terminated.
  >> 112302    make[5]: *** [x86_64-apple-darwin17.4.0/bits/stdc++.h.gch/O2g.gc
               h] Error 1
     112303    make[5]: *** Waiting for unfinished jobs....
  >> 112304    make[4]: *** [all-recursive] Error 1
  >> 112305    make[3]: *** [all] Error 2
  >> 112306    make[2]: *** [all-stage1-target-libstdc++-v3] Error 2
  >> 112307    make[1]: *** [stage1-bubble] Error 2
  >> 112308    make: *** [bootstrap] Error 2```


Discussion:
I think I know what the problem is. Testing the solution now. If it works, I'll submit a PR shortly.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -102,13 +102,12 @@ class Gcc(AutotoolsPackage):
     # depends_on('ppl')
     # depends_on('cloog')
 
-    # TODO: Add a 'test' deptype
-    # https://github.com/spack/spack/issues/1279
-    # depends_on('dejagnu@1.4.4', type='test')
-    # depends_on('expect', type='test')
-    # depends_on('tcl', type='test')
-    # depends_on('autogen@5.5.4:', type='test')
-    # depends_on('guile@1.4.1:', type='test')
+    # https://gcc.gnu.org/install/test.html
+    depends_on('dejagnu@1.4.4', type='test')
+    depends_on('expect', type='test')
+    depends_on('tcl', type='test')
+    depends_on('autogen@5.5.4:', type='test')
+    depends_on('guile@1.4.1:', type='test')
 
     # See https://golang.org/doc/install/gccgo#Releases
     provides('golang',        when='languages=go @4.6:')
@@ -158,7 +157,7 @@ class Gcc(AutotoolsPackage):
         # Fix parallel build on APFS filesystem
         # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797
         if macOS_version() >= Version('10.13'):
-            patch('darwin/apfs.patch', when='@7.2.0')
+            patch('darwin/apfs.patch', when='@6.1:6.4,7.1:7.3')
         patch('darwin/gcc-7.1.0-headerpad.patch', when='@5:')
         patch('darwin/gcc-6.1.0-jit.patch', when='@5:')
         patch('darwin/gcc-4.9.patch1', when='@4.9.0:4.9.3')


Test patch: