Skip to content

Commit

Permalink
Report CPU architecture in test app.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 18, 2009
1 parent bb6416c commit 4373054
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion test/hello-lib.c
@@ -1,3 +1,22 @@
#include <stdio.h>
int hello(void) { printf("hello from a shared library!\n"); return 0; }

#if defined(__i386__)
#define cpu "x86"
#elif defined(__x86_64__)
#define cpu "x86-64"
#elif defined(__powerpc64__)
#define cpu "powerpc64"
#elif defined(__powerpc__)
#define cpu "powerpc"
#else
#error Please add your CPU architecture here.
#endif

int hello(void)
{
printf("hello from a shared library! This binary's arch is: %s!\n", cpu);
return 0;
}

/* end of hello-lib.c ... */

2 changes: 1 addition & 1 deletion test/test.sh
Expand Up @@ -21,7 +21,7 @@ mv hello.so hello-amd64.so

./fatelf-glue hello hello-x86 hello-amd64
./fatelf-glue hello.so hello-amd64.so hello-x86.so
./fatelf-glue hello-dlopen hello-dlopen-amd64 hello-dlopen-x86
./fatelf-glue hello-dlopen hello-dlopen-x86 hello-dlopen-amd64

file ./hello
./fatelf-info ./hello
Expand Down

0 comments on commit 4373054

Please sign in to comment.