aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakayuki Matsuoka <t-mat@users.noreply.github.com>2022-08-07 19:43:54 +0900
committerTakayuki Matsuoka <t-mat@users.noreply.github.com>2022-08-07 19:43:54 +0900
commit431a793b243360bd962e8f6f02884606693b34d9 (patch)
tree4bde6da3d69498ae648ae1af532b7e7172393968
parentcdf515c90ff32f681be3ee97e5889f8cdd9ed143 (diff)
downloadlz4-431a793b243360bd962e8f6f02884606693b34d9.tar.gz
Fix: implement empty _start and main for non-Linux or x86-64 platforms
-rw-r--r--tests/freestanding.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/freestanding.c b/tests/freestanding.c
index 6bf2e6d1..ceff4c5a 100644
--- a/tests/freestanding.c
+++ b/tests/freestanding.c
@@ -19,10 +19,6 @@
// $ ltrace ./a.out
// +++ exited (status 0) +++
-#if !defined(__x86_64__) || !defined(__linux__)
-# error This test only supports Linux __x86_64__
-#endif
-
#include <stddef.h>
#include <stdint.h>
@@ -33,6 +29,11 @@
#endif
+#if !defined(__x86_64__) || !defined(__linux__)
+EXTERN_C void _start(void) { }
+int main(int argc, char** argv) { return 0; }
+#else
+
static void MY_exit(int exitCode);
static void MY_abort(void);
EXTERN_C void *memmove(void *dst, const void *src, size_t n);
@@ -235,3 +236,4 @@ int main(int argc, char** argv) {
MY_exit(0);
return 0;
}
+#endif