proot icon indicating copy to clipboard operation
proot copied to clipboard

[Feature Request] Add support for the powerpc64 architecture

Open Apteryks opened this issue 2 years ago • 2 comments

Expected Behavior

Ideally, proot could be built on powerpc64.

Actual Behavior

The build fails, with errors mentioning "Unsupported architecture".

Steps to Reproduce the Problem

  1. Build from source on a powerpc64le-linux system

Specifications

  • Proot/Care version: v5.2.0-alpha tag
  • Kernel version: 4.19.171-2 (2021-01-30) ppc64le GNU/Linux
  • Host distribution: Debian with Guix running on top
  • Guest distribution: N/A

Using the following build inputs (from Guix):

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Command Output

starting phase `build'
make: Entering directory '/tmp/guix-build-proot-5.2.0-alpha.drv-0/source/src'
.//arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
.//arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
/gnu/store/6ql2s2z4xnsj89zdf4zj6fch2zic0l7k-bash-minimal-5.0.16/bin/sh: git: command not found
/gnu/store/6ql2s2z4xnsj89zdf4zj6fch2zic0l7k-bash-minimal-5.0.16/bin/sh: git: command not found
/gnu/store/6ql2s2z4xnsj89zdf4zj6fch2zic0l7k-bash-minimal-5.0.16/bin/sh: git: command not found
.//arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
.//arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
.//arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
.//arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
  CC    cli/note.o
  CC    execve/enter.o
  CC    execve/exit.o
  CC    execve/shebang.o
  CC    execve/elf.o
  CC    execve/ldso.o
  CC    execve/auxv.o
  CC    path/binding.o
In file included from ./tracee/tracee.h:34:0,
                 from ./cli/note.h:26,
                 from ./cli/note.c:29:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./cli/note.h:26:0,
                 from ./cli/note.c:29:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
make: *** [GNUmakefile:191: cli/note.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./tracee/tracee.h:34:0,
                 from ./execve/execve.h:28,
                 from ./execve/exit.c:33:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./tracee/tracee.h:34:0,
                 from ./execve/execve.h:28,
                 from ./execve/enter.c:35:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
In file included from ./execve/execve.h:28:0,
                 from ./execve/exit.c:33:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./execve/execve.h:29:0,
                 from ./execve/exit.c:33:
./execve/elf.h:138:0: warning: "ELF_CLASS" redefined
 #define ELF_CLASS(header) ELF_IDENT(header, 4)
 
In file included from ./execve/execve.h:28:0,
                 from ./execve/enter.c:35:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
In file included from /gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/sigcontext.h:14:0,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/bits/sigcontext.h:30,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/signal.h:291,
                 from ./execve/exit.c:29:
/gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/elf.h:118:0: note: this is the location of the previous definition
 # define ELF_CLASS ELFCLASS64
 
In file included from ./execve/execve.h:29:0,
                 from ./execve/enter.c:35:
./execve/elf.h:138:0: warning: "ELF_CLASS" redefined
 #define ELF_CLASS(header) ELF_IDENT(header, 4)
 
In file included from /gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/sigcontext.h:14:0,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/bits/sigcontext.h:30,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/signal.h:291,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/sys/wait.h:36,
                 from ./tracee/tracee.h:33,
                 from ./execve/execve.h:28,
                 from ./execve/enter.c:35:
/gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/elf.h:118:0: note: this is the location of the previous definition
 # define ELF_CLASS ELFCLASS64
 
In file included from ./tracee/tracee.h:34:0,
                 from ./tracee/reg.h:26,
                 from ./execve/aoxp.h:28,
                 from ./execve/ldso.h:29,
                 from ./execve/ldso.c:31:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./tracee/reg.h:26:0,
                 from ./execve/aoxp.h:28,
                 from ./execve/ldso.h:29,
                 from ./execve/ldso.c:31:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
In file included from ./execve/ldso.h:30:0,
                 from ./execve/ldso.c:31:
./execve/elf.h:138:0: warning: "ELF_CLASS" redefined
 #define ELF_CLASS(header) ELF_IDENT(header, 4)
 
In file included from /gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/sigcontext.h:14:0,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/bits/sigcontext.h:30,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/signal.h:291,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/sys/wait.h:36,
                 from ./tracee/tracee.h:33,
                 from ./tracee/reg.h:26,
                 from ./execve/aoxp.h:28,
                 from ./execve/ldso.h:29,
                 from ./execve/ldso.c:31:
/gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/elf.h:118:0: note: this is the location of the previous definition
 # define ELF_CLASS ELFCLASS64
 
In file included from ./tracee/tracee.h:34:0,
                 from ./execve/elf.h:167,
                 from ./execve/elf.c:33:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./execve/elf.h:167:0,
                 from ./execve/elf.c:33:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
In file included from ./tracee/tracee.h:34:0,
                 from ./execve/shebang.h:28,
                 from ./execve/shebang.c:34:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./execve/shebang.h:28:0,
                 from ./execve/shebang.c:34:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
In file included from ./execve/execve.h:29:0,
                 from ./execve/shebang.c:35:
./execve/elf.h:138:0: warning: "ELF_CLASS" redefined
 #define ELF_CLASS(header) ELF_IDENT(header, 4)
 
In file included from /gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/sigcontext.h:14:0,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/bits/sigcontext.h:30,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/signal.h:291,
                 from /gnu/store/sipyfs2540b48b2sb9j8ypmybja1dvqb-glibc-2.31/include/sys/param.h:28,
                 from ./execve/shebang.c:30:
/gnu/store/sg9ks2n9ikj4952zmf2g851g206zb0r9-linux-libre-headers-5.4.20/include/asm/elf.h:118:0: note: this is the location of the previous definition
 # define ELF_CLASS ELFCLASS64
 
make: *** [GNUmakefile:191: execve/shebang.o] Error 1
make: *** [GNUmakefile:191: execve/ldso.o] Error 1
In file included from ./execve/exit.c:37:0:
./tracee/abi.h: In function ‘offsetof_stat_uid’:
./tracee/abi.h:116:5: error: ‘OFFSETOF_STAT_UID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_UID_32
     ^~~~~~~~~~~~~~~~~~~~
./tracee/abi.h:116:5: note: each undeclared identifier is reported only once for each function it appears in
./execve/elf.c: In function ‘is_host_elf’:
./execve/elf.c:151:27: error: ‘HOST_ELF_MACHINE’ undeclared (first use in this function)
  int host_elf_machine[] = HOST_ELF_MACHINE;
                           ^~~~~~~~~~~~~~~~
./execve/elf.c:151:27: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./syscall/sysnum.h:29:0,
                 from ./execve/enter.c:45:
./tracee/abi.h: In function ‘offsetof_stat_uid’:
./tracee/abi.h:116:5: error: ‘OFFSETOF_STAT_UID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_UID_32
     ^~~~~~~~~~~~~~~~~~~~
./tracee/abi.h:116:5: note: each undeclared identifier is reported only once for each function it appears in
make: *** [GNUmakefile:191: execve/elf.o] Error 1
./tracee/abi.h: In function ‘offsetof_stat_gid’:
./tracee/abi.h:127:5: error: ‘OFFSETOF_STAT_GID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_GID_32
     ^~~~~~~~~~~~~~~~~~~~
./tracee/abi.h: In function ‘offsetof_stat_gid’:
./tracee/abi.h:127:5: error: ‘OFFSETOF_STAT_GID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_GID_32
     ^~~~~~~~~~~~~~~~~~~~
In file included from ./tracee/tracee.h:34:0,
                 from ./execve/auxv.h:26,
                 from ./execve/auxv.c:31:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./execve/auxv.h:26:0,
                 from ./execve/auxv.c:31:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
In file included from ./tracee/tracee.h:34:0,
                 from ./path/binding.h:29,
                 from ./path/binding.c:33:
./arch.h:51:10: error: #error "Unsupported architecture"
 #        error "Unsupported architecture"
          ^~~~~
./arch.h:176:6: error: #error "Unsupported architecture"
     #error "Unsupported architecture"
      ^~~~~
In file included from ./path/binding.h:29:0,
                 from ./path/binding.c:33:
./tracee/tracee.h:159:26: error: array type has incomplete element type ‘struct user_regs_struct’
  struct user_regs_struct _regs[NB_REG_VERSION];
                          ^~~~~
make: *** [GNUmakefile:191: execve/exit.o] Error 1
./execve/enter.c: In function ‘compute_load_addresses’:
./execve/enter.c:341:36: error: ‘EXEC_PIC_ADDRESS’ undeclared (first use in this function); did you mean ‘R_PPC_ADDR14’?
   add_load_base(tracee->load_info, EXEC_PIC_ADDRESS);
                                    ^~~~~~~~~~~~~~~~
                                    R_PPC_ADDR14
In file included from ./syscall/sysnum.h:29:0,
                 from ./execve/auxv.c:32:
./tracee/abi.h: In function ‘offsetof_stat_uid’:
./tracee/abi.h:116:5: error: ‘OFFSETOF_STAT_UID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_UID_32
     ^~~~~~~~~~~~~~~~~~~~
./tracee/abi.h:116:5: note: each undeclared identifier is reported only once for each function it appears in
./execve/enter.c:355:44: error: ‘INTERP_PIC_ADDRESS’ undeclared (first use in this function); did you mean ‘EXEC_PIC_ADDRESS’?
   add_load_base(tracee->load_info->interp, INTERP_PIC_ADDRESS);
                                            ^~~~~~~~~~~~~~~~~~
                                            EXEC_PIC_ADDRESS
./execve/enter.c: In function ‘extract_loader’:
./execve/enter.c:529:2: warning: ‘talloc_autofree_context’ is deprecated [-Wdeprecated-declarations]
  loader_path = talloc_strdup(talloc_autofree_context(), path);
  ^~~~~~~~~~~
In file included from ./execve/enter.c:28:0:
/gnu/store/jq83j1alvhxa297pmfp5dprxn5f46q2l-talloc-2.3.2/include/talloc.h:1071:16: note: declared here
 _PUBLIC_ void *talloc_autofree_context(void) _DEPRECATED_;
                ^~~~~~~~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:191: path/binding.o] Error 1
./tracee/abi.h: In function ‘offsetof_stat_gid’:
./tracee/abi.h:127:5: error: ‘OFFSETOF_STAT_GID_32’ undeclared (first use in this function)
   ? OFFSETOF_STAT_GID_32
     ^~~~~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:191: execve/enter.o] Error 1
make: *** [GNUmakefile:191: execve/auxv.o] Error 1
rm .check_seccomp_filter.o .check_process_vm.o
make: Leaving directory '/tmp/guix-build-proot-5.2.0-alpha.drv-0/source/src'
command "make" "-j" "8" "-C" "src" failed with status 2

Apteryks avatar Jul 09 '21 19:07 Apteryks

Source: https://github.com/proot-me/proot/blob/master/src/arch.h#L51

oxr463 avatar Jul 09 '21 19:07 oxr463

Reference(s):

  • https://wiki.qemu.org/Documentation/Platforms/PowerPC

oxr463 avatar Jan 25 '22 19:01 oxr463