On Fri, Aug 24, 2018 at 11:48 PM, Amandeep Gautam <amandeepgaut...@gmail.com> wrote: > Hi Ian, > I compiled GMP, MPFR and MPC from source. Next, I configured gcc with > modified options: > > $srcdir/configure \ > --prefix=$prefix \ > --enable-languages=go \ > --with-as=/opt/csw/gnu/as --with-gnu-as \ > --with-ld=/usr/ccs/bin/ld --without-gnu-ld \ > --with-gmp-include=/usr/gnu/gmp/include --with-gmp-lib=/usr/gnu/gmp/lib > \ > --with-mpfr=/usr/gnu/mpfr --with-mpfr-include=/usr/gnu/mpfr/include > --with-mpfr-lib=/usr/gnu/mpfr/lib \ > --with-mpc=/usr/gnu/mpc \ > --with-isl=/opt/csw --with-isl-include=/opt/csw/include > --with-isl-lib=/opt/csw/lib \ > --with-build-time-tools=/opt/csw/gnu \ > --enable-multilib \ > --enable-shared \ > --enable-static \ > --disable-nls \ > --disable-libquadmath \ > --disable-libssp \ > --disable-lto \ > --disable-libgomp > > The make step is still failing but, to my surprise, I found that it is still > able to find libmpfr.so.4 from the /opt/csw directory. I am guessing that I > am not configuring something correctly. Can you please look.
Maybe you need to set LD_LIBRARY_PATH to point to your newly built libmpfr? Another approach is to copy the mpfr sources into your GCC directory, named exactly mpfr. Then the GCC build will automatically use that one. Ian > Output from GBD: > > -bash-3.2$ gdb /export/home/amandeep/gccgo-obj/./gcc/go1 > GNU gdb (GDB) 7.7 > Copyright (C) 2014 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "sparc-sun-solaris2.10". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > <http://www.gnu.org/software/gdb/bugs/>. > Find the GDB manual and other documentation resources online at: > <http://www.gnu.org/software/gdb/documentation/>. > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from /export/home/amandeep/gccgo-obj/./gcc/go1...done. > (gdb) run /export/home/amandeep/gccgo-src/libgo/go/fmt/doc.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/print.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go -quiet -dumpbase doc.go > -mcpu=v9 -auxbase-strip .libs/fmt.o -g -O2 -version -fgo-pkgpath=fmt -fPIC > -I . -L/export/home/amandeep/gccgo-obj/./gcc -o /var/tmp//ccBuuCrV. > Starting program: /export/home/amandeep/gccgo-obj/gcc/go1 > /export/home/amandeep/gccgo-src/libgo/go/fmt/doc.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/print.go > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go -quiet -dumpbase doc.go > -mcpu=v9 -auxbase-strip .libs/fmt.o -g -O2 -version -fgo-pkgpath=fmt -fPIC > -I . -L/export/home/amandeep/gccgo-obj/./gcc -o /var/tmp//ccBuuCrV. > [Thread debugging using libthread_db enabled] > [New Thread 1 (LWP 1)] > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10) > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2, MPFR > version 4.0.1-p13, MPC version 1.1.0, isl version csw-0.18-GMP > > warning: MPFR header version 4.0.1-p13 differs from library version 4.0.0. > warning: MPC header version 1.1.0 differs from library version 1.0.2. > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10) > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2, MPFR > version 4.0.1-p13, MPC version 1.1.0, isl version csw-0.18-GMP > > warning: MPFR header version 4.0.1-p13 differs from library version 4.0.0. > warning: MPC header version 1.1.0 differs from library version 1.0.2. > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:8:9: error: import > file 'strconv' not found > "strconv" > ^ > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:9:14: error: import > file 'unicode/utf8' not found > "unicode/utf8" > ^ > ... and many more like this before terminating... > > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:688:52: error: expected > integer, floating, complex, or string type > s.errorString("unsigned integer overflow on token " + tok) > ^ > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 1 (LWP 1)] > 0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4 > (gdb) bt > #0 0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4 > #1 0xff1d8bac in mpc_init2 () from /usr/lib/libmpc.so.3 > #2 0x001c5500 in Numeric_constant::check_complex_type (this=0xffbff208, > type=0x10944c8, issue_error=<optimized out>, location=...) > at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:16745 > #3 0x001c588c in Numeric_constant::set_type (this=0xffbff208, > type=0x11f4f78, issue_error=<optimized out>, loc=...) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/types.h:751 > #4 0x001c5944 in Integer_expression::do_check_types (this=0x11f50e0) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:535 > #5 0x001e7d04 in check_types (gogo=<optimized out>, this=<optimized out>) > at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:920 > #6 Check_types_traverse::expression (this=<optimized out>, expr=0x123bac8) > at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3306 > #7 0x001b3fc8 in Expression::traverse (pexpr=0x123bac8, > traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:45 > #8 0x0022eb8c in Statement::traverse (this=0x123bab8, block=0x123c168, > pindex=0xffbff3b4, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 > #9 0x001ea9f0 in Block::traverse (this=0x123c168, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 > #10 0x0022eb8c in Statement::traverse (this=0x123bad8, block=0x11f50b8, > pindex=0xffbff47c, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 > #11 0x001ea9f0 in Block::traverse (this=0x11f50b8, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 > #12 0x0022df60 in If_statement::do_traverse (this=0x11f63b0, > traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:84 > #13 0x0022eb8c in Statement::traverse (this=0x11f63b0, block=0x11f5068, > pindex=0xffbff5a4, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 > #14 0x001ea9f0 in Block::traverse (this=0x11f5068, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 > #15 0x0022eb8c in Statement::traverse (this=0x11f63d0, block=0x11f4fa0, > pindex=0xffbff66c, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 > #16 0x001ea9f0 in Block::traverse (this=0x11f4fa0, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 > #17 0x001eac80 in Function::traverse (this=0x11f6ac8, traverse=0xffbff7f4) > at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:5135 > #18 0x001ec6f0 in Bindings::traverse (this=0x10b4fa0, traverse=0xffbff7f4, > is_global=<optimized out>) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:2584 > #19 0x001eca38 in Gogo::traverse (this=0x10f0438, traverse=0xffbff7f4) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:3200 > #20 0x001ecd2c in Gogo::check_types (this=0x10f0438) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3316 > #21 0x001e7700 in go_parse_input_files (filenames=0x10cf4a8, > filename_count=4, only_check_syntax=<optimized out>) at > /export/home/amandeep/gccgo-src/gcc/go/gofrontend/go.cc:136 > #22 0x001e2480 in go_langhook_parse_file () at > /export/home/amandeep/gccgo-src/gcc/go/go-lang.c:329 > #23 0x006b97d4 in compile_file () at > /export/home/amandeep/gccgo-src/gcc/toplev.c:455 > #24 0x00e1ca24 in toplev::main(int, char**) () at ./insn-modes-inline.h:38 > #25 0x00e1e214 in main (argc=21, argv=0xffbffb64) at > /export/home/amandeep/gccgo-src/gcc/main.c:39 > > Also running the go1 program on the prompt also gives segmentation fault: > > -bash-3.2$ /export/home/amandeep/gccgo-obj/./gcc/go1 > go1: internal compiler error: in go_langhook_post_options, at > go/go-lang.c:289 > 0x1e5857 go_langhook_post_options > /export/home/amandeep/gccgo-src/gcc/go/go-lang.c:289 > Please submit a full bug report, > with preprocessed source if appropriate. > Please include the complete backtrace with any bug report. > See <https://gcc.gnu.org/bugs/> for instructions. > > On Thursday, August 23, 2018 at 2:54:56 PM UTC-7, Amandeep Gautam wrote: >> >> Running inside the gdb worked. Seems like a problem with libmpfr. Will try >> compiling it from source. >> Following is the end of the GDB output: >> >> /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:658:43: error: >> expected integer, floating, complex, or string type >> s.errorString("integer overflow on token " + tok) >> ^ >> /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:688:52: error: >> expected integer, floating, complex, or string type >> s.errorString("unsigned integer overflow on token " + tok) >> ^ >> >> Program received signal SIGSEGV, Segmentation fault. >> [Switching to Thread 1 (LWP 1)] >> 0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4 >> (gdb) bt >> #0 0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4 >> #1 0xff1d8bac in mpc_init2 () from /usr/lib/libmpc.so.3 >> #2 0x001c5500 in Numeric_constant::check_complex_type (this=0xffbff0e8, >> type=0x1094488, issue_error=<optimized out>, location=...) >> at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:16745 >> #3 0x001c588c in Numeric_constant::set_type (this=0xffbff0e8, >> type=0x11f4f38, issue_error=<optimized out>, loc=...) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/types.h:751 >> #4 0x001c5944 in Integer_expression::do_check_types (this=0x11f50a0) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:535 >> #5 0x001e7d04 in check_types (gogo=<optimized out>, this=<optimized out>) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:920 >> #6 Check_types_traverse::expression (this=<optimized out>, >> expr=0x123ba88) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3306 >> #7 0x001b3fc8 in Expression::traverse (pexpr=0x123ba88, >> traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:45 >> #8 0x0022eb8c in Statement::traverse (this=0x123ba78, block=0x123c128, >> pindex=0xffbff294, traverse=0xffbff6d4) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 >> #9 0x001ea9f0 in Block::traverse (this=0x123c128, traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 >> #10 0x0022eb8c in Statement::traverse (this=0x123ba98, block=0x11f5078, >> pindex=0xffbff35c, traverse=0xffbff6d4) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 >> #11 0x001ea9f0 in Block::traverse (this=0x11f5078, traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 >> #12 0x0022df60 in If_statement::do_traverse (this=0x11f6370, >> traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:84 >> #13 0x0022eb8c in Statement::traverse (this=0x11f6370, block=0x11f5028, >> pindex=0xffbff484, traverse=0xffbff6d4) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 >> #14 0x001ea9f0 in Block::traverse (this=0x11f5028, traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 >> #15 0x0022eb8c in Statement::traverse (this=0x11f6390, block=0x11f4f60, >> pindex=0xffbff54c, traverse=0xffbff6d4) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54 >> #16 0x001ea9f0 in Block::traverse (this=0x11f4f60, traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063 >> #17 0x001eac80 in Function::traverse (this=0x11f6a88, traverse=0xffbff6d4) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:5135 >> #18 0x001ec6f0 in Bindings::traverse (this=0x10b4f60, traverse=0xffbff6d4, >> is_global=<optimized out>) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:2584 >> #19 0x001eca38 in Gogo::traverse (this=0x10f03f8, traverse=0xffbff6d4) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:3200 >> #20 0x001ecd2c in Gogo::check_types (this=0x10f03f8) at >> /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3316 >> #21 0x001e7700 in go_parse_input_files (filenames=0x10cf468, >> filename_count=4, only_check_syntax=<optimized out>) >> at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/go.cc:136 >> #22 0x001e2480 in go_langhook_parse_file () at >> /export/home/amandeep/gccgo-src/gcc/go/go-lang.c:329 >> #23 0x006b97d4 in compile_file () at >> /export/home/amandeep/gccgo-src/gcc/toplev.c:455 >> #24 0x00e1c9f4 in toplev::main(int, char**) () at ./insn-modes-inline.h:38 >> #25 0x00e1e1e4 in main (argc=21, argv=0xffbffa44) at >> /export/home/amandeep/gccgo-src/gcc/main.c:39 >> >> On Thursday, August 23, 2018 at 2:25:38 PM UTC-7, Ian Lance Taylor wrote: >>> >>> On Thu, Aug 23, 2018 at 2:14 PM, Amandeep Gautam >>> <amandee...@gmail.com> wrote: >>> > >>> > /export/home/amandeep/gccgo-obj/./gcc/go1 >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/doc.go >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/print.go >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go -quiet -dumpbase >>> > doc.go >>> > -mcpu=v9 -auxbase-strip .libs/fmt.o -g -O2 -version -fgo-pkgpath=fmt >>> > -fPIC >>> > -I . -L/export/home/amandeep/gccgo-obj/./gcc -o /var/tmp//ccmxS20e.s >>> > >>> > and I got: >>> > >>> > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10) >>> > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2, >>> > MPFR >>> > version 4.0.0, MPC version 1.0.2, isl version csw-0.18-GMP >>> > >>> > GGC heuristics: --param ggc-min-expand=100 --param >>> > ggc-min-heapsize=131072 >>> > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10) >>> > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2, >>> > MPFR >>> > version 4.0.0, MPC version 1.0.2, isl version csw-0.18-GMP >>> > >>> > GGC heuristics: --param ggc-min-expand=100 --param >>> > ggc-min-heapsize=131072 >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:8:9: error: >>> > import >>> > file 'strconv' not found >>> > "strconv" >>> > ^ >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:9:14: error: >>> > import >>> > file 'unicode/utf8' not found >>> > "unicode/utf8" >>> > ^ >>> > ... and many more before ending into ... >>> > >>> > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:688:52: error: >>> > expected >>> > integer, floating, complex, or string type >>> > s.errorString("unsigned integer overflow on token " + tok) >>> > ^ >>> > Segmentation Fault (core dumped) >>> > >>> > I tried analyzing the core dumped. so I did: gdb >>> > /export/home/amandeep/gccgo-obj/./gcc/go1 ./core and below is how the >>> > promt >>> > looks: >>> > >>> > GNU gdb (GDB) 7.7 >>> > Copyright (C) 2014 Free Software Foundation, Inc. >>> > License GPLv3+: GNU GPL version 3 or later >>> > <http://gnu.org/licenses/gpl.html> >>> > This is free software: you are free to change and redistribute it. >>> > There is NO WARRANTY, to the extent permitted by law. Type "show >>> > copying" >>> > and "show warranty" for details. >>> > This GDB was configured as "sparc-sun-solaris2.10". >>> > Type "show configuration" for configuration details. >>> > For bug reporting instructions, please see: >>> > <http://www.gnu.org/software/gdb/bugs/>. >>> > Find the GDB manual and other documentation resources online at: >>> > <http://www.gnu.org/software/gdb/documentation/>. >>> > For help, type "help". >>> > Type "apropos word" to search for commands related to "word"... >>> > Reading symbols from /export/home/amandeep/gccgo-obj/./gcc/go1...done. >>> > >>> > warning: Couldn't find general-purpose registers in core file. >>> > >>> > warning: Wrong size fpregset in core file. >>> > [Thread debugging using libthread_db enabled] >>> > [New Thread 1 (LWP 1)] >>> > >>> > warning: Couldn't find general-purpose registers in core file. >>> > >>> > warning: Couldn't find general-purpose registers in core file. >>> > Error in re-setting breakpoint -1: PC register is not available >>> > Error in re-setting breakpoint -2: PC register is not available >>> > Error in re-setting breakpoint -3: PC register is not available >>> > Error in re-setting breakpoint -4: PC register is not available >>> > Error in re-setting breakpoint -5: PC register is not available >>> > Core was generated by `/export/home/amandeep/gccgo-obj/./gcc/go1 >>> > /export/home/amandeep/gccgo-src/libgo'. >>> > >>> > warning: Couldn't find general-purpose registers in core file. >>> > >>> > warning: Wrong size fpregset in core file. >>> > PC not available >>> > #-1 <unavailable> in ?? () >>> > (gdb) bt >>> > #-1 <unavailable> in ?? () >>> > #0 <unavailable> in ?? () >>> > frame.c:472: internal-error: get_frame_id: Assertion `fi->this_id.p' >>> > failed. >>> > A problem internal to GDB has been detected, >>> > further debugging may prove unreliable. >>> > Quit this debugging session? (y or n) n >>> > frame.c:472: internal-error: get_frame_id: Assertion `fi->this_id.p' >>> > failed. >>> > A problem internal to GDB has been detected, >>> > further debugging may prove unreliable. >>> > Create a core file of GDB? (y or n) y >>> > Command aborted. >>> > >>> > Have I steps mentioned correctly? Any suggestions on the next steps? >>> >>> There is something badly wrong with your gdb. Unfortunately I can't >>> help you with that. I have not seen that behavior before. >>> >>> I guess you could hope that the problem is only with the core file, >>> and run the program inside gdb rather than trying to look at the core. >>> >>> Ian > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.