[fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
I'm having one of my periodic attempts to check FPC trunk on various architectures, this was going to be a question about an exception when trying to link libgdb into 2.6.2 but I find the behaviour has changed so I mention that for information only. Also for information only, when I used -j 8 for 2.6.2 there was a message about left-over directories, I similarly don't get that with trunk (or it's intermittent) so let's leave it. So the current situation is this: when building FPC trunk on Debian Linux on SPARC, everything is fine if I use NOGDB=1. However, if I try to use libgdb (which has in the past but not particularly recently worked OK on this system) I get this make GDB_V603=1 OPT='-O- -gl' all .. ./fpmake compile --localunitdir=.. --globalunitdir=../packages --os=linux --cpu=sparc -o -Ur -o -Xs -o -O2 -o -n -o -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -o -O- -o -gl -o -vt -o -dRELEASE --compiler=/usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -bu Start compiling package ide for target sparc-linux. LibGDB was found, build IDE with debugger support Warning: Unable to determine the libgcc path. Compiling compiler/compunit.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/ppheap.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/cutils.pas .. Compiling /usr/local/src/fpc/fpc-trunk/compiler/dbgdwarf.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/browcol.pas Warning: Unable to determine the libgcc path. Compiling fp.pas Compiling fpcatch.pas Compiling fpcompil.pas .. Compiling fpcodtmp.pas Compiling fptemplt.pas Linking bin/sparc-linux/fp The installer encountered the following error: External command /usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -Tlinux -FEbin/sparc-linux -FUunits/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fv/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/chm/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-xml/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-base/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-res/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/iconvenc/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/regexpr/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/gdbint/units/sparc-linux/ -Fl -Ur -Xs -O2 -n -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -O- -gl -vt -dRELEASE -Ur -dNOCATCH -dBrowserCol -dGDB -dsparc -Fu../compiler -Fu../compiler/sparc -Fu../compiler/targets -Fu../compiler/systems -Fi../compiler/sparc -Fi../compiler -Sg -Fl../libgdb/linux/sparc/ -viq fp.pas failed with exit code 1. Console output: Target OS: Linux for SPARC Compiling fp.pas fp.pas(27,2) (2004) Start reading includefile globdir.inc Compiling fpcatch.pas .. Writing Resource String Table file: fpcatch.rst Assembling fpcatch Writing Resource String Table file: fp.rst Assembling fp Linking bin/sparc-linux/fp fp.pas(554) Error: Error while linking fp.pas(554) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: Leaving directory `/usr/local/src/fpc/fpc-trunk/ide' make[1]: Leaving directory `/usr/local/src/fpc/fpc-trunk' The obvious first question is: are those references to libgcc significant, and what file is being looked for? The normal binary installer hasn't been run on this system since FPC's been built on it from source since something like 2.0. Any and all suggestions appreciated. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
Hi Mark, this is one of the problems with fpmake, sometimes we seems to loose the output of the calls to the assembler or the linker :( Could you try to run make inside ide directory and add -Xd option to OPT? Does this solve your problem? I get the same kind of error on i386-linux system because the compiler chooses a system library for libreadline.a instead of the one that is in GDBLIBDIR... Pierre Muller -Message d'origine- De : fpc-devel-boun...@lists.freepascal.org [mailto:fpc-devel- boun...@lists.freepascal.org] De la part de Mark Morgan Lloyd Envoyé : jeudi 8 août 2013 11:02 À : fpc-devel@lists.freepascal.org Objet : [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems I'm having one of my periodic attempts to check FPC trunk on various architectures, this was going to be a question about an exception when trying to link libgdb into 2.6.2 but I find the behaviour has changed so I mention that for information only. Also for information only, when I used -j 8 for 2.6.2 there was a message about left-over directories, I similarly don't get that with trunk (or it's intermittent) so let's leave it. So the current situation is this: when building FPC trunk on Debian Linux on SPARC, everything is fine if I use NOGDB=1. However, if I try to use libgdb (which has in the past but not particularly recently worked OK on this system) I get this make GDB_V603=1 OPT='-O- -gl' all .. ./fpmake compile --localunitdir=.. --globalunitdir=../packages --os=linux --cpu=sparc -o -Ur -o -Xs -o -O2 -o -n -o -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -o -O- -o -gl -o -vt -o -dRELEASE --compiler=/usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -bu Start compiling package ide for target sparc-linux. LibGDB was found, build IDE with debugger support Warning: Unable to determine the libgcc path. Compiling compiler/compunit.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/ppheap.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/cutils.pas .. Compiling /usr/local/src/fpc/fpc-trunk/compiler/dbgdwarf.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/browcol.pas Warning: Unable to determine the libgcc path. Compiling fp.pas Compiling fpcatch.pas Compiling fpcompil.pas .. Compiling fpcodtmp.pas Compiling fptemplt.pas Linking bin/sparc-linux/fp The installer encountered the following error: External command /usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -Tlinux -FEbin/sparc-linux -FUunits/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fv/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/chm/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-xml/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-base/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-res/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/iconvenc/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/regexpr/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/gdbint/units/sparc-linux/ -Fl -Ur -Xs -O2 -n -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -O- -gl -vt -dRELEASE -Ur -dNOCATCH -dBrowserCol -dGDB -dsparc -Fu../compiler -Fu../compiler/sparc -Fu../compiler/targets -Fu../compiler/systems -Fi../compiler/sparc -Fi../compiler -Sg -Fl../libgdb/linux/sparc/ -viq fp.pas failed with exit code 1. Console output: Target OS: Linux for SPARC Compiling fp.pas fp.pas(27,2) (2004) Start reading includefile globdir.inc Compiling fpcatch.pas .. Writing Resource String Table file: fpcatch.rst Assembling fpcatch Writing Resource String Table file: fp.rst Assembling fp Linking bin/sparc-linux/fp fp.pas(554) Error: Error while linking fp.pas(554) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: Leaving directory `/usr/local/src/fpc/fpc-trunk/ide' make[1]: Leaving directory `/usr/local/src/fpc/fpc-trunk' The obvious first question is: are those references to libgcc significant, and what file is being looked for? The normal binary installer hasn't been run on this system since FPC's been built
[fpc-devel] Cross-compile compiler itself
Hi all, How can I cross-compile the compiler itself? I tried it by: make clean all CPU_TARGET=arm Then: make all CPU_TARGET=arm PP=ppcrossarm But that one failes, because the first step it does is compiling the rtl for the host platform (x86_64). Which fails when ppcrossarm is used for that... There has to be a way, but how? Joost. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Cross-compile compiler itself
On 08 Aug 2013, at 12:51, Joost van der Sluis wrote: How can I cross-compile the compiler itself? I tried it by: make clean all CPU_TARGET=arm Then: make all CPU_TARGET=arm PP=ppcrossarm But that one failes, because the first step it does is compiling the rtl for the host platform (x86_64). Which fails when ppcrossarm is used for that... There has to be a way, but how? After the first command, there is already a cross-compiled compiler in the compiler subdirectory (called ppcarm). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Cross-compile compiler itself
On 08/08/2013 12:54 PM, Jonas Maebe wrote: On 08 Aug 2013, at 12:51, Joost van der Sluis wrote: How can I cross-compile the compiler itself? I tried it by: make clean all CPU_TARGET=arm Then: make all CPU_TARGET=arm PP=ppcrossarm But that one failes, because the first step it does is compiling the rtl for the host platform (x86_64). Which fails when ppcrossarm is used for that... There has to be a way, but how? After the first command, there is already a cross-compiled compiler in the compiler subdirectory (called ppcarm). Ohh.. so easy... Thanks. Joost. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
Pierre Free Pascal wrote: -Message d'origine- De : fpc-devel-boun...@lists.freepascal.org [mailto:fpc-devel- boun...@lists.freepascal.org] De la part de Mark Morgan Lloyd Envoyé : jeudi 8 août 2013 11:02 À : fpc-devel@lists.freepascal.org Objet : [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems I'm having one of my periodic attempts to check FPC trunk on various architectures, this was going to be a question about an exception when trying to link libgdb into 2.6.2 but I find the behaviour has changed so I mention that for information only. Also for information only, when I used -j 8 for 2.6.2 there was a message about left-over directories, I similarly don't get that with trunk (or it's intermittent) so let's leave it. So the current situation is this: when building FPC trunk on Debian Linux on SPARC, everything is fine if I use NOGDB=1. However, if I try to use libgdb (which has in the past but not particularly recently worked OK on this system) I get this make GDB_V603=1 OPT='-O- -gl' all .. ./fpmake compile --localunitdir=.. --globalunitdir=../packages --os=linux --cpu=sparc -o -Ur -o -Xs -o -O2 -o -n -o -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -o -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -o -O- -o -gl -o -vt -o -dRELEASE --compiler=/usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -bu Start compiling package ide for target sparc-linux. LibGDB was found, build IDE with debugger support Warning: Unable to determine the libgcc path. Compiling compiler/compunit.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/ppheap.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/cutils.pas .. Compiling /usr/local/src/fpc/fpc-trunk/compiler/dbgdwarf.pas Compiling /usr/local/src/fpc/fpc-trunk/compiler/browcol.pas Warning: Unable to determine the libgcc path. Compiling fp.pas Compiling fpcatch.pas Compiling fpcompil.pas .. Compiling fpcodtmp.pas Compiling fptemplt.pas Linking bin/sparc-linux/fp The installer encountered the following error: External command /usr/local/src/fpc/fpc-trunk/compiler/ppcsparc -Tlinux -FEbin/sparc-linux -FUunits/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fv/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/chm/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-xml/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-base/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-res/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/iconvenc/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/regexpr/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/gdbint/units/sparc-linux/ -Fl -Ur -Xs -O2 -n -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/paszlib/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-process/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/hash/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/libtar/units/sparc-linux -Fu/usr/local/src/fpc/fpc-trunk/packages/fpmkunit/units/sparc-linux -O- -gl -vt -dRELEASE -Ur -dNOCATCH -dBrowserCol -dGDB -dsparc -Fu../compiler -Fu../compiler/sparc -Fu../compiler/targets -Fu../compiler/systems -Fi../compiler/sparc -Fi../compiler -Sg -Fl../libgdb/linux/sparc/ -viq fp.pas failed with exit code 1. Console output: Target OS: Linux for SPARC Compiling fp.pas fp.pas(27,2) (2004) Start reading includefile globdir.inc Compiling fpcatch.pas .. Writing Resource String Table file: fpcatch.rst Assembling fpcatch Writing Resource String Table file: fp.rst Assembling fp Linking bin/sparc-linux/fp fp.pas(554) Error: Error while linking fp.pas(554) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: Leaving directory `/usr/local/src/fpc/fpc-trunk/ide' make[1]: Leaving directory `/usr/local/src/fpc/fpc-trunk' The obvious first question is: are those references to libgcc significant, and what file is being looked for? The normal binary installer hasn't been run on this system since FPC's been built on it from source since something like 2.0. Any and all suggestions appreciated. Hi Mark, this is one of the problems with fpmake, sometimes we seems to loose the output of the calls to the assembler or the linker :( Could you try to run make inside ide directory and add -Xd option to OPT? Does this solve your problem? I get the same kind of error on i386-linux system because the compiler chooses a system library for libreadline.a instead of the one that is in
Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
External command /usr/local/bin/ppcsparc -Tlinux -FEbin/sparc-linux -FUunits/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/rtl/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fv/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/chm/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-xml/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-base/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/fcl-res/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/iconvenc/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/regexpr/units/sparc-linux/ -Fu/usr/local/src/fpc/fpc-trunk/packages/gdbint/units/sparc-linux/ -Fl -Fu../rtl/units/sparc-linux -Fu../packages/paszlib/units/sparc-linux -Fu../packages/fcl-process/units/sparc-linux -Fu../packages/hash/units/sparc-linux -Fu../packages/libtar/units/sparc-linux -Fu../packages/fpmkunit/units/sparc-linux -O- -gl -Xd -Ur -dNOCATCH -dBrowserCol -dGDB -dsparc -Fu../compiler -Fu../compiler/sparc -Fu../compiler/targets -Fu../compiler/systems -Fi../compiler/sparc -Fi../compiler -Sg -Fl../libgdb/linux/sparc/ -viq fp.pas failed with exit code 217. Console output: Free Pascal Compiler version 2.6.2 [2013/08/05] for sparc Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for SPARC Compiling fp.pas .. Compiling /usr/local/src/fpc/fpc-trunk/compiler/sparc/itcpugas.pas Assembling itcpugas Compiling fpswitch.pas Compiling fpvars.pas Compiling fpdebug.pas Compiling fpregs.pas Compiling fpvars.pas Compiling fputils.pas Compiling fpvars.pas Compiling fpcalc.pas fpcalc.pas(236,3) Note: Local variable fpucw not used Writing Resource String Table file: fpcalc.rst Assembling fpcalc Assembling fpvars fputils.pas(239,5) Note: Local variable C is assigned but never used Assembling fputils fpregs.pas(281,8) Note: Local variable code is assigned but never used fpregs.pas(822,12) Note: Local variable value not used fpregs.pas(825,8) Note: Local variable res is assigned but never used fpregs.pas(827,8) Note: Local variable err is assigned but never used fpregs.pas(997,8) Note: Local variable top not used fpregs.pas(1002,7) Note: Local variable TypeStr not used fpregs.pas(1251,8) Note: Local variable reg is assigned but never used fpregs.pas(1251,12) Note: Local variable value not used fpregs.pas(1254,8) Note: Local variable res is assigned but never used fpregs.pas(1256,8) Note: Local variable err is assigned but never used fpregs.pas(1381,8) Note: Local variable top not used fpregs.pas(1382,8) Note: Local variable color is assigned but never used fpregs.pas(1384,8) Note: Local variable i not used fpregs.pas(1386,7) Note: Local variable TypeStr not used Fatal: Compilation aborted An unhandled exception occurred at $001E61C0 : EDivByZero : Division by zero $001E61C0 TCGASSIGNMENTNODE__PASS_GENERATE_CODE, line 785 of ncgld.pas At this point: what's actually running, i.e. what command should I apply gdb to to get a decent backtrace? I think the command at the top is running, because tcgassignmentnode is a class in the compiler. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
Mark Morgan Lloyd wrote: Fatal: Compilation aborted An unhandled exception occurred at $001E61C0 : EDivByZero : Division by zero $001E61C0 TCGASSIGNMENTNODE__PASS_GENERATE_CODE, line 785 of ncgld.pas At this point: what's actually running, i.e. what command should I apply gdb to to get a decent backtrace? If I revert to 2.6.2 and run ppcsparc under gdb, I get this as a backtrace: Program received signal SIGFPE, Arithmetic exception. 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 785 if (right.location.reference.offset mod alignmentrequirement0) or (gdb) bt #0 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 #1 0x0014d9c4 in SECONDPASS (P=0xf5d6abe0) at pass_2.pas:195 #2 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1d320) at ncgbas.pas:366 #3 0x0014d9c4 in SECONDPASS (P=0xf5b1d320) at pass_2.pas:195 #4 0x001dc2b4 in TCGIFNODE__PASS_GENERATE_CODE (this=0xf5d737f0) at ncgflw.pas:275 #5 0x0014d9c4 in SECONDPASS (P=0xf5d737f0) at pass_2.pas:195 #6 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1c0a0) at ncgbas.pas:366 #7 0x0014d9c4 in SECONDPASS (P=0xf5b1c0a0) at pass_2.pas:195 #8 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1eaa0) at ncgbas.pas:366 #9 0x0014d9c4 in SECONDPASS (P=0xf5b1eaa0) at pass_2.pas:195 #10 0x0014db14 in DO_SECONDPASS (P=0xf5b1eaa0) at pass_2.pas:227 #11 0x0016a368 in TCGPROCINFO__GENERATE_CODE (this=0xf6357cd0) at psub.pas:1048 #12 0x0016c170 in DO_GENERATE_CODE (PI=0xf6357cd0, parentfp=0xffed8790) at psub.pas:1557 .. Also (if I'm doing this right) (gdb) print alignmentrequirement $1 = 0 Any thoughts appreciated. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
On 08.08.2013 19:08, Mark Morgan Lloyd wrote: Mark Morgan Lloyd wrote: Fatal: Compilation aborted An unhandled exception occurred at $001E61C0 : EDivByZero : Division by zero $001E61C0 TCGASSIGNMENTNODE__PASS_GENERATE_CODE, line 785 of ncgld.pas At this point: what's actually running, i.e. what command should I apply gdb to to get a decent backtrace? If I revert to 2.6.2 and run ppcsparc under gdb, I get this as a backtrace: Program received signal SIGFPE, Arithmetic exception. 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 785 if (right.location.reference.offset mod alignmentrequirement0) or (gdb) bt #0 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 #1 0x0014d9c4 in SECONDPASS (P=0xf5d6abe0) at pass_2.pas:195 #2 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1d320) at ncgbas.pas:366 #3 0x0014d9c4 in SECONDPASS (P=0xf5b1d320) at pass_2.pas:195 #4 0x001dc2b4 in TCGIFNODE__PASS_GENERATE_CODE (this=0xf5d737f0) at ncgflw.pas:275 #5 0x0014d9c4 in SECONDPASS (P=0xf5d737f0) at pass_2.pas:195 #6 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1c0a0) at ncgbas.pas:366 #7 0x0014d9c4 in SECONDPASS (P=0xf5b1c0a0) at pass_2.pas:195 #8 0x001daf94 in TCGBLOCKNODE__PASS_GENERATE_CODE (this=0xf5b1eaa0) at ncgbas.pas:366 #9 0x0014d9c4 in SECONDPASS (P=0xf5b1eaa0) at pass_2.pas:195 #10 0x0014db14 in DO_SECONDPASS (P=0xf5b1eaa0) at pass_2.pas:227 #11 0x0016a368 in TCGPROCINFO__GENERATE_CODE (this=0xf6357cd0) at psub.pas:1048 #12 0x0016c170 in DO_GENERATE_CODE (PI=0xf6357cd0, parentfp=0xffed8790) at psub.pas:1557 .. Also (if I'm doing this right) (gdb) print alignmentrequirement $1 = 0 Any thoughts appreciated. This is strange. If you take a look at the code there are at least two checks that should ensure that alignmentrequirement is not 0... Could you maybe step into Min and Max to check whether they produce sane results? (you'll likely need to recompile the RTL with debug information; I'd suggest you to use 2.7.1 for debugging) If you can't recompile the RTL with debug information you could try to break up the assignment statement for alignmentrequirement into single steps and print the values so that we can have a complete picture. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
Sven Barth wrote: If I revert to 2.6.2 and run ppcsparc under gdb, I get this as a backtrace: Program received signal SIGFPE, Arithmetic exception. 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 785 if (right.location.reference.offset mod alignmentrequirement0) or (gdb) bt #0 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 Also (if I'm doing this right) (gdb) print alignmentrequirement $1 = 0 Any thoughts appreciated. This is strange. If you take a look at the code there are at least two checks that should ensure that alignmentrequirement is not 0... Could you maybe step into Min and Max to check whether they produce sane results? (you'll likely need to recompile the RTL with debug information; I'd suggest you to use 2.7.1 for debugging) If you can't recompile the RTL with debug information you could try to break up the assignment statement for alignmentrequirement into single steps and print the values so that we can have a complete picture. I'll take a look at that in the morning, probably by printing temporary values etc. since I'm not very confident trying to single-step somebody else's complex code. Allowing that this is apparently a compiler rather than an fp/libgdb issue, is there test code for this case anywhere? Misbehaving min()/max() rings a horrible bell, but I can't remember the context. I'm glad to say that at least removing the -O- has no beneficial effect :-) -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems
Hi, I am sorry, but Ihave no access to a sprac machine anymore. But I remember that we already had a problem like this coming from the fact that we declare somewhere an empty record and this lead to troubles... TVectorREgss from fpregs unit might still be empty for sparc. This was fixed in http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/compiler/ncgld.pas?sortby =dater1=19338r2=19337pathrev=19338 in May 2011... But I was hoping it was fixed in 2.6.2 ... Could you try to recompile trunk compiler and check that that one does not crash. Pierre PS :Test bug is tiny: Try to compile the following, with either 2.6.2 or current trunk binary, type emptyrec = record end; var x, y : emptyrec; begin x:=y; end. -Message d'origine- De : fpc-devel-boun...@lists.freepascal.org [mailto:fpc-devel- boun...@lists.freepascal.org] De la part de Mark Morgan Lloyd Envoyé : jeudi 8 août 2013 22:22 À : fpc-devel@lists.freepascal.org Objet : Re: [fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems Sven Barth wrote: If I revert to 2.6.2 and run ppcsparc under gdb, I get this as a backtrace: Program received signal SIGFPE, Arithmetic exception. 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 785 if (right.location.reference.offset mod alignmentrequirement0) or (gdb) bt #0 0x001e61c0 in TCGASSIGNMENTNODE__PASS_GENERATE_CODE (this=0xf5d6abe0) at ncgld.pas:785 Also (if I'm doing this right) (gdb) print alignmentrequirement $1 = 0 Any thoughts appreciated. This is strange. If you take a look at the code there are at least two checks that should ensure that alignmentrequirement is not 0... Could you maybe step into Min and Max to check whether they produce sane results? (you'll likely need to recompile the RTL with debug information; I'd suggest you to use 2.7.1 for debugging) If you can't recompile the RTL with debug information you could try to break up the assignment statement for alignmentrequirement into single steps and print the values so that we can have a complete picture. I'll take a look at that in the morning, probably by printing temporary values etc. since I'm not very confident trying to single-step somebody else's complex code. Allowing that this is apparently a compiler rather than an fp/libgdb issue, is there test code for this case anywhere? Misbehaving min()/max() rings a horrible bell, but I can't remember the context. I'm glad to say that at least removing the -O- has no beneficial effect :-) -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel