Skip to content

Commit 3a69b1a

Browse files
committed
fix arm build
1 parent 9c0bbf1 commit 3a69b1a

9 files changed

+18
-11
lines changed

src/app/shared/commands/run/generated/pidns.arm64_seccomp.h renamed to src/app/shared/commands/run/generated/pidns_arm64_seccomp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#else
2222
# error "Target architecture is unsupported by seccomp."
2323
#endif
24-
static const unsigned int sock_filter_policy_pidns.arm64_instr_cnt = 23;
24+
static const unsigned int sock_filter_policy_pidns_arm64_instr_cnt = 23;
2525

26-
static void populate_sock_filter_policy_pidns.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd) {
26+
static void populate_sock_filter_policy_pidns_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd) {
2727
FD_TEST( out_cnt >= 23 );
2828
struct sock_filter filter[23] = {
2929
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */

src/app/shared/commands/run/run.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <sys/wait.h>
55
#include "generated/main_seccomp.h"
66
#if defined(__aarch64__)
7-
#include "generated/pidns.arm64_seccomp.h"
7+
#include "generated/pidns_arm64_seccomp.h"
88
#else
99
#include "generated/pidns_seccomp.h"
1010
#endif
@@ -336,7 +336,14 @@ main_pid_namespace( void * _args ) {
336336
allow_fds[ allow_fds_cnt++ ] = fds[ i ].fd; /* read end of child pipes */
337337

338338
struct sock_filter seccomp_filter[ 128UL ];
339+
unsigned int instr_cnt;
340+
#if defined(__aarch64__)
341+
populate_sock_filter_policy_pidns_arm64( 128UL, seccomp_filter, (uint)fd_log_private_logfile_fd() );
342+
instr_cnt = sock_filter_policy_pidns_arm64_instr_cnt;
343+
#else
339344
populate_sock_filter_policy_pidns( 128UL, seccomp_filter, (uint)fd_log_private_logfile_fd() );
345+
instr_cnt = sock_filter_policy_pidns_instr_cnt;
346+
#endif
340347

341348
if( FD_LIKELY( config->development.sandbox ) ) {
342349
fd_sandbox_enter( config->uid,
@@ -350,7 +357,7 @@ main_pid_namespace( void * _args ) {
350357
0UL,
351358
allow_fds_cnt,
352359
allow_fds,
353-
sock_filter_policy_pidns_instr_cnt,
360+
instr_cnt,
354361
seccomp_filter );
355362
} else {
356363
fd_sandbox_switch_uid_gid( config->uid, config->gid );
@@ -783,7 +790,7 @@ run_firedancer( config_t * config,
783790

784791
run_firedancer_init( config, init_workspaces );
785792

786-
#if defined(__x86_64__)
793+
#if defined(__x86_64__) || defined(__aarch64__)
787794

788795
#ifndef SYS_landlock_create_ruleset
789796
#define SYS_landlock_create_ruleset 444

src/disco/gui/fd_gui_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <sys/socket.h> /* SOCK_CLOEXEC, SOCK_NONBLOCK needed for seccomp filter */
1313
#if defined(__aarch64__)
14-
#include "generated/fd_gui_tile.arm64_seccomp.h"
14+
#include "generated/fd_gui_tile_arm64_seccomp.h"
1515
#else
1616
#include "generated/fd_gui_tile_seccomp.h"
1717
#endif

src/disco/gui/generated/fd_gui_tile.arm64_seccomp.h renamed to src/disco/gui/generated/fd_gui_tile_arm64_seccomp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#else
2222
# error "Target architecture is unsupported by seccomp."
2323
#endif
24-
static const unsigned int sock_filter_policy_fd_gui_tile.arm64_instr_cnt = 45;
24+
static const unsigned int sock_filter_policy_fd_gui_tile_arm64_instr_cnt = 45;
2525

26-
static void populate_sock_filter_policy_fd_gui_tile.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int gui_socket_fd) {
26+
static void populate_sock_filter_policy_fd_gui_tile_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int gui_socket_fd) {
2727
FD_TEST( out_cnt >= 45 );
2828
struct sock_filter filter[45] = {
2929
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */

src/disco/metrics/fd_metric_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <string.h>
99

1010
#if defined(__aarch64__)
11-
#include "generated/fd_metric_tile.arm64_seccomp.h"
11+
#include "generated/fd_metric_tile_arm64_seccomp.h"
1212
#else
1313
#include "generated/fd_metric_tile_seccomp.h"
1414
#endif

src/disco/metrics/generated/fd_metric_tile.arm64_seccomp.h renamed to src/disco/metrics/generated/fd_metric_tile_arm64_seccomp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#else
2222
# error "Target architecture is unsupported by seccomp."
2323
#endif
24-
static const unsigned int sock_filter_policy_fd_metric_tile.arm64_instr_cnt = 45;
24+
static const unsigned int sock_filter_policy_fd_metric_tile_arm64_instr_cnt = 45;
2525

26-
static void populate_sock_filter_policy_fd_metric_tile.arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int metrics_socket_fd) {
26+
static void populate_sock_filter_policy_fd_metric_tile_arm64( ulong out_cnt, struct sock_filter * out, unsigned int logfile_fd, unsigned int metrics_socket_fd) {
2727
FD_TEST( out_cnt >= 45 );
2828
struct sock_filter filter[45] = {
2929
/* Check: Jump to RET_KILL_PROCESS if the script's arch != the runtime arch */

0 commit comments

Comments
 (0)