Skip to content

Commit

Permalink
Fix compile error of tsf benchmark (bytecodealliance#2588)
Browse files Browse the repository at this point in the history
Explicitly declare readdir_r in gpc_code_gen_util.c.
  • Loading branch information
wenyongh authored Sep 25, 2023
1 parent ee4d743 commit ae966d5
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tests/benchmarks/jetstream/tsf.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
diff -urN tsf-src-org/gpc_code_gen_util.c tsf-src/gpc_code_gen_util.c
--- tsf-src-org/gpc_code_gen_util.c 2023-09-21 11:12:40.211166472 +0800
+++ tsf-src/gpc_code_gen_util.c 2023-09-21 11:09:13.643170967 +0800
@@ -34,6 +34,8 @@
#include <errno.h>
#include <dirent.h>

+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
+
/* code generation debugging */

/* NOTE: It is now the case that the count may be incremented multiple times,
diff -urN tsf-src-org/tsf_internal.h tsf-src/tsf_internal.h
--- tsf-src-org/tsf_internal.h 2023-03-31 10:49:45.000000000 +0800
+++ tsf-src/tsf_internal.h 2023-05-11 08:18:35.000000000 +0800
--- tsf-src-org/tsf_internal.h 2023-09-21 11:11:50.843167546 +0800
+++ tsf-src/tsf_internal.h 2023-09-21 11:06:53.031174027 +0800
@@ -429,6 +429,7 @@
#endif
tsf_fsdb_connection_t *connection;
Expand All @@ -10,15 +22,15 @@ diff -urN tsf-src-org/tsf_internal.h tsf-src/tsf_internal.h
} u;
tsf_limits_t *limits;
diff -urN tsf-src-org/tsf_ir_speed.c tsf-src/tsf_ir_speed.c
--- tsf-src-org/tsf_ir_speed.c 2023-03-31 10:49:45.000000000 +0800
+++ tsf-src/tsf_ir_speed.c 2023-05-11 08:18:35.000000000 +0800
--- tsf-src-org/tsf_ir_speed.c 2023-09-21 11:12:15.699167005 +0800
+++ tsf-src/tsf_ir_speed.c 2023-09-21 11:06:53.031174027 +0800
@@ -63,6 +63,9 @@
Program_t *program;
unsigned elementIndex;

+ if (!(programIndex % 100))
+ printf("##programIndex: %u\n", programIndex);
+
CS(program = tsf_region_create(sizeof(Program_t)));

program->globals.len = numDecls + numDefns;

0 comments on commit ae966d5

Please sign in to comment.