OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Packages
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Josef Schlehofer - 09.11.2019
Last edited by Hauke Mehrtens - 09.11.2019

FS#2585 - Strace fails to build on powerpc8540 - error: invalid use of undefined type 'struct pt_regs'

Strace fails to build on powerpc 8540. This is happening on OpenWrt 19.07 and master as well. I get the same issue, which is on buildbots:

In file included from syscall.c:1002:
syscall.c: In function 'get_instruction_pointer':
./linux/powerpc/arch_regs.c:11:29: error: invalid use of undefined type 'struct pt_regs'
   11 | #define ARCH_PC_REG ppc_regs.nip
      |                             ^
syscall.c:1246:25: note: in expansion of macro 'ARCH_PC_REG'
 1246 |  *ip = (kernel_ulong_t) ARCH_PC_REG;
      |                         ^~~~~~~~~~~
syscall.c: In function 'get_stack_pointer':
./linux/powerpc/arch_regs.c:12:29: error: invalid use of undefined type 'struct pt_regs'
   12 | #define ARCH_SP_REG ppc_regs.gpr[1]
      |                             ^
syscall.c:1273:25: note: in expansion of macro 'ARCH_SP_REG'
 1273 |  *sp = (kernel_ulong_t) ARCH_SP_REG;
      |                         ^~~~~~~~~~~
In file included from syscall.c:1488:
./linux/powerpc/get_scno.c: In function 'arch_get_scno':
./linux/powerpc/get_scno.c:12:22: error: invalid use of undefined type 'struct pt_regs'
   12 |  tcp->scno = ppc_regs.gpr[0];
      |                      ^
In file included from syscall.c:1491:
./linux/powerpc/get_syscall_args.c: In function 'arch_get_syscall_args':
./linux/powerpc/get_syscall_args.c:19:38: error: invalid use of undefined type 'struct pt_regs'
   19 |   tcp->u_arg[0] = (uint32_t) ppc_regs.orig_gpr3;
      |                                      ^
./linux/powerpc/get_syscall_args.c:20:38: error: invalid use of undefined type 'struct pt_regs'
   20 |   tcp->u_arg[1] = (uint32_t) ppc_regs.gpr[4];
      |                                      ^
./linux/powerpc/get_syscall_args.c:21:38: error: invalid use of undefined type 'struct pt_regs'
   21 |   tcp->u_arg[2] = (uint32_t) ppc_regs.gpr[5];
      |                                      ^
./linux/powerpc/get_syscall_args.c:22:38: error: invalid use of undefined type 'struct pt_regs'
   22 |   tcp->u_arg[3] = (uint32_t) ppc_regs.gpr[6];
      |                                      ^
./linux/powerpc/get_syscall_args.c:23:38: error: invalid use of undefined type 'struct pt_regs'
   23 |   tcp->u_arg[4] = (uint32_t) ppc_regs.gpr[7];
      |                                      ^
./linux/powerpc/get_syscall_args.c:24:38: error: invalid use of undefined type 'struct pt_regs'
   24 |   tcp->u_arg[5] = (uint32_t) ppc_regs.gpr[8];
      |                                      ^
./linux/powerpc/get_syscall_args.c:26:27: error: invalid use of undefined type 'struct pt_regs'
   26 |   tcp->u_arg[0] = ppc_regs.orig_gpr3;
      |                           ^
./linux/powerpc/get_syscall_args.c:27:27: error: invalid use of undefined type 'struct pt_regs'
   27 |   tcp->u_arg[1] = ppc_regs.gpr[4];
      |                           ^
./linux/powerpc/get_syscall_args.c:28:27: error: invalid use of undefined type 'struct pt_regs'
   28 |   tcp->u_arg[2] = ppc_regs.gpr[5];
      |                           ^
./linux/powerpc/get_syscall_args.c:29:27: error: invalid use of undefined type 'struct pt_regs'
   29 |   tcp->u_arg[3] = ppc_regs.gpr[6];
      |                           ^
./linux/powerpc/get_syscall_args.c:30:27: error: invalid use of undefined type 'struct pt_regs'
   30 |   tcp->u_arg[4] = ppc_regs.gpr[7];
      |                           ^
./linux/powerpc/get_syscall_args.c:31:27: error: invalid use of undefined type 'struct pt_regs'
   31 |   tcp->u_arg[5] = ppc_regs.gpr[8];
      |                           ^
