Fix lib.h falling back to TARGET_LINUX during wasm_module and c module compilation

This commit is contained in:
2026-07-26 13:31:13 +02:00
parent 822b59d70e
commit 9baf6605ed
18 changed files with 62 additions and 36 deletions
+6 -6
View File
@@ -27,7 +27,7 @@ static enc_t sum_out[REPLICA_COUNT];
static INLINE enc_t apply(enc_t vc, sign_t bdyn) {
if (bdyn > SIG_MAX) {
HOST_PRINT("signature overflow.\n");
PRINT("signature overflow.\n");
fail_marker_detected();
}
return vc + bdyn;
@@ -49,7 +49,7 @@ static sign_t cored_vote(void) {
cored_res = apply(XC, (XC - ZC));
return SIG_s_XZ;
} else {
HOST_PRINT("all replicas differ.\n");
PRINT("all replicas differ.\n");
fail_marker_detected();
return 0;
}
@@ -93,7 +93,7 @@ extern "C" EXPORT("wasm_module") int wasm_module(void) {
vote_result_sig = SIG_Y;
break;
default:
HOST_PRINT("unknown static_sig.\n");
PRINT("unknown static_sig.\n");
break;
}
@@ -102,18 +102,18 @@ extern "C" EXPORT("wasm_module") int wasm_module(void) {
/* Validate Vote result */
if (!check(cored_res, THE_A, vote_result_sig)) {
HOST_PRINT("voted result invalid.\n");
PRINT("voted result invalid.\n");
fail_marker_detected();
return 2;
}
plain_t res = decode(cored_res, THE_A, vote_result_sig);
if (res == 5) {
HOST_PRINT("cored success.\n");
PRINT("cored success.\n");
fail_marker_positive();
return 0;
} else {
HOST_PRINT("undetected error.\n");
PRINT("undetected error.\n");
fail_marker_negative();
return 1;
}