Closed TommyMurphyTM1234 closed 6 years ago
the problem seems different from https://github.com/riscv/riscv-openocd/issues/150
at first sight it looks like a missing library.
it would be easier if we could compare to an official build, preferable that runs on Travis to validate each commit.
is there such a Travis script, in some other repo? (since here I could not find one).
the problem seem different from riscv/riscv-openocd#150
Yes - I didn't mean to imply that the two issues were the same but was just pointing out another case where, strangely in that case, the linux build worked but the windows one did not.
is there such a Travis script, in some other repo? (since here I could not find one).
Isn't that what this discussion was about?
https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/HdkwlJF4JXA
link is a POSIX syscall. mingw of course does not support it.
Kito added some syscall emulation code to the RISC-V simulator so that it could successfully run more programs. One of these new syscalls is for link. There are a few things we can do here. We can ifdef out the link support when built on mingw. We can add a routine to libiberty that emulates the POSIX link function for windows. We can remove the syscall support from the simulator, and declare that the BSP (i.e. libgloss) must provide this functionality. Or we could just drop support for link and let programs that call it fail.
The easy one is to ifdef out the code that calls link on Windows.
diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c
index 5200c86445..444e4b829f 100644
--- a/sim/riscv/sim-main.c
+++ b/sim/riscv/sim-main.c
@@ -1764,6 +1764,7 @@ execute_i (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op)
switch (cpu->a7)
{
+#ifndef __MINGW32__
case TARGET_SYS_link:
{
char oldpath[1024], newpath[1024];
@@ -1772,6 +1773,7 @@ execute_i (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op)
cpu->a0 = link (oldpath, newpath);
break;
}
+#endif
case TARGET_SYS_brk:
{
/* FIXME: Check the invalid access. */
Thanks a lot Jim - I'll make that mod locally and try a new build. Presumably one of the options that you outline should be chosen and applied [to the mater repo] to ensure that things build on windows/mingw (cross build from linux in my case) again?
Edit: update - yes that allowed the windows build to complete successfully. Thanks again.
Patch committed.
Overnight I tried to build the latest stuff from the repo and while the linux build completed the windows one failed:
It seems odd that linux completed but windows failed but, on Friday, I had the same experience with this issue where the linux build completed and the windows one did not:
https://github.com/riscv/riscv-openocd/issues/150
Anyway for the RISC-V gcc tools I am using a slightly modified version of Liviu's GNU MCU Eclipse build process and scripts which includes cross compilation from a linux docker image for Windows:
https://github.com/gnu-mcu-eclipse/riscv-none-gcc-build
And I am telling it to build the following:
Any ideas? Thanks.