Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump gdb to FSF gdb 10.1, with our gdb sim patched in. #776

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

jim-wilson
Copy link
Collaborator

Tested with build and make check for rv32i/ilp32 elf and rv64gc/lp64d elff, and with a check-sim in build-gdb-newlib. I had to fix DECLARE_CSR to have 5 args instead of 2. I had to fix the sim testsuite which looks like it maybe never worked. Otherwise it just worked. Doesn't work for riscv linux target, but not expected to.

This is expected to fix MacOS build errors, issues 745 and pull request 769.

This also gives us gdbserver.

@tyfkda
Copy link

tyfkda commented Nov 18, 2020

I come here from #769 .

@jim-wilson Thank you to update the submodule.
I run make command with this change on Mac Catalina,
it seems compile error reported in #745 are solved,
but other error ocurred.

In file included from /Users/admin/tmp/riscv-gnu-toolchain/riscv-gdb/sim/riscv/interp.c:32:
/Users/admin/tmp/riscv-gnu-toolchain/riscv-gdb/sim/riscv/../../bfd/elf-bfd.h:3085:10: error: 
      implicitly declaring library function 'strncmp' with type 'int (const char *, const char *,
      unsigned long)' [-Werror,-Wimplicit-function-declaration]
  return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.');
         ^
/Users/admin/tmp/riscv-gnu-toolchain/riscv-gdb/sim/riscv/../../bfd/elf-bfd.h:3085:10: note: include
      the header <string.h> or explicitly provide a declaration for 'strncmp'
2 warnings and 1 error generated.
make[4]: *** [interp.o] Error 1
make[3]: *** [all] Error 1
make[2]: *** [all-sim] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-gdb-newlib] Error 2

Is string.h not included?

@jim-wilson jim-wilson force-pushed the jimw-bump-gdb-with-sim branch from 3ac2140 to 6f498c6 Compare November 18, 2020 03:35
@jim-wilson
Copy link
Collaborator Author

OK I see the problem now. The CTF changes to elf-bfd.h means that anything including elf-bfd.h now needs to include string.h. Upgrading gdb fixes all upstream code, but doesn't fix the local riscv sim. This didn't show up in pr #769 because it accidentally dropped the local riscv sim by switching to the binutils branch. I pushed another patch to my branch to fix the sim/riscv/interp.c file and updated my pull request to include it.

@tyfkda
Copy link

tyfkda commented Nov 18, 2020

@jim-wilson I succeeded building the toolchain. Thank you!

@kito-cheng
Copy link
Collaborator

LGTM, verified with gcc testsuite, the only fail cases are already reported in riscvarchive/riscv-binutils-gdb#235

@kito-cheng kito-cheng merged commit 3e8b333 into master Nov 19, 2020
@kito-cheng kito-cheng deleted the jimw-bump-gdb-with-sim branch November 19, 2020 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants