There is problem with compiling or1k 0.4.0. I tried compiling it manual and by install script and both give attached error report. I am using CygWin and I have no problem with compile or1k 0.3.0.
make all-recursive
make1: Entering directory /home/Ondrej/or_chain/or32-build/or1ksim-0.4.0'
Making all in argtable2
make[2]: Entering directory
/home/Ondrej/or_chain/or32-build/or1ksim-0.4.0/argtable2'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../cpu/or32 -I.. -I../cpu/common -I../cpu/or1k -I../cache -I../mmu -I../bpb -I../peripheral -I../tick -I../peripheral/channels -I../pm -I../pic -I../debug -I../vapi -I../support -I../cuc -I../port -I../argtable2 -DNDEBUG -g -O2 -g -Wall -Werror -O2 -DOR32 -MT libargtable2_la-argtable2.lo -MD -MP -MF .deps/libargtable2_la-argtable2.Tpo -c -o libargtable2_la-argtable2.lo test -f 'argtable2.c' || echo './'
argtable2.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../cpu/or32 -I.. -I../cpu/common -I../cpu/or1k -I../cache -I../mmu -I../bpb -I../peripheral -I../tick -I../peripheral/channels -I../pm -I../pic -I../debug -I../vapi -I../support -I../cuc -I../port -I../argtable2 -DNDEBUG -g -O2 -g -Wall -Werror -O2 -DOR32 -MT libargtable2_la-argtable2.lo -MD -MP -MF .deps/libargtable2_la-argtable2.Tpo -c argtable2.c -DDLL_EXPORT -DPIC -o .libs/libargtable2_la-argtable2.o
argtable2.c: In function arg_print_formatted':
argtable2.c:972: warning: array subscript has type
char'
argtable2.c:981: warning: array subscript has type char'
make[2]: *** [libargtable2_la-argtable2.lo] Error 1
make[2]: Leaving directory
/home/Ondrej/or_chain/or32-build/or1ksim-0.4.0/argtable2'
make1: all-recursive Error 1
make1: Leaving directory `/home/Ondrej/or_chain/or32-build/or1ksim-0.4.0'
make: all Error 2
Hi
I have changed it as you said. The same problem was also in files or32.c and generate.c and sim_cmd.c. The problem is usually with function "isspace".
There is aslo problem with redefinition "MSG_DONTWAIT" in file eth.h on line 204.
Next problem was with file rsp-server.c. There I must change function "rsp_remove_matchpoint" at line 2234
static void rsp_remove_matchpoint (struct rsp_buf buf) { enum mp_type type; / What sort of matchpoint / unsigned long int addr; / Address specified / int len; / Matchpoint length (not used) / struct mp_entry mpe; / Info about the replaced instr / int tmp_en;
type = WP_ACCESS;
/ Break out the instruction /
if (3 != sscanf (buf->data, "z%1d,%lx,%1d", /(int )&type/&tmp_en, &addr, &len))
{
/(int) type = tmp_en; */
switch (tmp_en) {
case 0: type = BP_MEMORY; break;
case 1: type = BP_HARDWARE; break;
case 2: type = WP_WRITE; break;
case 3: type = WP_READ; break;
case 4: type = WP_ACCESS; break;
default : type = WP_ACCESS; break;
}
fprintf (stderr, "Warning: RSP matchpoint deletion request not "
"recognized: ignored\n");
put_str_packet ("E01");
return;
}
Similar changes must be dove for function "rsp_insert_matchpoint" at line 2330. I am not 100% sure this change is OK.
With this changes it is possible to compile or1ksim 0.4.0. Now I test, if it work.
One more note - what version of gcc are you using? Becouse I am using under Cygwin gcc 3.4.4.
Its true, that I have about 1 year old verson of Cygwin and that time it doesnt support gcc 4.
/ Break out the instruction. We have to use an intermediary for the type, since older GCCs do not like taking the address of an enum (dereferencing type-punned pointer). / if (3 != sscanf (buf->data, "z%1d,%lx,%1d", &type_for_scanf, &addr, &len)) { fprintf (stderr, "Warning: RSP matchpoint deletion request not " "recognized: ignored\n"); put_str_packet ("E01"); return; }
type = type_for_scanf;
/ Sanity check that the length is 4 / if (4 != len)
</pre> <p> Here is the change for rsp_insert_matchpoint at line 2330. </p> <pre> static void rsp_insert_matchpoint (struct rsp_buf *buf) { enum mp_type type; /* What sort of matchpoint */ int type_for_scanf; /* To avoid old GCC limitations */ unsigned long int addr; /* Address specified */ int len; /* Matchpoint length (not used) *// Break out the instruction. We have to use an intermediary for the type, since older GCCs do not like taking the address of an enum (dereferencing type-punned pointer). / if (3 != sscanf (buf->data, "Z%1d,%lx,%1d", &type_for_scanf, &addr, &len)) { fprintf (stderr, "Warning: RSP matchpoint insertion request not " "recognized: ignored\n"); put_str_packet ("E01"); return; }
type = type_for_scanf;
/ Sanity check that the length is 4 / if (4 != len)
</pre> <p> This should cure the problem - let me know if you still have problems. I'll check this into SVN and it will get rolled into the next release. </p> <p> Thanks for reporting the problem. </p> <p> Jeremy </p>