Skip to content

Commit

Permalink
Build static binaries and add obstack patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia committed Jun 10, 2024
1 parent e9df536 commit 687c7cd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lfi-leg/Knitfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ return b{
$ all:VB: lfi-leg-arm64 lfi-leg-amd64

$ lfi-leg-%: lfi-%.c util.c ht.c op.c main.c
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g -static
$ lfi-leg-amd64: lfi-amd64.c util.c ht.c op.c main.c x64.o
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g -lx64asm -lkeystone -lstdc++ -lm -L../../x64asm/lib
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g -lx64asm -lkeystone -lstdc++ -lm -L../../x64asm/lib -static
$ lfi-leg-amd64-baseline: lfi-amd64-baseline.c util.c ht.c op.c main.c x64.o
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g -lx64asm -lkeystone -lstdc++ -lm -L../../x64asm/lib
cc $input -o $output -I. -D_GNU_SOURCE -O2 -g -lx64asm -lkeystone -lstdc++ -lm -L../../x64asm/lib -static
$ x64.o: x64.cc
cc $input -o $output -I../../x64asm -O2 -g -c
$ %.c: %.leg
Expand Down
2 changes: 1 addition & 1 deletion lfi-leg/lfi-amd64-baseline.leg
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ lfigen()
size = 3;
}
if (size == 0) {
fprintf(stderr, "ERROR: cannot assemble %s\n", op->text);
// fprintf(stderr, "ERROR: cannot assemble %s\n", op->text);
size = 11; // max instruction size
}
curbundle += size;
Expand Down
2 changes: 1 addition & 1 deletion lfi-leg/lfi-amd64.leg
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ lfigen()
size = 3;
}
if (size == 0) {
fprintf(stderr, "ERROR: cannot assemble %s\n", op->text);
// fprintf(stderr, "ERROR: cannot assemble %s\n", op->text);
size = 11; // max instruction size
}
curbundle += size;
Expand Down
21 changes: 21 additions & 0 deletions specinvoke/patches/obstack.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- benchspec/CPU/502.gcc_r/src/include/obstack.h 2024-06-09 22:01:41.624488505 -0700
+++ benchspec/CPU/502.gcc_r/src/include/obstack.h 2024-06-09 22:01:39.892453965 -0700
@@ -533,12 +533,12 @@
/* This should be okay because obstack_free is never used in a context
* where a return value is expected.
*/
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (ptrdiff_t) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0)))
+# define obstack_free(h, obj) \
+ ((h)->temp = (void *) (obj), \
+ (((h)->temp > (void *) (h)->chunk \
+ && (h)->temp < (void *) (h)->chunk_limit) \
+ ? (void) ((h)->next_free = (h)->object_base = (char *) (h)->temp) \
+ : _obstack_free ((h), (h)->temp)))
#else
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \

0 comments on commit 687c7cd

Please sign in to comment.