Skip to content

Commit 0a63b95

Browse files
committed
checkasm: fix default build on Haiku
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.
1 parent e400b53 commit 0a63b95

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

checkasm/checkasm.c

+1
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ int checkasm_bench_func(void) {
736736

737737
/* Indicate that the current test has failed, return whether verbose printing
738738
* is requested. */
739+
ASM_CALLABLE
739740
int checkasm_fail_func(const char *const msg, ...) {
740741
if (state.current_func_ver && state.current_func_ver->cpu &&
741742
state.current_func_ver->ok)

checkasm/checkasm.h

+6
Original file line numberDiff line numberDiff line change
@@ -335,4 +335,10 @@ void checkasm_stack_clobber(uint64_t clobber, ...);
335335
line __attribute__((aligned(align)))
336336
#endif
337337

338+
#ifdef _MSC_VER
339+
#define ASM_CALLABLE
340+
#else
341+
#define ASM_CALLABLE __attribute__((visibility("hidden")))
342+
#endif
343+
338344
#endif /* CHECKASM_CHECKASM_H */

0 commit comments

Comments
 (0)