Bug 225629 - powerpc64 (POWER9) segfaults randomly (e.g., building lang/gcc5)
Summary: powerpc64 (POWER9) segfaults randomly (e.g., building lang/gcc5)
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-ppc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-02 15:09 UTC by Breno Leitao
Modified: 2021-11-06 09:51 UTC (History)
12 users (show)

See Also:


Attachments
Patch to build lang/gcc6 with system clang (580 bytes, patch)
2018-06-01 19:21 UTC, Kenneth Salerno
no flags Details | Diff
Patch to build lang/gcc6 on ppc64 with clang if available (585 bytes, patch)
2018-06-03 18:11 UTC, Kenneth Salerno
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Breno Leitao 2018-02-02 15:09:41 UTC
I am not able to build gcc5 on a POWER9 VM. Although I am able to bootstrap it on a POWER8 VM, I am facing problems like the following on POWER9:

I am using aports from upstream (HEAD), but I also tried to compile gcc 5.3 and 5.2 and hit the similar issue:

# cd freebsd-ports/lang/gcc5
# make 

c++ -c   -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -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 -I. -I. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../include -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libcpp/include -I/usr/local/include  -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libbacktrace  -DLIBICONV_PLUG -o graphite-sese-to-poly.o -MT graphite-sese-to-poly.o -MMD -MP -MF ./.deps/graphite-sese-to-poly.TPo /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/graphite-sese-to-poly.c
c++ -c   -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -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 -I. -I. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../include -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libcpp/include -I/usr/local/include  -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libbacktrace  -DLIBICONV_PLUG -o gtype-desc.o -MT gtype-desc.o -MMD -MP -MF ./.deps/gtype-desc.TPo gtype-desc.c
c++ -c   -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -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 -I. -I. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../include -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libcpp/include -I/usr/local/include  -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libbacktrace  -DLIBICONV_PLUG -o haifa-sched.o -MT haifa-sched.o -MMD -MP -MF ./.deps/haifa-sched.TPo /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/haifa-sched.c
insn-extract.c: In function 'void insn_extract(rtx_insn*)':
insn-extract.c:3006: internal compiler error: internal consistency failure
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.freebsd.org/support.html> for instructions.
c++ -c   -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -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 -I. -I. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/. -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../include -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libcpp/include -I/usr/local/include  -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../libbacktrace  -DLIBICONV_PLUG -o hw-doloop.o -MT hw-doloop.o -MMD -MP -MF ./.deps/hw-doloop.TPo /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/hw-doloop.c
gmake[5]: *** [Makefile:1067: insn-extract.o] Error 1
gmake[5]: *** Waiting for unfinished jobs....
In file included from /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/dwarf2asm.c:1028:
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h: In static member function 'static size_t vec<T, A, vl_embed>::embedded_size(unsigned int) [with T = std::pair<const char*, tree_node*>, A = va_heap]':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:308:   instantiated from 'static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool) [with T = std::pair<const char*, tree_node*>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1428:   instantiated from 'bool vec<T, va_heap, vl_ptr>::reserve(unsigned int, bool) [with T = std::pair<const char*, tree_node*>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1448:   instantiated from 'bool vec<T, va_heap, vl_ptr>::reserve_exact(unsigned int) [with T = std::pair<const char*, tree_node*>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1463:   instantiated from 'void vec<T, va_heap, vl_ptr>::create(unsigned int) [with T = std::pair<const char*, tree_node*>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1275:   instantiated from 'auto_vec<T, 0ul>::auto_vec(size_t) [with T = std::pair<const char*, tree_node*>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/dwarf2asm.c:929:   instantiated from here
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: invalid access to non-static data member 'vec<std::pair<const char*, tree_node*>, va_heap, vl_embed>::m_vecdata' of NULL object
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: (perhaps the 'offsetof' macro was used incorrectly)
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h: In static member function 'static size_t vec<T, A, vl_embed>::embedded_size(unsigned int) [with T = finalizer, A = va_heap]':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:308:   instantiated from 'static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool) [with T = finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1428:   instantiated from 'bool vec<T, va_heap, vl_ptr>::reserve(unsigned int, bool) [with T = finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1537:   instantiated from 'T* vec<T, va_heap, vl_ptr>::safe_push(const T&) [with T = finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/ggc-page.c:1416:   instantiated from here
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: invalid access to non-static data member 'vec<finalizer, va_heap, vl_embed>::m_vecdata' of NULL object
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: (perhaps the 'offsetof' macro was used incorrectly)
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h: In static member function 'static size_t vec<T, A, vl_embed>::embedded_size(unsigned int) [with T = vec_finalizer, A = va_heap]':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:308:   instantiated from 'static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool) [with T = vec_finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1428:   instantiated from 'bool vec<T, va_heap, vl_ptr>::reserve(unsigned int, bool) [with T = vec_finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1537:   instantiated from 'T* vec<T, va_heap, vl_ptr>::safe_push(const T&) [with T = vec_finalizer]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/ggc-page.c:1419:   instantiated from here
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: invalid access to non-static data member 'vec<vec_finalizer, va_heap, vl_embed>::m_vecdata' of NULL object
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: (perhaps the 'offsetof' macro was used incorrectly)
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/darwin.md: In function 'int recog_1(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/darwin.md:347: warning: label 'L19290' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:4628: warning: label 'L19292' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:1291: warning: label 'L1306' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_4(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:2957: warning: label 'L19636' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:311: warning: label 'L19642' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_6(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8460: warning: label 'L5565' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_8(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:13743: warning: label 'L19997' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:371: warning: label 'L10055' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h: In static member function 'static size_t vec<T, A, vl_embed>::embedded_size(unsigned int) [with T = std::pair<tree_node*, unsigned int>, A = va_heap]':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:308:   instantiated from 'static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool) [with T = std::pair<tree_node*, unsigned int>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1428:   instantiated from 'bool vec<T, va_heap, vl_ptr>::reserve(unsigned int, bool) [with T = std::pair<tree_node*, unsigned int>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1537:   instantiated from 'T* vec<T, va_heap, vl_ptr>::safe_push(const T&) [with T = std::pair<tree_node*, unsigned int>]'
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/auto-profile.c:424:   instantiated from here
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: invalid access to non-static data member 'vec<std::pair<tree_node*, unsigned int>, va_heap, vl_embed>::m_vecdata' of NULL object
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/vec.h:1048: warning: (perhaps the 'offsetof' macro was used incorrectly)
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_10(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11973' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_12(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11977' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_14(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11981' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_15(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11985' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_17(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11961' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_19(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11965' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md: In function 'int recog_21(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:636: warning: label 'L11969' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/gimple-fold.c: In function 'bool gimple_fold_builtin_memory_op(gimple_stmt_iterator*, tree_node*, tree_node*, int)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/gimple-fold.c:865: warning: comparison between signed and unsigned integer expressions
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_22(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:2313: warning: label 'L1870' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:2330: warning: label 'L1883' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8094: warning: label 'L5478' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8235: warning: label 'L5494' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8259: warning: label 'L5502' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8271: warning: label 'L5510' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8094: warning: label 'L5482' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8235: warning: label 'L5498' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8259: warning: label 'L5506' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8271: warning: label 'L5514' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:370: warning: label 'L5530' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:371: warning: label 'L5526' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8345: warning: label 'L5534' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:12076: warning: label 'L8511' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:12097: warning: label 'L8542' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:370: warning: label 'L10049' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:651: warning: label 'L10367' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:663: warning: label 'L11989' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_24(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21049' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:9679: warning: label 'L6619' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:2311: warning: label 'L1865' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L20997' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21003' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21009' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21015' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21031' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21037' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10080: warning: label 'L21043' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_27(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:2985: warning: label 'L2369' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_28(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:311: warning: label 'L2382' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_33(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:9811: warning: label 'L6754' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L6982' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L7110' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L7194' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L21351' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_38(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:337: warning: label 'L6693' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:337: warning: label 'L6705' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L7005' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L7131' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L7215' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10082: warning: label 'L21401' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:9975: warning: label 'L6889' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:9959: warning: label 'L6877' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/darwin.md: In function 'int recog_39(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/darwin.md:335: warning: label 'L7713' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'int recog_42(rtx_def*, rtx_insn*, int*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:339: warning: label 'L6461' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:339: warning: label 'L6533' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:339: warning: label 'L6499' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:339: warning: label 'L6567' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'rtx_def* split_8(rtx_def*, rtx_insn*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10101: warning: label 'L22253' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10243: warning: label 'L22259' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10101: warning: label 'L22271' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:10243: warning: label 'L22277' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md: In function 'rtx_def* split_11(rtx_def*, rtx_insn*)':
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8335: warning: label 'L17435' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8335: warning: label 'L17431' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8347: warning: label 'L17439' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:13915: warning: label 'L18481' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:5407: warning: label 'L16445' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8171: warning: label 'L17415' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:5407: warning: label 'L16451' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:13915: warning: label 'L18475' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18513' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:451: warning: label 'L18641' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18517' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:406: warning: label 'L18617' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:9157: warning: label 'L18525' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:36: warning: label 'L18629' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18497' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:561: warning: label 'L18661' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18501' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:501: warning: label 'L18653' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18505' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:451: warning: label 'L18645' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18509' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:406: warning: label 'L18621' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8837: warning: label 'L18521' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/vsx.md:406: warning: label 'L18625' defined but not used
/root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/config/rs6000/rs6000.md:8171: warning: label 'L17419' defined but not used
/bin/sh /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../move-if-change tmp-attrtab.c    insn-attrtab.c
/bin/sh /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../move-if-change tmp-dfatab.c     insn-dfatab.c
/bin/sh /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../move-if-change tmp-latencytab.c insn-latencytab.c
echo timestamp > s-attrtab
/bin/sh /root/kernel/freebsd-ports/lang/gcc5/work/gcc-5.5.0/gcc/../move-if-change tmp-automata.c insn-automata.c
echo timestamp > s-automata
rm gcc.pod
gmake[5]: Leaving directory '/root/kernel/freebsd-ports/lang/gcc5/work/.build/gcc'
gmake[4]: *** [Makefile:4366: all-stage1-gcc] Error 2
gmake[4]: Leaving directory '/root/kernel/freebsd-ports/lang/gcc5/work/.build'
gmake[3]: *** [Makefile:19360: stage1-bubble] Error 2
gmake[3]: Leaving directory '/root/kernel/freebsd-ports/lang/gcc5/work/.build'
gmake[2]: *** [Makefile:19692: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/root/kernel/freebsd-ports/lang/gcc5/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

make[1]: stopped in /root/kernel/freebsd-ports/lang/gcc5
1 error

make[1]: stopped in /root/kernel/freebsd-ports/lang/gcc5
*** [stage] Error code 2

make: stopped in /root/kernel/freebsd-ports/lang/gcc5
1 error

make: stopped in /root/kernel/freebsd-ports/lang/gcc5
Comment 1 Breno Leitao 2018-02-02 20:35:08 UTC
Trying GCC49 and no luck as well:
➜  gcc49 make -j 20
--- stage ---
--- pre-everything ---
Making GCC 4.9.4 for powerpc64-portbld-freebsd12.0 [c,c++,objc,fortran]
--- check-vulnerable ---
--- check-license ---
===>  License GPLv3 GPLv3RLE accepted by the user
--- pkg-depends ---
===>   gcc49-4.9.4_3 depends on file: /usr/local/sbin/pkg - found
--- do-fetch ---
=> gcc-4.9.4.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://mirrors.kernel.org/sourceware/gcc/releases/gcc-4.9.4/gcc-4.9.4.tar.bz2
gcc-4.9.4.tar.bz2                                        0  B    0  Bps
--- fetch-specials ---
===> Fetching all distfiles required by gcc49-4.9.4_3 for building
--- extract-message ---
===>  Extracting for gcc49-4.9.4_3
--- checksum ---
=> SHA256 Checksum OK for gcc-4.9.4.tar.bz2.
--- clean-wrkdir ---
--- /usr/ports/lang/gcc49/work ---
--- do-extract ---
--- extract-fixup-modes ---
--- /usr/ports/lang/gcc49/work/.extract_done.gcc._usr_local ---
--- /usr/ports/lang/gcc49/work/.license_done.gcc._usr_local ---
--- patch-message ---
===>  Patching for gcc49-4.9.4_3
--- do-patch ---
===>  Applying FreeBSD patches for gcc49-4.9.4_3
--- /usr/ports/lang/gcc49/work/.patch_done.gcc._usr_local ---
--- build-depends ---
===>   gcc49-4.9.4_3 depends on file: /usr/local/bin/as - found
===>   gcc49-4.9.4_3 depends on executable: gmake - found
===>   gcc49-4.9.4_3 depends on executable: makeinfo - found
===>   gcc49-4.9.4_3 depends on file: /usr/local/bin/as - found
===>   gcc49-4.9.4_3 depends on package: perl5>=5.24<5.25 - found
`lib-depends' was not built (made 1, flags 2019, type b410001)!
    `lib-depends' has .ORDER dependency against run-depends (made 1, flags 9, type b410001)
    `lib-depends' has .ORDER dependency against run-depends (made 1, flags 9, type b410001)
`configure-message' was not built (made 1, flags 2009, type b010001)!
    `configure-message' has .ORDER dependency against lib-depends (made 1, flags 2019, type b410001)
`pre-configure' was not built (made 1, flags 2009, type b010001)!
    `pre-configure' has .ORDER dependency against configure-message (made 1, flags 2009, type b010001)
`patch-libtool' was not built (made 1, flags 2009, type b010001)!
    `patch-libtool' has .ORDER dependency against pre-configure (made 1, flags 2009, type b010001)
`run-autotools-fixup' was not built (made 1, flags 2009, type b010001)!
    `run-autotools-fixup' has .ORDER dependency against patch-libtool (made 1, flags 2009, type b010001)
`do-configure' was not built (made 1, flags 2009, type b010001)!
    `do-configure' has .ORDER dependency against run-autotools-fixup (made 1, flags 2009, type b010001)
`build-message' was not built (made 1, flags 2009, type b010001)!
    `build-message' has .ORDER dependency against configure (made 1, flags 3009, type 3010001)
`do-build' was not built (made 1, flags 2009, type b010001)!
    `do-build' has .ORDER dependency against build-message (made 1, flags 2009, type b010001)
`stage-message' was not built (made 1, flags 2009, type b010001)!
    `stage-message' has .ORDER dependency against build (made 1, flags 3009, type 3010001)
`/usr/ports/lang/gcc49/work/stage/usr/local' was not built (made 0, flags 2009, type b000001)!
`run-depends' was not built (made 1, flags 2009, type b410001)!
    `run-depends' has .ORDER dependency against stage-dir (made 1, flags 3009, type b010001)
`apply-slist' was not built (made 1, flags 2009, type b010001)!
    `apply-slist' has .ORDER dependency against lib-depends (made 1, flags 2019, type b410001)
`generate-plist' was not built (made 1, flags 200f, type b010001)!
    `generate-plist' has .ORDER dependency against apply-slist (made 1, flags 2009, type b010001)
`do-install' was not built (made 1, flags 2009, type b010001)!
    `do-install' has .ORDER dependency against generate-plist (made 1, flags 200f, type b010001)
`fix-perl-things' was not built (made 1, flags 2009, type b010001)!
    `fix-perl-things' has .ORDER dependency against do-install (made 1, flags 2009, type b010001)
`fixup-lib-pkgconfig' was not built (made 1, flags 2009, type b010001)!
    `fixup-lib-pkgconfig' has .ORDER dependency against fix-perl-things (made 1, flags 2009, type b010001)
`patch-lafiles' was not built (made 1, flags 2009, type b010001)!
    `patch-lafiles' has .ORDER dependency against fixup-lib-pkgconfig (made 1, flags 2009, type b010001)
`post-stage' was not built (made 1, flags 2009, type b010001)!
    `post-stage' has .ORDER dependency against patch-lafiles (made 1, flags 2009, type b010001)
`compress-man' was not built (made 1, flags 2009, type b010001)!
    `compress-man' has .ORDER dependency against post-stage (made 1, flags 2009, type b010001)
`install-ldconfig-file' was not built (made 1, flags 2009, type b010001)!
    `install-ldconfig-file' has .ORDER dependency against compress-man (made 1, flags 2009, type b010001)
`install-license' was not built (made 1, flags 2009, type b010001)!
    `install-license' has .ORDER dependency against install-ldconfig-file (made 1, flags 2009, type b010001)
`add-plist-info' was not built (made 1, flags 2009, type b010001)!
    `add-plist-info' has .ORDER dependency against install-license (made 1, flags 2009, type b010001)
*** [stage] Error code 1

make: stopped in /usr/ports/lang/gcc49
1 error

make: stopped in /usr/ports/lang/gcc49
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2018-02-02 20:43:09 UTC
Don't use '-j', the ports tree does not support it; it does not do what you think here. Ports already enables -j for the builds via MAKE_JOBS_NUMBER.

Also ports are not built with gmake, use 'make'.
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2018-02-02 23:23:34 UTC
GCC 5 has reached end of life, and we should minimize it's use.  I'll
add a note shortly, as we have for lang/gcc49 and earlier already.

Unfortunately lang/gcc6 and lang/gcc6-devel have

  .elif ${ARCH} == powerpc64
  CONFIGURE_ENV+= UNAME_m="powerpc64"
  USE_GCC=        5       # Cannot require ourselves, needs to be at least 4.9.
  .endif

and so require GCC 5 to build.

Andreas, any thoughts on that?  Do we still need this workaround?  (I
guess we can focus powerpc64 support on 11 and 12 if that helps?)
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-02-02 23:26:50 UTC
A commit references this bug:

Author: gerald
Date: Fri Feb  2 23:26:15 UTC 2018
New revision: 460758
URL: https://svnweb.freebsd.org/changeset/ports/460758

Log:
  GCC 5 reached end-of-life last year, so add a deprecation note like
  lang/gcc49 and earlier already carry and recommend GCC 6 or later
  instead of GCC 5.

  PR:		225629

Changes:
  head/lang/gcc5/Makefile
Comment 5 Breno Leitao 2018-02-03 00:05:29 UTC
I tried gcc4.9 build without -j this time, and it is failing as:

/usr/ports/lang/gcc49/work/.build/./prev-gcc/xg++ -B/usr/ports/lang/gcc49/work/.build/./prev-gcc/ -B/usr/local/powerpc64-portbld-freebsd12.0/bin/ -nostdinc++ -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include  -isystem /usr/ports/lang/gcc49/work/gcc-4.9.4/libstdc++-v3/libsupc++ -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../include -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libbacktrace   -DLIBICONV_PLUG -o sched-deps.o -MT sched-deps.o -MMD -MP -MF ./.deps/sched-deps.TPo /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sched-deps.c
/usr/ports/lang/gcc49/work/.build/./prev-gcc/xg++ -B/usr/ports/lang/gcc49/work/.build/./prev-gcc/ -B/usr/local/powerpc64-portbld-freebsd12.0/bin/ -nostdinc++ -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include  -isystem /usr/ports/lang/gcc49/work/gcc-4.9.4/libstdc++-v3/libsupc++ -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../include -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libbacktrace   -DLIBICONV_PLUG -o sched-ebb.o -MT sched-ebb.o -MMD -MP -MF ./.deps/sched-ebb.TPo /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sched-ebb.c
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/dbxout.c: In function 'void dbxout_type(tree, int)':
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/dbxout.c:2373:1: internal compiler error: in init_ready_list, at sched-rgn.c:2129
 }
 ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
xg++: environment corrupt; missing value for 
/usr/ports/lang/gcc49/work/.build/./prev-gcc/xg++ -B/usr/ports/lang/gcc49/work/.build/./prev-gcc/ -B/usr/local/powerpc64-portbld-freebsd12.0/bin/ -nostdinc++ -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include  -isystem /usr/ports/lang/gcc49/work/gcc-4.9.4/libstdc++-v3/libsupc++ -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../include -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libbacktrace   -DLIBICONV_PLUG -o sched-rgn.o -MT sched-rgn.o -MMD -MP -MF ./.deps/sched-rgn.TPo /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sched-rgn.c
xg++: environment corrupt; missing value for 
xg++: environment corrupt; missing value for 
/usr/ports/lang/gcc49/work/.build/./prev-gcc/xg++ -B/usr/ports/lang/gcc49/work/.build/./prev-gcc/ -B/usr/local/powerpc64-portbld-freebsd12.0/bin/ -nostdinc++ -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include  -isystem /usr/ports/lang/gcc49/work/gcc-4.9.4/libstdc++-v3/libsupc++ -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../include -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libbacktrace   -DLIBICONV_PLUG -o sched-vis.o -MT sched-vis.o -MMD -MP -MF ./.deps/sched-vis.TPo /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sched-vis.c
/usr/ports/lang/gcc49/work/.build/./prev-gcc/xg++ -B/usr/ports/lang/gcc49/work/.build/./prev-gcc/ -B/usr/local/powerpc64-portbld-freebsd12.0/bin/ -nostdinc++ -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -B/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0  -isystem /usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/include  -isystem /usr/ports/lang/gcc49/work/gcc-4.9.4/libstdc++-v3/libsupc++ -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs -L/usr/ports/lang/gcc49/work/.build/prev-powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/. -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../include -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/../libbacktrace   -DLIBICONV_PLUG -o sdbout.o -MT sdbout.o -MMD -MP -MF ./.deps/sdbout.TPo /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sdbout.c
gmake[5]: *** [Makefile:1058: dbxout.o] Error 1
gmake[5]: *** Waiting for unfinished jobs....
In file included from /usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/sched-vis.c:31:0:
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/tree.h:2551:1: warning: "/*" within comment [-Wcomment]
 /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
 ^
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/tree.h: In function 'cl_optimization* opts_for_fn(const_tree)':
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/tree.h:3792:61: error: 'DECL_FUNCTION_SPECIFIC_OPTIMIZATION' was not declared in this scope
    build_qualified_type instead.  */
                                                             ^
/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/tree.h:3795:36: error: 'TREE_OPTIMIZATION' was not declared in this scope
   build_qualified_type ((TYPE),      \
                                    ^
xg++: environment corrupt; missing value for 
gmake[5]: *** [Makefile:1058: sched-vis.o] Error 1
xg++: environment corrupt; missing value for 
xg++: environment corrupt; missing value for 
xg++: environment corrupt; missing value for 
rm gcc.pod gfortran.pod
gmake[5]: Leaving directory '/usr/ports/lang/gcc49/work/.build/gcc'
gmake[4]: *** [Makefile:4258: all-stage2-gcc] Error 2
gmake[4]: Leaving directory '/usr/ports/lang/gcc49/work/.build'
gmake[3]: *** [Makefile:18639: stage2-bubble] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc49/work/.build'
gmake[2]: *** [Makefile:18854: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc49/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc49
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc49
Comment 6 Gerald Pfeifer freebsd_committer freebsd_triage 2018-02-03 00:10:06 UTC
Is it possible you've got a hardware problem (memory,...)?
Comment 7 Mark Millard 2018-02-03 05:20:43 UTC
(In reply to Bryan Drewery from comment #2)

Various ports internally invoke gmake. And Breno's
material showed:

# cd freebsd-ports/lang/gcc5
# make 
. . .
gmake[5]: *** [Makefile:1067: insn-extract.o] Error 1
gmake[5]: *** Waiting for unfinished jobs....
. . .

so I expect that the gmake use was just internal. Looking
at freshports for lang.gcc5 . . .

Build dependencies:
as : devel/binutils
gmake : devel/gmake
makeinfo : print/texinfo
as : devel/binutils
perl5>=5.24<5.25 : lang/perl5.24
Comment 8 Mark Millard 2018-02-03 05:33:03 UTC
(In reply to Breno Leitao from comment #5 based on comment #6):

If a build attempt is repeated multiple times, is the
behavior the same each time, in detail?

Beyond hardware, I'm not sure how much is known about the
status of FreeBSD's power9 support, much less whatever your
VM context is. (And I do not have access to such an
environment.) So if the answer ends up "no", it may not be
clear what to blame.

If the answer is "yes" instead, then it would be less likely
to be hardware that was at issue.
Comment 9 Breno Leitao 2018-02-05 18:43:33 UTC
I do not think it is a hardware issue, since this machine is running on a KVM guest.

Other than that, the problem looks similar, but sometimes in different points. So, I am wondering if there is an issue related to out-of-order execution or something in this area.

It seems the problem also hit long running applications as a heavily git clone, thus, I would say this is not necessarily a GCC issue. It might be a heavy-workload kind of issue.
Comment 10 Breno Leitao 2018-02-06 12:46:44 UTC
This is a possible indication that the problem is not gcc related only. This is what I am seeing on dmesg:

pid 28321 (mv), uid 0: exited on signal 11 (core dumped)
pid 27763 (c++), uid 0: exited on signal 11 (core dumped)
pid 28001 (c++), uid 0: exited on signal 11 (core dumped)
pid 28030 (c++), uid 0: exited on signal 11 (core dumped)
pid 27778 (c++), uid 0: exited on signal 11 (core dumped)
pid 27779 (c++), uid 0: exited on signal 11 (core dumped)
pid 27731 (c++), uid 0: exited on signal 11 (core dumped)
pid 27628 (c++), uid 0: exited on signal 11 (core dumped)
pid 27638 (c++), uid 0: exited on signal 11 (core dumped)
pid 27871 (c++), uid 0: exited on signal 6 (core dumped)
pid 27933 (c++), uid 0: exited on signal 11 (core dumped)
pid 28068 (c++), uid 0: exited on signal 11 (core dumped)
pid 28041 (c++), uid 0: exited on signal 11 (core dumped)
pid 27985 (c++), uid 0: exited on signal 11 (core dumped)
pid 28058 (c++), uid 0: exited on signal 11 (core dumped)
pid 27976 (c++), uid 0: exited on signal 11 (core dumped)
pid 27998 (c++), uid 0: exited on signal 11 (core dumped)
pid 27992 (c++), uid 0: exited on signal 11 (core dumped)
pid 28166 (c++), uid 0: exited on signal 11 (core dumped)
pid 28193 (c++), uid 0: exited on signal 11 (core dumped)
pid 28141 (c++), uid 0: exited on signal 11 (core dumped)
pid 28290 (c++), uid 0: exited on signal 11 (core dumped)
pid 28206 (c++), uid 0: exited on signal 6 (core dumped)
pid 28032 (c++), uid 0: exited on signal 11 (core dumped)
pid 27554 (c++), uid 0: exited on signal 11 (core dumped)
pid 27895 (c++), uid 0: exited on signal 11 (core dumped)
pid 28112 (c++), uid 0: exited on signal 11 (core dumped)
pid 28210 (c++), uid 0: exited on signal 11 (core dumped)
pid 27920 (c++), uid 0: exited on signal 11 (core dumped)
pid 28002 (c++), uid 0: exited on signal 11 (core dumped)
pid 27928 (c++), uid 0: exited on signal 11 (core dumped)
pid 27929 (c++), uid 0: exited on signal 11 (core dumped)
pid 27174 (perl), uid 0: exited on signal 11 (core dumped)
pid 28120 (c++), uid 0: exited on signal 11 (core dumped)
pid 28182 (c++), uid 0: exited on signal 11 (core dumped)
pid 27797 (c++), uid 0: exited on signal 11 (core dumped)
pid 27672 (c++), uid 0: exited on signal 6 (core dumped)
pid 28194 (c++), uid 0: exited on signal 11 (core dumped)
pid 27563 (c++), uid 0: exited on signal 11 (core dumped)
pid 28212 (c++), uid 0: exited on signal 11 (core dumped)
pid 28116 (c++), uid 0: exited on signal 11 (core dumped)
pid 28080 (c++), uid 0: exited on signal 11 (core dumped)
pid 28015 (c++), uid 0: exited on signal 11 (core dumped)
pid 27918 (c++), uid 0: exited on signal 11 (core dumped)
pid 28004 (c++), uid 0: exited on signal 11 (core dumped)
pid 28158 (c++), uid 0: exited on signal 11 (core dumped)
pid 27882 (c++), uid 0: exited on signal 11 (core dumped)
pid 27973 (c++), uid 0: exited on signal 11 (core dumped)
pid 27961 (c++), uid 0: exited on signal 11 (core dumped)
pid 28047 (c++), uid 0: exited on signal 11 (core dumped)
pid 27963 (c++), uid 0: exited on signal 11 (core dumped)
pid 28121 (c++), uid 0: exited on signal 11 (core dumped)
pid 28096 (c++), uid 0: exited on signal 11 (core dumped)
pid 28033 (c++), uid 0: exited on signal 11 (core dumped)
pid 27608 (c++), uid 0: exited on signal 11 (core dumped)
pid 27813 (c++), uid 0: exited on signal 11 (core dumped)
pid 28083 (c++), uid 0: exited on signal 11 (core dumped)
pid 28159 (c++), uid 0: exited on signal 11 (core dumped)
pid 28216 (c++), uid 0: exited on signal 11 (core dumped)
pid 28151 (c++), uid 0: exited on signal 11 (core dumped)
pid 27561 (c++), uid 0: exited on signal 6 (core dumped)
pid 28128 (c++), uid 0: exited on signal 11 (core dumped)
pid 28124 (c++), uid 0: exited on signal 11 (core dumped)
pid 28203 (c++), uid 0: exited on signal 11 (core dumped)
pid 28147 (c++), uid 0: exited on signal 11 (core dumped)
pid 27927 (c++), uid 0: exited on signal 11 (core dumped)
pid 27552 (c++), uid 0: exited on signal 11 (core dumped)
pid 27873 (c++), uid 0: exited on signal 11 (core dumped)
pid 28088 (c++), uid 0: exited on signal 11 (core dumped)
pid 28104 (c++), uid 0: exited on signal 11 (core dumped)
pid 28119 (c++), uid 0: exited on signal 6 (core dumped)
pid 28091 (c++), uid 0: exited on signal 11 (core dumped)
pid 28156 (c++), uid 0: exited on signal 11 (core dumped)
pid 28115 (c++), uid 0: exited on signal 11 (core dumped)
pid 28163 (c++), uid 0: exited on signal 11 (core dumped)
pid 28148 (c++), uid 0: exited on signal 6 (core dumped)
pid 27975 (c++), uid 0: exited on signal 11 (core dumped)
pid 27775 (c++), uid 0: exited on signal 11 (core dumped)
pid 28100 (c++), uid 0: exited on signal 11 (core dumped)
pid 28204 (c++), uid 0: exited on signal 11 (core dumped)
pid 28063 (c++), uid 0: exited on signal 11 (core dumped)
pid 28089 (c++), uid 0: exited on signal 11 (core dumped)
pid 28142 (c++), uid 0: exited on signal 11 (core dumped)
pid 28065 (c++), uid 0: exited on signal 11 (core dumped)
pid 28184 (c++), uid 0: exited on signal 11 (core dumped)
pid 27649 (c++), uid 0: exited on signal 11 (core dumped)
pid 27737 (c++), uid 0: exited on signal 11 (core dumped)
pid 27595 (c++), uid 0: exited on signal 11 (core dumped)
pid 27750 (c++), uid 0: exited on signal 11 (core dumped)
pid 5555 (gmake), uid 0: exited on signal 11 (core dumped)
pid 5540 (gmake), uid 0: exited on signal 11 (core dumped)
pid 5530 (gmake), uid 0: exited on signal 6 (core dumped)
pid 5529 (sh), uid 0: exited on signal 11 (core dumped)
pid 3052 (make), uid 0: exited on signal 11 (core dumped)
pid 612 (sshd), uid 0: exited on signal 11
pid 671 (getty), uid 0: exited on signal 11 (core dumped)
Comment 11 Nathan Whitehorn freebsd_committer freebsd_triage 2018-02-07 23:02:12 UTC
Do you see a message like this in your dmesg?
WARNING: Running on a broken hypervisor that does not support mandatory H_CLEAR_MOD and H_CLEAR_REF hypercalls. Performance will be suboptimal.

If so, could you try enabling those hypercalls in qemu (the kernel supports them on any reasonably recent kernel)? We really need them for the VM system to work and the workaround for older broken kernels/QEMU releases is a bit of hack and may cause memory corruption under load.
Comment 12 Gerald Pfeifer freebsd_committer freebsd_triage 2018-02-08 21:36:38 UTC
I think we have clearly identified this is not related to GCC or the
lang/gcc* ports.
Comment 13 Breno Leitao 2018-02-19 16:45:54 UTC
Hi Nathan,

I do not see this message on my FreeBSD. I am using a very new Linux kernel (4.15) and qemu 2.10.

I also found that the machine that is stable (does not reproduce this problem) is using a broken kernel, and then I see the Warning message.

Just to guarantee that that this is not related, I forced brokenkvm=1 on this machine in order to check if the problem goes away, but it does not.

I.e, having a brokenkvm or not does not seem to affect this issue.
Comment 14 Rino 2018-03-06 13:08:25 UTC
Hi,
I have a powerpc g5 Mac, when I tried to compile xorg-minmal using postmaster I have the dependency of gcc5 every time , I know it is deprecated but also I tried to install  from /usr/ports/lang/gcc6 or postmaster and every time try to compile gcc5 also I tried  only gcc5 but fails..

How I can install gcc6 avoiding gcc5 ?


root@:/usr/ports/lang/gcc6 # dmesg
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 07:28:47 UTC 2017
    root@releng2.nyi.freebsd.org:/usr/obj/powerpc.powerpc64/usr/src/sys/GENERIC64 powerpc
gcc version 4.2.1 20070831 patched [FreeBSD]
VT(ofwfb): resolution 1280x1024
cpu0: IBM PowerPC 970MP revision 1.1, 2000.53 MHz
cpu0: Features dc000000<PPC32,PPC64,ALTIVEC,FPU,MMU>
cpu0: HID0 1511081<DEEPNAP,NAP,DPM,NHR,TBEN,ENATTN>
real memory  = 2651049984 (2528 MB)
avail memory = 2477019136 (2362 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0: dev=ff89d680 (BSP)
cpu1: dev=ff89eb70
random: unblocking device.
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree> on nexus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
pcr0: <PPC 970 Power Control Register> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
pcr1: <PPC 970 Power Control Register> on cpu1
powermac_nvram0: <Apple NVRAM> mem 0xfff04000-0xfff07fff on ofwbus0
powermac_nvram0: bank0 generation 1839, bank1 generation 1838
unin0: <Apple UniNorth System Controller> mem 0xf8000000-0xf8ffffff on ofwbus0
unin0: Version 66
iichb0: <Keywest I2C controller> mem 0xf8001000-0xf8001fff irq 0 on unin0
iicbus0: <OFW I2C bus> on iichb0
ds17750: <Temp-Monitor DS1775> at addr 0x94 on iicbus0
ds16310: <Temp-Monitor DS1631> at addr 0x96 on iicbus0
max66900: <Temp-Monitor MAX6690> at addr 0x98 on iicbus0
max66901: <Temp-Monitor MAX6690> at addr 0x9c on iicbus0
htpic0: <OpenPIC Interrupt Controller> mem 0xf8040000-0xf807ffff on unin0
pcib0: <IBM CPC945 PCI Express Root> mem 0xf0000000-0xf1ffffff on ofwbus0
pci0: <OFW PCI bus> on pcib0
vgapci0: <VGA-compatible display> mem 0x92000000-0x92ffffff,0x98000000-0x9fffffff,0x91000000-0x91ffffff irq 3 at device 0.0 on pci0
vgapci0: Boot video device
pcib1: <IBM CPC9X5 HyperTransport Tunnel> mem 0xf2000000-0xf47fffff,0xf8070000-0xf8070fff on ofwbus0
pcib1: 86 HT IRQs on device 7.0
pci1: <OFW PCI bus> on pcib1
pcib1: Enabling MSI window for HyperTransport slave at pci1:0:1:0
pcib2: <OFW PCI-PCI bridge> at device 1.0 on pci1
pci2: <OFW PCI bus> on pcib2
pcib3: <OFW PCI-PCI bridge> at device 2.0 on pci1
pci3: <OFW PCI bus> on pcib3
bge0: <Broadcom BCM5714 B3, ASIC rev. 0x008003> mem 0xfa530000-0xfa53ffff,0xfa520000-0xfa52ffff irq 66 at device 4.0 on pci3
bge0: CHIP ID 0x00008003; ASIC REV 0x08; CHIP REV 0x80; PCI-X 33 MHz
miibus0: <MII bus> on bge0
brgphy0: <BCM5780 1000BASE-T media interface> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge0: Ethernet address: 00:14:51:68:33:0e
bge1: <Broadcom BCM5714 B3, ASIC rev. 0x008003> mem 0xfa510000-0xfa51ffff,0xfa500000-0xfa50ffff irq 67 at device 4.1 on pci3
bge1: CHIP ID 0x00008003; ASIC REV 0x08; CHIP REV 0x80; PCI-X 33 MHz
miibus1: <MII bus> on bge1
brgphy1: <BCM5780 1000BASE-T media interface> PHY 1 on miibus1
brgphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge1: Ethernet address: 00:14:51:68:33:0f
pcib4: <OFW PCI-PCI bridge> at device 3.0 on pci1
pci4: <OFW PCI bus> on pcib4
pcib5: <OFW PCI-PCI bridge> at device 4.0 on pci1
pci5: <OFW PCI bus> on pcib5
pcib6: <OFW PCI-PCI bridge> at device 5.0 on pci1
pci6: <OFW PCI bus> on pcib6
pcib7: <OFW PCI-PCI bridge> at device 6.0 on pci1
pci7: <OFW PCI bus> on pcib7
pcib8: <OFW PCI-PCI bridge> at device 7.0 on pci1
pci8: <OFW PCI bus> on pcib8
gem0: <Apple Shasta GMAC Ethernet> mem 0xfa200000-0xfa3fffff at device 15.0 on pci8
gem0: invalid MAC address
device_attach: gem0 attach returned 6
pcib9: <OFW PCI-PCI bridge> at device 8.0 on pci1
pci9: <OFW PCI bus> on pcib9
macio0: <Shasta I/O Controller> mem 0x80000000-0x8007ffff at device 7.0 on pci9
macgpio0: <MacIO GPIO Controller> mem 0x50-0x8a on macio0
scc0: <Zilog Z8530 dual channel SCC> mem 0x13000-0x13fff,0x8400-0x84ff,0x8500-0x85ff,0x8600-0x86ff,0x8700-0x87ff irq 23,17,18,24,19,20 on macio0
uart0: <z8530, channel A> on scc0
uart1: <z8530, channel B> on scc0
iichb1: <Keywest I2C controller> mem 0x18000-0x18fff irq 27 on macio0
iicbus1: <OFW I2C bus> on iichb1
onyx0: <Texas Instruments PCM3052 Audio Codec> at addr 0x8c on iicbus1
iicbus1: <unknown card> at addr 0x24
pcm0: <Apple I2S Audio Controller> mem 0x10000-0x10fff,0x8000-0x80ff,0x8100-0x81ff irq 28,11,12,30,15,16 on macio0
ohci0: <NEC uPD 9210 USB controller> mem 0x80082000-0x80082fff irq 70 at device 11.0 on pci9
usbus0 on ohci0
ohci1: <NEC uPD 9210 USB controller> mem 0x80081000-0x80081fff irq 70 at device 11.1 on pci9
usbus1 on ohci1
ehci0: <NEC uPD 72010x USB 2.0 controller> mem 0x80080000-0x800800ff irq 70 at device 11.2 on pci9
usbus2: EHCI version 1.0
usbus2 on ehci0
pcib10: <OFW PCI-PCI bridge> at device 9.0 on pci1
pci10: <OFW PCI bus> on pcib10
atapci0: <ServerWorks K2 SATA150 controller> mem 0xfa402000-0xfa403fff irq 10 at device 12.0 on pci10
pcib1: failed to reserve resource for pcib10
atapci0: 0x10 bytes of rid 0x20 res 4 failed (0, 0xffffffffffffffff).
ata2: <ATA channel> at channel 0 on atapci0
ata3: <ATA channel> at channel 1 on atapci0
ata4: <ATA channel> at channel 2 on atapci0
ata5: <ATA channel> at channel 3 on atapci0
ata0: <Shasta Kauai ATA Controller> mem 0xfa404000-0xfa407fff irq 38,37 at device 13.0 on pci10
fwohci0: <1394 Open Host Controller Interface> mem 0xfa400000-0xfa400fff irq 39 at device 14.0 on pci10
fwohci0: OHCI version 1.0 (ROM=0)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:14:51:ff:fe:35:68:78
fwohci0: invalid speed 7 (fixed to 3).
fwohci0: Phy 1394a available S800, 3 ports.
fwohci0: Link S800, max_rec 4096 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 02:14:51:35:68:78
fwe0: Ethernet address: 02:14:51:35:68:78
sbp0: <SBP-2/SCSI over FireWire> on firewire0
fwohci0: Initiate bus reset
fwohci0: fwohci_intr_core: BUS reset
fwohci0: PhysicalUpperBound register is not implemented.  Physical memory access is limited to the first 4GB
fwohci0: PhysicalUpperBound = 0x00000000
fwohci0: fwohci_intr_core: node_id=0x00000001, SelfID Count=1, CYCLEMASTER mode
smu0: <Apple System Management Unit> on ofwbus0
iichb2: <SMU I2C controller> on smu0
iicbus2: <OFW I2C bus> on iichb2
smusat0: <SMU Satellite Sensors> at addr 0xb0 on iicbus2
iicbus2: <unknown card> at addr 0xd4
iichb3: <SMU I2C controller> on smu0
iicbus3: <OFW I2C bus> on iichb3
Timecounter "timebase" frequency 33333333 Hz quality 0
Event timer "decrementer" frequency 33333333 Hz quality 1000
Timecounters tick every 1.000 msec
firewire0: 2 nodes, maxhop <= 1 cable IRM irm(1)  (me)
firewire0: bus manager 1
max66900: 2 sensors detected.
max66901: 2 sensors detected.
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
ugen0.1: <NEC OHCI root HUB> at usbus0
uhub0: <NEC OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <NEC OHCI root HUB> at usbus1
uhub1: <NEC OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
usbus2: 480Mbps High Speed USB v2.0
ugen2.1: <NEC EHCI root HUB> at usbus2
uhub2: <NEC EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
uhub0: 3 ports with 3 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 5 ports with 5 removable, self powered
ugen2.2: <Ralink 802.11 n WLAN> at usbus2
ada0 at ata2 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD1600JS-41MVB1 10.02E01> ATA-7 SATA 2.x device
ada0: Serial Number WD-WMAP01138964
ada0: 150.000MB/s transfers (SATA 1.x, UDMA5, PIO 8192bytes)
ada0: 152627MB (312581808 512 byte sectors)
ada1 at ata3 bus 0 scbus1 target 0 lun 0
ada1: <SAMSUNG SP2504C VT100-41> ATA-7 SATA 2.x device
ada1: Serial Number S09QJ1HL952442
ada1: 150.000MB/s transfers (SATA 1.x, UDMA5, PIO 8192bytes)
ada1: 238475MB (488397168 512 byte sectors)
SMP: AP CPU #1 launched
Trying to mount root from ufs:/dev/ada0s3 [rw]...
ugen0.2: <Logitech USB Receiver> at usbus0
ukbd0 on uhub0
ukbd0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 2> on usbus0
kbd1 at ukbd0
ums0 on uhub0
ums0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 2> on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=2
uhid0 on uhub0
uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/24.00, addr 2> on usbus0
ugen1.2: <Primax Electronics Apple Optical USB Mouse> at usbus1
ums1 on uhub1
ums1: <Primax Electronics Apple Optical USB Mouse, class 0/0, rev 1.10/1.10, addr 2> on usbus1
ums1: 4 buttons and [XYZW] coordinates ID=0
bge0: link state changed to DOWN
run0 on uhub2
run0: <1.0> on usbus2
run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 7c:dd:90:04:e7:0c
ieee80211_load_module: load the wlan_amrr module by hand for now.
wlan0: Ethernet address: 7c:dd:90:04:e7:0c
run0: firmware RT3071 ver. 0.33 loaded
wlan0: link state changed to UP

hw.machine: powerpc
hw.model: IBM PowerPC 970MP
hw.ncpu: 2
hw.byteorder: 4321
hw.physmem: 2651049984
hw.usermem: 2223316992
hw.pagesize: 4096
hw.machine_arch: powerpc64
hw.realmem: 2651049984
hw.uma_mdpages: 75462
hw.platform: powermac
hw.floatingpoint: 1
hw.altivec: 1
Comment 15 Alexey Dokuchaev freebsd_committer freebsd_triage 2018-03-06 17:03:20 UTC
(In reply to Rino from comment #14)

Please do not spam the bug with dmesg(8) output unless asked.

> I have the dependency of gcc5 every time.
There is a chance it's not actually needed, it's just that Gerald tries to keep USE_GCC to pull some recentish version. :-)

Personally I use GCC 4.9 right now for ports that cannot be built with system default 4.2.1, you might want to try 4.8 or even 4.7:

Index: /usr/ports/Mk/bsd.default-versions.mk
===================================================================
--- /usr/ports/Mk/bsd.default-versions.mk	(revision 463706)
+++ /usr/ports/Mk/bsd.default-versions.mk	(working copy)
@@ -41,7 +41,7 @@
 # Possible values: 3.0.0
 FPC_DEFAULT?=		3.0.4
 # Possible values: 4.9, 5, 6, 7
-GCC_DEFAULT?=		6
+GCC_DEFAULT?=		4.9
 # Possible values: 7, 8, 9, agpl
 GHOSTSCRIPT_DEFAULT?=	agpl
 .if ${ARCH} == amd64
Index: /usr/ports/Mk/bsd.gcc.mk
===================================================================
--- /usr/ports/Mk/bsd.gcc.mk	(revision 463706)
+++ /usr/ports/Mk/bsd.gcc.mk	(working copy)
@@ -35,11 +35,13 @@
 # ascending order and in sync with the table below. 
 # When adding a version, please keep the comment in
 # Mk/bsd.default-versions.mk in sync.
-GCCVERSIONS=	040200 040800 040900 050000 060000 070000
+GCCVERSIONS=	040200 040600 040700 040800 040900 050000 060000 070000
 
 # The first field is the OSVERSION in which it disappeared from the base.
 # The second field is the version as USE_GCC would use.
 GCCVERSION_040200=	9999999 4.2
+GCCVERSION_040600=	      0 4.6
+GCCVERSION_040700=	      0 4.7
 GCCVERSION_040800=	      0 4.8
 GCCVERSION_040900=	      0 4.9
 GCCVERSION_050000=	      0 5
Comment 16 Mark Millard 2018-05-15 13:12:46 UTC
Just for reference:

I my build of head -r333594 ( WITHOUT_LIB32= ) used on a PowerMac G5
so-called "Quad Core" has been building ports just fine, including
the likes of lang/llvm60 and devel/powerpc64-gcc so far. (Builds
still going.)
Comment 17 Mark Millard 2018-05-27 01:46:28 UTC
(In reply to Mark Millard from comment #16)

I had no problems with building.

[But I've now no access to powerpc family systems for
weeks or months. So I will not be doing more testing.
for a significant time.]
Comment 18 Kenneth Salerno 2018-06-01 19:11:21 UTC
(In reply to Mark Millard from comment #17)
Mark, there is indeed a segfault that happens when you try to build lang/gcc5 with the system llvm/clang. I worked around the issue by avoiding building lang/gcc5 altogether (see attached patch).

My system was built using lang/gcc7 amd64->ppc64 using the following config:
_OSRELEASE != uname -r
OSREL = ${_OSRELEASE:C/-.*//}
.   if exists(/usr/local/bin/powerpc64-unknown-freebsd${OSREL}-gcc)
XCC = /usr/local/bin/powerpc64-unknown-freebsd${OSREL}-gcc
XCXX = /usr/local/bin/powerpc64-unknown-freebsd${OSREL}-g++
XCPP = /usr/local/bin/powerpc64-unknown-freebsd${OSREL}-cpp
CROSS_BINUTILS_PREFIX = /usr/local/bin/powerpc64-unknown-freebsd${OSREL}-
WITHOUT_FORMAT_EXTENSIONS = yes
NO_WERROR =
WERROR =
WITHOUT_GCC = yes
WITHOUT_GCC_BOOTSTRAP = yes
WITHOUT_GNUCXX = yes
WITH_CLANG = yes
WITH_CLANG_BOOTSTRAP = yes
WITH_CLANG_FULL = yes
WITH_CLANG_IS_CC = yes
WITH_LLD = yes

root@freebsd-ppc64# uname -rp
11.2-BETA2 powerpc64

root@freebsd-ppc64# cc -v
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: powerpc64-unknown-freebsd11.2
Thread model: posix
InstalledDir: /usr/bin

root@freebsd-ppc64# pkg info gcc6
gcc6-6.4.0_7
Name           : gcc6
Version        : 6.4.0_7
Installed on   : Fri Jun  1 01:49:58 2018 EDT
Origin         : lang/gcc6
Architecture   : FreeBSD:11:powerpc64
Prefix         : /usr/local
Categories     : lang java
Licenses       : GPLv3, GPLv3RLE
Maintainer     : gerald@FreeBSD.org
WWW            : https://gcc.gnu.org
Comment        : GNU Compiler Collection 6
Options        :
        BOOTSTRAP      : off
        GRAPHITE       : off
        JAVA           : off
        MULTILIB       : off
Shared Libs required:
        libmpc.so.3
        libgmp.so.10
        libmpfr.so.6
Shared Libs provided:
        libitm.so.1
        libssp.so.0
        libcc1plugin.so.0
        libgomp.so.1
        libcc1.so.0
        libgcc_s.so.1
        libatomic.so.1
        liblto_plugin.so.0
        libgfortran.so.3
        libstdc++.so.6
Annotations    :
        FreeBSD_version: 1101515
        cpe            : cpe:2.3:a:gnu:gcc:6.4.0:::::freebsd11:powerpc64:7
Flat size      : 141MiB
Description    :
GCC, the GNU Compiler Collection, supports a number of languages.  This
port installs the C, C++, Fortran and Java front ends as gcc6, g++6,
gfortran6, and gcj6, respectively.

WWW: https://gcc.gnu.org

Gerald Pfeifer <gerald@FreeBSD.org>
Comment 19 Kenneth Salerno 2018-06-01 19:21:26 UTC
Created attachment 193898 [details]
Patch to build lang/gcc6 with system clang

When /usr/bin/cc is clang, lang/gcc5 segfaults trying to stage xgcc compiling itself. A workaround is to not build lang/gcc5 at all, which is only necessary for a system that /usr/bin/cc is gcc 4.2.1 and needs >= gcc 4.9 to build lang/gcc6 which cannot USE_GCC itself and therefore tries to bring in lang/gcc5...

System tested on:
(qemu) info version
2.12.0

root@freebsd-ppc64# dmesg |head
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.2-BETA2 #4 r334114M: Wed May 30 09:48:40 EDT 2018
    root@freebsd-amd64.kpsalerno.us.ibm.com:/usr/obj/powerpc.powerpc64/usr/src/sys/SALERNO powerpc
gcc version 7.3.0 (FreeBSD Ports Collection for powerpc64)
WARNING: Running on a broken hypervisor that does not support mandatory H_CLEAR_MOD and H_CLEAR_REF hypercalls. Performance will be suboptimal.
cpu0: IBM POWER9 revision 2.0, 1000.00 MHz
cpu0: Features dc005180<PPC32,PPC64,ALTIVEC,FPU,MMU,SMT,ARCH205,ARCH206,VSX>
Comment 20 Gerald Pfeifer freebsd_committer freebsd_triage 2018-06-01 19:45:24 UTC
Alternately, should we just drop the USE_GCC=5 clause?

Are there relevant (for powerpc64 users) versions of FreeBSD where
this is really still necessary?


The other part is

  # Work-around for bug in tree-vect-loop.c
  CFLAGS+=	-mno-altivec

which is not quite sufficient to describe/document the actual issue.
Is there an (upstream?) bug report to refer to?  What and where is
that bug?
Comment 21 Kenneth Salerno 2018-06-01 19:54:07 UTC
(In reply to Gerald Pfeifer from comment #20)
Hi, Gerald. You still need to use lang/gcc5 to build lang/gcc6 on Power if you are using the default /usr/bin/cc -> GCC 4.2.1 as the system compiler because you need >= 4.9 to build version 5.

USE_GCC=5 is only unnecessary/harmful when you used an external compiler to build world that is C++11 capable and therefore builds /usr/bin/cc -> LLVM/Clang as the system compiler which is not capable of building lang/gcc5 as this bug states (see /usr/src/share/mk/src.opts.mk:489-498).

As for tree-vect-loop.c, Mark is the expert on that one:
https://lists.freebsd.org/pipermail/freebsd-toolchain/2017-October/003328.html

My patch is just a work-around.
Comment 22 Kenneth Salerno 2018-06-03 18:11:21 UTC
Created attachment 193973 [details]
Patch to build lang/gcc6 on ppc64 with clang if available

Through testing I was able to build lang/gcc6 and lang/gcc7 with itself (CC=gcc6 or CC=gcc7) and did not run into the tree-vect-loop.c issue, so I placed the "-mno-altivec" flag under the ppc64 LLVM/Clang build only section where it belongs to work around that build issue.
Comment 23 Gerald Pfeifer freebsd_committer freebsd_triage 2018-07-22 16:35:36 UTC
Thank you for the additional background, Kenneth, and the updated patch.

I am okay for you to apply this patch to lang/gcc6 with
Approved by: gerald (maintainer)

I would only like you to confirm that -mno-altivec is required for some
scenario that you ran into/can reproduce -- or simply omit that aspect,
i.e., the else branch and only limit the application of USE_GCC.

Hope this makes sense?
Comment 24 Mark Millard 2018-07-22 18:54:03 UTC
(In reply to Gerald Pfeifer from comment #23)

The problem is with the name vec_step which has a special
use in system-clang that conflicts with gcc's tree-vect-loop.c
local use of the name: namespace pollution (via OpenCL support
requiring such and being enabled, apparently). Anything that avoids
the name conflict is a work around.

clang for "with altivec/OpenCL support included" defines the notations:
( 3 lines from llvm/tools/clang/lib/Parse/ParseExpr.cpp )

[OpenCL 1.1 6.11.12] vec_step built-in function:
vec_step ( expressions )
vec_step ( type-name )

and has error messages like (2 more lines from there):

Not a typeof/sizeof/alignof/vec_step expression!

Not a sizeof/alignof/vec_step expression!

(and examples via tools/clang/include/clang/Basic/DiagnosticSemaKinds.td )

invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an

'vec_step' requires built-in scalar or vector type, %0 invalid



As I understand, telling clang -mno-altivec avoids vec_step being
defined by clang (via lack of OpenCL support for such) and so avoids
needing to rename the local variable in gcc's tree-vect-loop.c .


As far as I can tell the gcc code should be valid but system-clang as
configured by default makes it not so. I disagree with the "bug"
aspect of "Work-around for bug in tree-vect-loop.c".

Presuming there is a reason to have OpenCL support enabled in system-
clang, I expect that the conditional:

  CFLAGS+=	-mno-altivec

is appropriate. Otherwise disabling OpenCL support in system-clang for
powerpc64 would avoid vec_step ending up as an unavailable name. (I do
not know if altivec can be enabled but still have OpenCL support disabled
via normal configuration controls for system-clang.)

-mno-altivec would not be limited to gcc6 as long as gcc happens to
use the name vec_step in its tree-vect-loop.c . I've not checked
gcc8 yet, nor have I checked gcc9-devel . gcc7 had the usage and
so suffered the issue.
Comment 25 Mark Millard 2018-10-11 05:08:15 UTC
(In reply to Mark Millard from comment #24)

I have just confirmed that gcc8 also uses vec_step as
a name in its source code and so fails for clang having
put the name to use for the type of context, effectively
reserving the name: a poudriere-devel run had lang/gcc8's
build fail for the issue on a powerpc64 (old PowerMac G5
so-called "Quad Core").
Comment 26 Mark Linimon freebsd_committer freebsd_triage 2019-09-25 19:49:58 UTC
I think this problem has been fixed in all versions of gcc; can someone confirm?
Comment 27 Mark Millard 2020-03-11 04:20:54 UTC
(In reply to Mark Linimon from comment #26)

It may be too many things were run into to
identify a "this problem" and too much context
has changed. For example, it started with
a report that had:

insn-extract.c: In function 'void insn_extract(rtx_insn*)':
insn-extract.c:3006: internal compiler error: internal consistency failure
Please submit a full bug report,
. . .

(not a SIGSEGV initially). There was evidence reported of:

pid 5555 (gmake), uid 0: exited on signal 11 (core dumped)
pid 5540 (gmake), uid 0: exited on signal 11 (core dumped)
pid 5530 (gmake), uid 0: exited on signal 6 (core dumped)
pid 5529 (sh), uid 0: exited on signal 11 (core dumped)
pid 3052 (make), uid 0: exited on signal 11 (core dumped)
pid 612 (sshd), uid 0: exited on signal 11
pid 671 (getty), uid 0: exited on signal 11 (core dumped)

(Those sure do not look like a compiler failing to run
to me.)

There was the vec_step issue. And so on.

Both gcc5 and gcc6 are gone, as is the system gcc 4.2.1
(on head). At least head has progressed to a different
powerpc64 ABI and an official llvm toolchain.

If there is anything still relevant here, it might only
be for FreeBSD 11 or 12 just due to the large context
difference for head's powerpc64.

It looks too complicated to sort out and a new submittal
of material might be better (if there is a need).
Comment 28 Gerald Pfeifer freebsd_committer freebsd_triage 2021-11-06 09:51:00 UTC
Closing per the previous comment(s) eighteen months ago.