Skip to content

Commit

Permalink
Enable fuzz to run on aarch64 platform (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat authored May 7, 2024
1 parent 913b89d commit 6473dc0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion fuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ add_definitions("-DIO_SEPROXYHAL_BUFFER_SIZE_B=128") # cmake -DIO_SEPROXYHAL_BUF
add_definitions("-DTARGET_NANOS=1")

add_library(bsd STATIC IMPORTED)
set_property(TARGET bsd PROPERTY IMPORTED_LOCATION /lib/x86_64-linux-gnu/libbsd.a)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set_property(TARGET bsd PROPERTY IMPORTED_LOCATION /lib/x86_64-linux-gnu/libbsd.a)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set_property(TARGET bsd PROPERTY IMPORTED_LOCATION /lib/aarch64-linux-gnu/libbsd.a)
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

include_directories(../libstellar/include)
include_directories(${BOLOS_SDK}/lib_standard_app)
Expand Down
2 changes: 1 addition & 1 deletion libstellar/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#include <stdint.h>
#include <stdbool.h>

bool base64_encode(const uint8_t *data, size_t in_len, char *out, size_t out_len);
bool base64_encode(const uint8_t *data, size_t in_len, char *out, size_t out_len);
4 changes: 2 additions & 2 deletions libstellar/formatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,7 @@ static uint8_t get_data_count(formatter_data_t *fdata) {
return op_cnt + 1;
}

void reset_formatter() {
void reset_formatter(void) {
explicit_bzero(formatter_stack, sizeof(formatter_stack));
formatter_index = 0;
current_data_index = 0;
Expand Down Expand Up @@ -2563,4 +2563,4 @@ bool get_next_data(formatter_data_t *fdata, bool forward, bool *data_exists, boo
}

return true;
}
}
2 changes: 1 addition & 1 deletion libstellar/include/stellar/formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
/**
* Reset the formatter state.
*/
void reset_formatter();
void reset_formatter(void);

/**
* Get the next data to display.
Expand Down
2 changes: 1 addition & 1 deletion libstellar/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,4 +1513,4 @@ bool parse_soroban_authorization_envelope(const uint8_t *data,
// envelope->soroban_authorization.sub_invocation_positions[i]);
// }
return true;
}
}
2 changes: 1 addition & 1 deletion libstellar/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,4 @@ bool print_scv_string(const scv_string_t *scv_string, char *out, size_t out_len)
}

return true;
}
}

0 comments on commit 6473dc0

Please sign in to comment.