SpinalHDL / openocd_riscv

Spen's Official OpenOCD Mirror
Other
45 stars 33 forks source link

Make fails #27

Closed adz0612 closed 2 years ago

adz0612 commented 2 years ago

Hello, while trying to run make after configuration, it fails with the following error:

aditya@aditya1:~/Desktop/vexRiscv_tutorial/VexRiscv/vexriscv-openocd$ make mkdir -p src cat src/helper/startup.tcl src/jtag/startup.tcl src/target/startup.tcl src/server/startup.tcl src/flash/startup.tcl | ./src/helper/bin2char.sh > src/startup_tcl.inc || { rm -f src/startup_tcl.inc; false; } make all-recursive make[1]: Entering directory '/home/aditya/Desktop/vexRiscv_tutorial/VexRiscv/vexriscv-openocd' Making all in jimtcl make[2]: Entering directory '/home/aditya/Desktop/vexRiscv_tutorial/VexRiscv/vexriscv-openocd/jimtcl' MKLDEXT _load-static-exts.c CC _load-static-exts.o CC jim-subcmd.o CC jim-interactive.o CC jim-format.o CC jim.o CC utf8.o CC jimregexp.o CC jimiocompat.o CC linenoise.o linenoise.c: In function ‘enableRawMode’: linenoise.c:674:20: error: storage size of ‘raw’ isn’t known 674 | struct termios raw; | ^~~ linenoise.c:680:9: warning: implicit declaration of function ‘tcgetattr’ [-Wimplicit-function-declaration] 680 | tcgetattr(current->fd, &orig_termios) == -1) { | ^~~~~ linenoise.c:694:22: error: ‘BRKINT’ undeclared (first use in this function) 694 | raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); | ^~ linenoise.c:694:22: note: each undeclared identifier is reported only once for each function it appears in linenoise.c:694:31: error: ‘ICRNL’ undeclared (first use in this function) 694 | raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); | ^~~~~ linenoise.c:694:39: error: ‘INPCK’ undeclared (first use in this function) 694 | raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); | ^~~~~ linenoise.c:694:47: error: ‘ISTRIP’ undeclared (first use in this function); did you mean ‘N_STRIP’? 694 | raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); | ^~ | N_STRIP linenoise.c:694:56: error: ‘IXON’ undeclared (first use in this function) 694 | raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); | ^~~~ linenoise.c:698:21: error: ‘CS8’ undeclared (first use in this function) 698 | raw.c_cflag |= (CS8); | ^~~ linenoise.c:701:22: error: ‘ECHO’ undeclared (first use in this function) 701 | raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); | ^~~~ linenoise.c:701:29: error: ‘ICANON’ undeclared (first use in this function) 701 | raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); | ^~ linenoise.c:701:38: error: ‘IEXTEN’ undeclared (first use in this function) 701 | raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); | ^~ linenoise.c:701:47: error: ‘ISIG’ undeclared (first use in this function); did you mean ‘NSIG’? 701 | raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); | ^~~~ | NSIG linenoise.c:704:14: error: ‘VMIN’ undeclared (first use in this function); did you mean ‘CMIN’? 704 | raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; / 1 byte, no timer / | ^~~~ | CMIN linenoise.c:704:34: error: ‘VTIME’ undeclared (first use in this function); did you mean ‘ETIME’? 704 | raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; / 1 byte, no timer / | ^~~~~ | ETIME linenoise.c:707:9: warning: implicit declaration of function ‘tcsetattr’ [-Wimplicit-function-declaration] 707 | if (tcsetattr(current->fd,TCSADRAIN,&raw) < 0) { | ^~~~~ linenoise.c:707:31: error: ‘TCSADRAIN’ undeclared (first use in this function) 707 | if (tcsetattr(current->fd,TCSADRAIN,&raw) < 0) { | ^~~~~ linenoise.c:674:20: warning: unused variable ‘raw’ [-Wunused-variable] 674 | struct termios raw; | ^~~ linenoise.c: In function ‘disableRawMode’: linenoise.c:716:42: error: ‘TCSADRAIN’ undeclared (first use in this function) 716 | if (rawmode && tcsetattr(current->fd,TCSADRAIN,&orig_termios) != -1) | ^~~~~ linenoise.c: In function ‘linenoiseAtExit’: linenoise.c:723:33: error: ‘TCSADRAIN’ undeclared (first use in this function) 723 | tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_termios); | ^~~~~ linenoise.c: At top level: linenoise.c:653:23: error: storage size of ‘orig_termios’ isn’t known 653 | static struct termios orig_termios; / in order to restore at exit / | ^~~~ make[2]: [Makefile:59: linenoise.o] Error 1 make[2]: Leaving directory '/home/aditya/Desktop/vexRiscv_tutorial/VexRiscv/vexriscv-openocd/jimtcl' make[1]: [Makefile:4853: all-recursive] Error 1 make[1]: Leaving directory '/home/aditya/Desktop/vexRiscv_tutorial/VexRiscv/vexriscv-openocd' make: *** [Makefile:2010: all] Error 2

Dolu1990 commented 2 years ago

Hi,

I just tried :

git clone https://github.com/SpinalHDL/openocd_riscv.git
cd openocd_riscv
./bootstrap
./configure --enable-ftdi --enable-dummy
make

Worked well on my side (linux mint)

gcc --version gcc (Ubuntu 10.1.0-2ubuntu1~18.04) 10.1.0

What is your version of gcc ?

adz0612 commented 2 years ago

Hello, I am using gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Dolu1990 commented 2 years ago

hmmm weird, never seen such issue. Can you try to compile the official upstream openocd to see if you have the same issue.

adz0612 commented 2 years ago

Hello, sorry for the delayed response, I tried making the official upstream but even that fails with the same error. [ I used the same configuration options as for vexriscv ]

adz0612 commented 2 years ago

@Dolu1990 Anything that I can try here?

Dolu1990 commented 2 years ago

Hi, hmm i don't know, maybe you have one of the depedencies installed which is buggy ? so trying to update all the package depedencies ?

Else, i can send you one version i got compiled

adz0612 commented 2 years ago

@Dolu1990 I tried to update the dependencies, but no luck, I get the same error. Yup, if you could send me the version you compiled that would be of great help, not sure if you can share it here directly if not, you can send it to my email [aditya.jain0612@gmail.com]

Thank you so much for your help!

Dolu1990 commented 2 years ago

Here it is : https://drive.google.com/file/d/1V-P2tKkmuBpBNd9XzSL-DNoEMruGDKXa/view?usp=sharing

Let's hope it is good.

adz0612 commented 2 years ago

This works. Thanks a lot!