Opened 10 months ago

Last modified 5 months ago

#32904 new defect

Tor build fails with -enable-seccomp on mips

Reported by: pa-ja Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.4.2.5
Severity: Normal Keywords: mips
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi,
I'm trying to make tor seccomp variant for OpenWrt (https://github.com/openwrt/packages/pull/10779)
For MIPS build fails on error:

'mcontext_t' {aka 'struct <anonymous>'} has no member named 'M_SYSCALL'

for arm build is fine.

This issue is probably related to https://trac.torproject.org/projects/tor/ticket/24424

Log from failed build:

src/lib/sandbox/sandbox.c: In function 'sigsys_debugging':
src/lib/sandbox/sandbox.c:1617:35: error: 'mcontext_t' {aka 'struct <anonymous>'} has no member named 'M_SYSCALL'
   syscall = (int) ctx->uc_mcontext.M_SYSCALL;
                                   ^
Makefile:10599: recipe for target 'src/lib/sandbox/sandbox.o' failed
make[4]: *** [src/lib/sandbox/sandbox.o] Error 1
make[4]: Leaving directory '/home/build/build_dir/build_dir/target-mips_24kc_musl/tor-seccomp/tor-0.4.2.5'
Makefile:5828: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/build/build_dir/build_dir/target-mips_24kc_musl/tor-seccomp/tor-0.4.2.5'
Makefile:170: recipe for target '/home/build/build_dir/build_dir/target-mips_24kc_musl/tor-seccomp/tor-0.4.2.5/.built' failed
make[2]: *** [/home/build/build_dir/build_dir/target-mips_24kc_musl/tor-seccomp/tor-0.4.2.5/.built] Error 2
make[2]: Leaving directory '/home/build/openwrt_packages/net/tor'
time: package/feeds/packages/tor/seccomp/compile#2.85#1.40#5.06
package/Makefile:111: recipe for target 'package/feeds/packages/tor/compile' failed
make[1]: *** [package/feeds/packages/tor/compile] Error 2
make[1]: Leaving directory '/home/build/build_dir'
/home/build/build_dir/include/toplevel.mk:218: recipe for target 'package/tor/compile' failed
make: *** [package/tor/compile] Error 2

Child Tickets

Change History (2)

comment:1 Changed 10 months ago by dgoulet

Keywords: mips added
Milestone: Tor: unspecified

comment:2 Changed 5 months ago by nickm

So, this is going to require somebody who knows the linux ABI on MIPS. In theory, there should be some register in which the syscall is stored when we hit the signal handler. That's different on each platform. If you add a definition for that at the start of sandbox.c, it should make compilation work.

We can take patches for this to work better, but we don't have the resources to work on MIPS ourselves.

Note: See TracTickets for help on using tickets.