In file included from syscall.c:1495:
./linux/powerpc/get_error.c: In function 'arch_get_error':
./linux/powerpc/get_error.c:11:14: error: invalid use of undefined type 'struct pt_regs'
   11 |  if (ppc_regs.ccr & 0x10000000) {
      |              ^
./linux/powerpc/get_error.c:13:26: error: invalid use of undefined type 'struct pt_regs'
   13 |   tcp->u_error = ppc_regs.gpr[3];
      |                          ^
./linux/powerpc/get_error.c:15:25: error: invalid use of undefined type 'struct pt_regs'
   15 |   tcp->u_rval = ppc_regs.gpr[3];
      |                         ^
In file included from syscall.c:1496:
./linux/powerpc/set_error.c: In function 'arch_set_r3_ccr':
./linux/powerpc/set_error.c:13:49: error: invalid use of undefined type 'struct pt_regs'
   13 |      upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr))
      |                                                 ^
./linux/powerpc/set_error.c:15:40: error: invalid use of undefined type 'struct pt_regs'
   15 |  const unsigned long old_ccr = ppc_regs.ccr;
      |                                        ^
./linux/powerpc/set_error.c:16:10: error: invalid use of undefined type 'struct pt_regs'
   16 |  ppc_regs.gpr[3] = r3;
      |          ^
./linux/powerpc/set_error.c:17:10: error: invalid use of undefined type 'struct pt_regs'
   17 |  ppc_regs.ccr |= ccr_set;
      |          ^
./linux/powerpc/set_error.c:18:10: error: invalid use of undefined type 'struct pt_regs'
   18 |  ppc_regs.ccr &= ~ccr_clear;
      |          ^
./linux/powerpc/set_error.c:19:14: error: invalid use of undefined type 'struct pt_regs'
   19 |  if (ppc_regs.ccr != old_ccr &&
      |              ^
./linux/powerpc/set_error.c:20:48: error: invalid use of undefined type 'struct pt_regs'
   20 |      upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr))
      |                                                ^
./linux/powerpc/set_error.c:22:56: error: invalid use of undefined type 'struct pt_regs'
   22 |  return upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
      |                                                        ^
In file included from syscall.c:1498:
./linux/powerpc/getregs_old.c: In function 'getregs_old':
./linux/powerpc/getregs_old.c:19:50: error: invalid use of undefined type 'struct pt_regs'
   19 |   r = upeek(tcp, sizeof(long) * PT_NIP, &ppc_regs.nip);
      |                                                  ^
./linux/powerpc/getregs_old.c:28:49: error: invalid use of undefined type 'struct pt_regs'
   28 |  r = upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr);
      |                                                 ^
./linux/powerpc/getregs_old.c:31:53: error: invalid use of undefined type 'struct pt_regs'
   31 |  r = upeek(tcp, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3);
      |                                                     ^
./linux/powerpc/getregs_old.c:36:15: error: invalid use of undefined type 'struct pt_regs'
   36 |      &ppc_regs.gpr[i]);
      |               ^
In file included from syscall.c:1002:
syscall.c: At top level:
./linux/powerpc/arch_regs.c:8:23: error: storage size of 'ppc_regs' isn't known
    8 | static struct pt_regs ppc_regs;
      |                       ^~~~~~~~
In file included from syscall.c:1496:
./linux/powerpc/set_error.c: In function 'arch_set_r3_ccr':
./linux/powerpc/set_error.c:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
Makefile:6997: recipe for target 'strace-syscall.o' failed
make[5]: *** [strace-syscall.o] Error 1

OpenWrt 19.07
Faillog: https://downloads.openwrt.org/releases/faillogs-19.07/powerpc_8540/base/strace/compile.txt

OpenWrt master
Faillog: https://downloads.openwrt.org/snapshots/faillogs/powerpc_8540/base/strace/compile.txt

Closed by  Hauke Mehrtens
09.11.2019 19:54
Reason for closing:  Fixed
Additional comments about closing:  

Fixes in master and 19.07:
https://g it.openwrt.org/?p=openwrt/openwrt.git;a= commitdiff;h=b01305c8d26d8eb3525cf795910 75601b04736cc https://g it.openwrt.org/?p=openwrt/openwrt.git;a= commitdiff;h=69dcd89dcd1358eaf226029793a fa1a1ef8e4022

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing