Skip to content

Commit

Permalink
Portability fixes to build on Musl libc as well as glibc
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
  • Loading branch information
justincormack committed Dec 25, 2015
1 parent adbb255 commit e09f698
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion gcc-preinclude.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
// See: http://www.win.tue.nl/~aeb/linux/misc/gcc-semibug.html // See: http://www.win.tue.nl/~aeb/linux/misc/gcc-semibug.html
// https://rjpower9000.wordpress.com/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/ // https://rjpower9000.wordpress.com/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/


#define _GNU_SOURCE 1

#include <features.h>

#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
#ifdef __GLIBC__
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); __asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
#endif #endif

#endif
1 change: 1 addition & 0 deletions src/apps/solarflare/ef_vi.h
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <time.h>


/* etherfabric/base.h */ /* etherfabric/base.h */


Expand Down
1 change: 1 addition & 0 deletions src/apps/vhost/vhost_user.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/unistd.h> #include <unistd.h>


/* Return the current wall-clock time in nanoseconds. */ /* Return the current wall-clock time in nanoseconds. */
uint64_t get_time_ns() uint64_t get_time_ns()
Expand Down
2 changes: 1 addition & 1 deletion src/core/memory.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// virtual addresses (remove the tag bits) and to test addresses for // virtual addresses (remove the tag bits) and to test addresses for
// validity (check the tag bits). // validity (check the tag bits).


#define _GNU_SOURCE #define _GNU_SOURCE 1


#include <assert.h> #include <assert.h>
#include <fcntl.h> #include <fcntl.h>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/traceprof/traceprof.c
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,9 @@
// Location where the next instruction pointer value will be stored. // Location where the next instruction pointer value will be stored.


#define _GNU_SOURCE 1

#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#define __USE_GNU
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>
Expand Down

0 comments on commit e09f698

Please sign in to comment.