2

I am attempting to compile a simulator for Y86 code on archlinux, here is my configuration. (I'm really sorry about the format.)


GUIMODE=-DHAS_GUI

TKLIBS=-L/usr/lib -ltk -ltcl

TKINC=-isystem /usr/include 

But when I run the makefile, things seems to be wrong:

(cd misc; make all)
make[1]: Entering directory '/home/meijieru/sim/misc'
gcc -Wall -O2 -c yis.c
gcc -Wall -O2 -c isa.c
isa.c: 在函数‘load_mem’中:
isa.c:204:10: 警告:变量‘hexcode’被设定但未被使用 [-Wunused-but-set-variable]
     char hexcode[15];
          ^
isa.c:203:9: 警告:变量‘addr’被设定但未被使用 [-Wunused-but-set-variable]
     int addr = 0;
         ^
isa.c:202:9: 警告:变量‘empty_line’被设定但未被使用 [-Wunused-but-set-variable]
     int empty_line = 1;
         ^
gcc -Wall -O2 yis.o isa.o -o yis
gcc -Wall -O2 -c yas.c
gcc -O2 -c yas-grammar.c
gcc -Wall -O2 yas-grammar.o yas.o isa.o -lfl -o yas
bison -d hcl.y
flex hcl.lex
gcc -O2 node.c lex.yy.c hcl.tab.c outgen.c -o hcl2c
make[1]: Leaving directory '/home/meijieru/sim/misc'
(cd pipe; make all GUIMODE=-DHAS_GUI TKLIBS="-L/usr/lib -ltk -ltcl" TKINC="-isystem /usr/include ")
make[1]: Entering directory '/home/meijieru/sim/pipe'
# Building the pipe-std.hcl version of PIPE
../misc/hcl2c -n pipe-std.hcl < pipe-std.hcl > pipe-std.c
gcc -Wall -O2 -isystem /usr/include  -I../misc -DHAS_GUI -o psim psim.c pipe-std.c \
    ../misc/isa.c -L/usr/lib -ltk -ltcl -lm
psim.c: 在函数‘simResetCmd’中:
psim.c:852:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = "No arguments allowed";
        ^
psim.c:860:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = stat_name(STAT_AOK);
           ^
psim.c: 在函数‘simLoadCodeCmd’中:
psim.c:871:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = "One argument required";
        ^
psim.c:877:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = tcl_msg;
        ^
psim.c:884:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = tcl_msg;
           ^
psim.c: 在函数‘simLoadDataCmd’中:
psim.c:894:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = "Not implemented";
           ^
psim.c:900:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = "One argument required";
        ^
psim.c:906:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = tcl_msg;
        ^
psim.c:910:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = tcl_msg;
           ^
psim.c: 在函数‘simRunCmd’中:
psim.c:924:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = "At most one argument allowed";
        ^
psim.c:931:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = tcl_msg;
        ^
psim.c:935:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = stat_name(status);
           ^
psim.c: 在函数‘simModeCmd’中:
psim.c:944:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = "One argument required";
        ^
psim.c:947:11: 错误:‘Tcl_Interp’没有名为‘result’的成员
     interp->result = argv[1];
           ^
psim.c:956:8: 错误:‘Tcl_Interp’没有名为‘result’的成员
  interp->result = tcl_msg;
        ^
psim.c: 在函数‘signal_register_update’中:
psim.c:993:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘create_memory_display’中:
psim.c:1004:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c:1019:60: 错误:‘Tcl_Interp’没有名为‘result’的成员
      fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                            ^
psim.c: 在函数‘set_memory’中:
psim.c:1054:60: 错误:‘Tcl_Interp’没有名为‘result’的成员
      fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                            ^
psim.c: 在函数‘show_cc’中:
psim.c:1068:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘show_stat’中:
psim.c:1080:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘show_cpi’中:
psim.c:1095:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘signal_sources’中:
psim.c:1109:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘signal_register_clear’中:
psim.c:1119:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘report_line’中:
psim.c:1133:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘report_pc’中:
psim.c:1189:56: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "Error Message was '%s'\n", sim_interp->result);
                                                        ^
psim.c: 在函数‘report_state’中:
psim.c:1203:58: 错误:‘Tcl_Interp’没有名为‘result’的成员
  fprintf(stderr, "\tError Message was '%s'\n", sim_interp->result);
                                                          ^
Makefile:42: recipe for target 'psim' failed
make[1]: *** [psim] Error 1
make[1]: Leaving directory '/home/meijieru/sim/pipe'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2

Any insight into this issue?

peterh
  • 11,875
  • 18
  • 85
  • 108
jkjkjk
  • 111
  • 8
  • You have mistakes your code, not your Makefile. You need to include your code in order for others to help you. The first three errors are variables that are defined and set but never used through your code; the others I cannot read. – Brian White Apr 24 '15 at 14:35
  • [Please try to improve your spelling.](http://meta.stackoverflow.com/questions/291362) – peterh Apr 25 '15 at 13:19

2 Answers2

1

In case that someone encounters this issue, in sim/Makefile, just comment these lines out:

GUIMODE=-DHAS_GUI
TKLIBS=-L/usr/lib -ltk -ltcl
TKINC=-isystem /usr/include/tcl8.5

And in sim/pipe/Makefile as well as sim/seq/Makefile, repeat this operation above.

Hope this helps and have fun with this lab :)

Xin
  • 113
  • 3
  • 9
0

The type Tcl_Interp doesn't have a member called result.

Add -DUSE_INTERP_RESULT to CPPFLAGS when building with tcl support

deimus
  • 9,565
  • 12
  • 63
  • 107
  • I am learning csapp,so I wanted to install the y86 simulator provided by the website.but i met this problem.thanks for your help – jkjkjk Apr 24 '15 at 15:12
  • Check the updated answer, you have to add an extra flag for proper compilation. – deimus Apr 24 '15 at 15:17
  • I still have the same error even when I try : `make CPPFLAGS="-DUSE_INTERP_RESULT"`How can I fix that problem? (ArchLinux, Tcl/Tk was installed) – Dentrax Jun 22 '18 at 21:44