Skip to content

Commit

Permalink
checkasm: fix default build on Haiku
Browse files Browse the repository at this point in the history
Haiku atm builds executeables by defaults as shared libraries
and with checkasm_fail_func being a global symbol, but assembly
expecting to call a local symbol building was broken.

Building with -fvisibility=hidden or adding any single one of -pie,
-no-pie and -Bsymbolic to linking flags also worked around this issue.
  • Loading branch information
TheOneric committed May 11, 2024
1 parent e400b53 commit 0a63b95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions checkasm/checkasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ int checkasm_bench_func(void) {

/* Indicate that the current test has failed, return whether verbose printing
* is requested. */
ASM_CALLABLE
int checkasm_fail_func(const char *const msg, ...) {
if (state.current_func_ver && state.current_func_ver->cpu &&
state.current_func_ver->ok)
Expand Down
6 changes: 6 additions & 0 deletions checkasm/checkasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,10 @@ void checkasm_stack_clobber(uint64_t clobber, ...);
line __attribute__((aligned(align)))
#endif

#ifdef _MSC_VER
#define ASM_CALLABLE
#else
#define ASM_CALLABLE __attribute__((visibility("hidden")))
#endif

#endif /* CHECKASM_CHECKASM_H */

0 comments on commit 0a63b95

Please sign in to comment.