Skip to content

Commit

Permalink
Disable FUSE_SYMVER macros on MacOSX
Browse files Browse the repository at this point in the history
MachO format does not support symbol versions.
Instead of putting __APPLE__ around FUSE_SYMVER just disable the macros itself,
this reduces code delta with upstream libfuse.
  • Loading branch information
anatol committed Dec 7, 2011
1 parent 5d11aff commit dbf7d7e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 25 deletions.
6 changes: 0 additions & 6 deletions lib/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3906,9 +3906,7 @@ struct fuse_context *fuse_get_context_compat22(void)
{
return &fuse_get_context_internal()->ctx;
}
#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_get_context_compat22,fuse_get_context@FUSE_2.2");
#endif

int fuse_getgroups(int size, gid_t list[])
{
Expand Down Expand Up @@ -4393,14 +4391,12 @@ struct fuse *fuse_new_compat1(int fd, int flags,
11);
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@");
FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@");
FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
#endif

#endif /* !__FreeBSD__ && !__APPLE__ */

Expand All @@ -4412,6 +4408,4 @@ struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
op_size, 25);
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_new_compat25,fuse_new@FUSE_2.5");
#endif
6 changes: 0 additions & 6 deletions lib/fuse_lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,9 +1508,7 @@ const struct fuse_ctx *fuse_req_ctx_compat24(fuse_req_t req)
{
return fuse_req_ctx(req);
}
#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_req_ctx_compat24,fuse_req_ctx@FUSE_2.4");
#endif


void fuse_req_interrupt_func(fuse_req_t req, fuse_interrupt_func_t func,
Expand Down Expand Up @@ -1985,11 +1983,9 @@ int fuse_sync_compat_args(struct fuse_args *args)
return 0;
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_reply_statfs_compat,fuse_reply_statfs@FUSE_2.4");
FUSE_SYMVER(".symver fuse_reply_open_compat,fuse_reply_open@FUSE_2.4");
FUSE_SYMVER(".symver fuse_lowlevel_new_compat,fuse_lowlevel_new@FUSE_2.4");
#endif

#else /* !__FreeBSD__ && !__APPLE_ */

Expand All @@ -2013,6 +2009,4 @@ struct fuse_session *fuse_lowlevel_new_compat25(struct fuse_args *args,
op_size, userdata);
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_lowlevel_new_compat25,fuse_lowlevel_new@FUSE_2.5");
#endif
12 changes: 8 additions & 4 deletions lib/fuse_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
#include "config.h"
#include <pthread.h>

/* Versioned symbols confuse the dynamic linker in uClibc */
#ifndef __UCLIBC__
#define FUSE_SYMVER(x) __asm__(x)
#else
/*
Versioned symbols
- confuse the dynamic linker in uClibc
- not supported on MacOSX (in MachO binary format)
*/
#if (__UCLIBC__ || __APPLE__)
#define FUSE_SYMVER(x)
#else
#define FUSE_SYMVER(x) __asm__(x)
#endif

#ifndef USE_UCLIBC
Expand Down
2 changes: 0 additions & 2 deletions lib/fuse_mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,4 @@ int fuse_loop_mt(struct fuse *f)
return fuse_session_loop_mt(fuse_get_session(f));
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_loop_mt_proc,__fuse_loop_mt@");
#endif
2 changes: 0 additions & 2 deletions lib/fuse_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,5 @@ int fuse_opt_parse(struct fuse_args *args, void *data,
return res;
}

#ifndef __APPLE__
/* This symbol version was mistakenly added to the version script */
FUSE_SYMVER(".symver fuse_opt_insert_arg_compat,fuse_opt_insert_arg@FUSE_2.5");
#endif
2 changes: 1 addition & 1 deletion lib/fuse_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ void fuse_chan_destroy(struct fuse_chan *ch)
free(ch);
}

#if ( !__FreeBSD__ && !__APPLE__ )
#ifndef __FreeBSD__
FUSE_SYMVER(".symver fuse_chan_new_compat24,fuse_chan_new@FUSE_2.4");
#endif
4 changes: 0 additions & 4 deletions lib/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,11 @@ int fuse_mount_compat1(const char *mountpoint, const char *args[])
return fuse_mount_compat22(mountpoint, NULL);
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@");
FUSE_SYMVER(".symver fuse_setup_compat22,fuse_setup@FUSE_2.2");
FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
#endif

#endif /* !__FreeBSD__ && !__APPLE__ */

Expand Down Expand Up @@ -502,9 +500,7 @@ int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args)
return fuse_kern_mount(mountpoint, args);
}

#ifndef __APPLE__
FUSE_SYMVER(".symver fuse_setup_compat25,fuse_setup@FUSE_2.5");
FUSE_SYMVER(".symver fuse_teardown_compat22,fuse_teardown@FUSE_2.2");
FUSE_SYMVER(".symver fuse_main_real_compat25,fuse_main_real@FUSE_2.5");
FUSE_SYMVER(".symver fuse_mount_compat25,fuse_mount@FUSE_2.5");
# endif

0 comments on commit dbf7d7e

Please sign in to comment.