Opened 8 weeks ago

Closed 5 weeks ago

#24424 closed defect (fixed)

fails to build with libseccomp-dev installed on arm64

Reported by: weasel Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: 029-backport, 030-backport, 031-backport, review-group-27
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by weasel)

13:21:06 ../tor/src/common/sandbox.c: In function 'sigsys_debugging':
13:21:06 ../tor/src/common/sandbox.c:1812:35: error: 'mcontext_t {aka struct sigcontext}' has no member named 'M_SYSCALL'
13:21:06    syscall = (int) ctx->uc_mcontext.M_SYSCALL;
13:21:06                                    ^
13:21:13 Makefile:5615: recipe for target 'src/common/sandbox.o' failed
13:21:13 make[1]: *** [src/common/sandbox.o] Error 1

Note that on arm64, __arm__ is not defined.

cf. https://wiki.debian.org/ArchitectureSpecificsMemo

Child Tickets

Change History (10)

comment:1 Changed 8 weeks ago by weasel

Description: modified (diff)

comment:2 Changed 8 weeks ago by nickm

Keywords: 029-backport 030-backport 031-backport added
Milestone: Tor: 0.3.2.x-final
Owner: set to nickm
Status: newaccepted

Fix for review in bug24424_029.

comment:3 Changed 8 weeks ago by nickm

Status: acceptedneeds_review

comment:4 Changed 8 weeks ago by weasel

-#elif defined(__arm__)
+#elif defined(__aarch64__)

I don't think that's right.

/Maybe/ we want an extra conditional block (__aarch64__ && __LP64__) which uses regs[8].

(also, cf. man 2 signal.)

comment:5 Changed 8 weeks ago by nickm

Status: needs_reviewneeds_revision

comment:6 Changed 7 weeks ago by weasel

This makes things build on arm64 (and does not break builds on armhf or amd64):

--- src/common/sandbox.c        2017-11-20 18:22:10.000000000 +0000
+++ /home/weasel/sandbox.c      2017-11-28 08:31:16.990108519 +0000
@@ -106,6 +106,11 @@
 
 #define M_SYSCALL arm_r7
 
+#elif defined(__aarch64__) && defined(__LP64__)
+
+#define REG_SYSCALL 8
+#define M_SYSCALL regs[REG_SYSCALL]
+
 #endif /* defined(__i386__) || ... */
 
 /**Determines if at least one sandbox is active.*/
Last edited 7 weeks ago by weasel (previous) (diff)

comment:7 Changed 7 weeks ago by weasel

Status: needs_revisionneeds_review

comment:8 Changed 7 weeks ago by weasel

Once this is fixed, we should revert 7d743ff40dac07f86427d47bdf0dbb92e73f1a43 in jenkins/tools.

comment:9 Changed 6 weeks ago by nickm

Keywords: review-group-27 added

comment:10 Changed 5 weeks ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Taking this in 0.3.2, but not backporting, since it isn't sufficient to actually have the sandbox.c code work on arm yet. I think when it does work, we should consider it a "new feature" rather than a bug fix, since it didn't work before.

15b41fa6ae6a1356d5453242ccb7d7d301dd5e67 is the patch as applied.

Note: See TracTickets for help on using tickets.