diff --git a/Makefile.defs b/Makefile.defs index bf84f88745c..af5fd451fbc 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -254,6 +254,7 @@ ifneq (, $(findstring Sun, $(CC_LONGVER))) sed -e 's/.*\([0-9]\.[0-9]\).*/\1/g' ) CC_VER=$(CC) $(CC_SHORTVER) MKDEP=$(CC) -xM1 + CC_MKDEP_OPTS=-xMMD endif ifneq (, $(findstring Intel(R) C++ Compiler, $(CC_LONGVER))) @@ -1093,9 +1094,12 @@ endif #CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ else #CC_NAME, gcc ifeq ($(CC_NAME), suncc) + C_DEFS+=-DCC_GCC_LIKE_ASM C_DEFS+=-DSPARC64_MODE - CFLAGS+= -m64 -g -xO5 -fast -native -xarch=v9 -xCC \ + CFLAGS+= -m64 -g -xO3 -xtarget=native -xmemalign=8i \ + -fma=fused -fns=yes \ -xc99 # C99 support + LDFLAGS+=-m64 # -Dinline="" # add this if cc < 5.3 (define inline as null) else #other compilers @@ -1159,7 +1163,9 @@ endif #CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ else #CC_NAME, gcc ifeq ($(CC_NAME), suncc) - CFLAGS+= -g -xO5 -fast -native -xCC \ + C_DEFS+=-DCC_GCC_LIKE_ASM + CFLAGS+= -g -xO3 -xtarget=native -xmemalign=4i \ + -fma=fused -fns=yes \ -xc99 # C99 support # -Dinline="" # add this if cc < 5.3 (define inline as null) else @@ -1589,11 +1595,11 @@ ifeq ($(CC_NAME), icc) endif ifeq ($(CC_NAME), suncc) # -dy? - LDFLAGS+=-xO5 $(PROFILE) + LDFLAGS+=-xO3 $(PROFILE) MOD_LDFLAGS:=-G $(LDFLAGS) LIB_LDFLAGS:=-G $(LDFLAGS) - LIB_SONAME="-h " - LD_RPATH=-"-R " + LIB_SONAME=-Wl,-h, + LD_RPATH=-Wl,-R, endif # we need -fPIC -DPIC only for shared objects, we don't need them for # the executable file, because it's always loaded at a fixed address @@ -1650,8 +1656,8 @@ ifeq ($(CC_NAME), suncc) LDFLAGS+=-g $(PROFILE) MOD_LDFLAGS:=-G $(LDFLAGS) LIB_LDFLAGS:=-G $(LDFLAGS) - LIB_SONAME="-h " - LD_RPATH=-"-R " + LIB_SONAME=-Wl,-h, + LD_RPATH=-Wl,-R, endif endif #mode=release @@ -1680,9 +1686,8 @@ MOD_CFLAGS=-Kpic $(CFLAGS) LIB_CFLAGS=-Kpic $(CFLAGS) endif ifeq ($(CC_NAME), suncc) -# FIMXE: use -KPIC instead -xcode ? -MOD_CFLAGS=-xcode=pic32 $(CFLAGS) -LIB_CFLAGS=-xcode=pic32 $(CFLAGS) +MOD_CFLAGS=-xcode=pic32 $(CFLAGS) +LIB_CFLAGS=-xcode=pic32 $(CFLAGS) endif ifeq ($(CC_NAME), clang) MOD_CFLAGS=-fPIC -DPIC $(CFLAGS) @@ -1823,7 +1828,7 @@ ifeq ($(OS), solaris) YACC=yacc ifeq ($(CC_NAME), suncc) - LIBS= -lfast -ldl -lresolv + LIBS= -ldl -lresolv endif OLD_SOLARIS= $(shell echo "$(OSREL)" | \ sed -e 's/^5\.[0-6][^0-9]*$$/yes/' ) diff --git a/action.c b/action.c index 9e9db97e22d..a88751dedfc 100644 --- a/action.c +++ b/action.c @@ -229,7 +229,7 @@ char *get_cfg_crt_name(void) #define MODF_CALL(f_type, h, msg, src, ...) \ do { \ cmd=(src)[0].u.data; \ - ret=((f_type)cmd->function)((msg), __VAR_ARGS__); \ + ret=((f_type)cmd->function)((msg), __VA_ARGS__); \ MODF_HANDLE_RETCODE(h, ret); \ } while (0) #else /* ! __SUNPRO_C (gcc, icc a.s.o) */ @@ -263,7 +263,7 @@ char *get_cfg_crt_name(void) do { \ cmd=(src)[0].u.data; \ MODF_RVE_PARAM_CONVERT(h, msg, cmd, src, dst); \ - ret=((f_type)cmd->function)((msg), __VAR_ARGS__); \ + ret=((f_type)cmd->function)((msg), __VA_ARGS__); \ MODF_HANDLE_RETCODE(h, ret); \ /* free strings allocated by us or fixups */ \ MODF_RVE_PARAM_FREE(cmd, src, dst); \ diff --git a/atomic/atomic_sparc64.h b/atomic/atomic_sparc64.h index dd87994bd50..59273154965 100644 --- a/atomic/atomic_sparc64.h +++ b/atomic/atomic_sparc64.h @@ -37,6 +37,9 @@ #define HAVE_ASM_INLINE_MEMBAR +#ifdef __SUNPRO_C +#pragma error_messages (off,E_ASM_UNUSED_PARAM) +#endif /* try to guess if in SPARC64_MODE */ #if ! defined SPARC64_MODE && \ diff --git a/io_wait.h b/io_wait.h index 0485e39b6d7..33250945cbd 100644 --- a/io_wait.h +++ b/io_wait.h @@ -106,6 +106,10 @@ typedef int fd_type; #define FD_TYPE_DEFINED #endif +#ifdef __SUNPRO_C +#pragma weak handle_io +#endif + /* maps a fd to some other structure; used in almost all cases * except epoll and maybe kqueue or /dev/poll */ struct fd_map{ diff --git a/ip_addr.h b/ip_addr.h index c2b724cab51..f0a53174736 100644 --- a/ip_addr.h +++ b/ip_addr.h @@ -658,7 +658,6 @@ static inline int ip_addr2sbuf(struct ip_addr* ip, char* buff, int len) LM_CRIT("unknown address family %d\n", ip->af); return 0; } - return 0; } diff --git a/modules/counters/counters.c b/modules/counters/counters.c index 7d7f85e3618..d90ead103f8 100644 --- a/modules/counters/counters.c +++ b/modules/counters/counters.c @@ -288,7 +288,8 @@ static void cnt_get_rpc(rpc_t* rpc, void* c) if (rpc->scan(c, "s", &group) < 1) return; if (rpc->scan(c, "*s", &name) < 1) - return cnt_grp_get_all(rpc, c, group); + cnt_grp_get_all(rpc, c, group); + return; /* group & name read */ if (counter_lookup(&h, group, name) < 0) { rpc->fault(c, 400, "non-existent counter %s.%s\n", group, name); @@ -427,7 +428,7 @@ static void cnt_grp_get_all_rpc(rpc_t* rpc, void* c) /* rpc->fault(c, 400, "group name required"); */ return; } - return cnt_grp_get_all(rpc, c, group); + cnt_grp_get_all(rpc, c, group); } diff --git a/modules/ctl/binrpc_run.c b/modules/ctl/binrpc_run.c index 3b9153e59c0..5bdd869cee7 100644 --- a/modules/ctl/binrpc_run.c +++ b/modules/ctl/binrpc_run.c @@ -486,7 +486,7 @@ static void rpc_fault(struct binrpc_ctx* ctx, int code, char* fmt, ...) va_end(ap); len++; /* vnsprintf doesn't include the terminating 0 */ - return _rpc_fault(ctx, code, buf, len); + _rpc_fault(ctx, code, buf, len); } /* Prepare the error reply without sending out the message */ diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index c5c748ea9eb..cb3523dfe3a 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -598,7 +598,7 @@ static void dlg_seq_onreply_helper(struct cell* t, int type, */ static void dlg_seq_up_onreply(struct cell* t, int type, struct tmcb_params *param) { - return dlg_seq_onreply_helper(t, type, param, DLG_DIR_UPSTREAM); + dlg_seq_onreply_helper(t, type, param, DLG_DIR_UPSTREAM); } @@ -611,7 +611,7 @@ static void dlg_seq_up_onreply(struct cell* t, int type, struct tmcb_params *par */ static void dlg_seq_down_onreply(struct cell* t, int type, struct tmcb_params *param) { - return dlg_seq_onreply_helper(t, type, param, DLG_DIR_DOWNSTREAM); + dlg_seq_onreply_helper(t, type, param, DLG_DIR_DOWNSTREAM); } diff --git a/modules/pdb/common.h b/modules/pdb/common.h index 3c7b9939941..1ba16cdf98f 100644 --- a/modules/pdb/common.h +++ b/modules/pdb/common.h @@ -43,20 +43,26 @@ #define PDB_VERSION 1 +#ifdef __SUNPRO_C +#define ENUM_ATTR_PACKED enum +#else +#define ENUM_ATTR_PACKED enum __attribute__((packed)) +#endif + typedef int16_t carrier_t; -enum __attribute__((packed)) pdb_versions { +ENUM_ATTR_PACKED pdb_versions { PDB_VERSION_1 = 1, PDB_VERSION_MAX }; -enum __attribute__((packed)) pdb_types { +ENUM_ATTR_PACKED pdb_types { PDB_TYPE_REQUEST_ID = 0, /* request pdb type */ PDB_TYPE_REPLY_ID, /* reply pdb type */ PDB_TYPE_MAX }; -enum __attribute__((packed)) pdb_codes { +ENUM_ATTR_PACKED pdb_codes { PDB_CODE_DEFAULT = 0, /* for request */ PDB_CODE_OK, /* for response - OK */ PDB_CODE_NOT_NUMBER, /* for response - letters found in the number */ diff --git a/modules/uid_avp_db/Makefile b/modules/uid_avp_db/Makefile index 0b9a74c2252..2b08ae25044 100644 --- a/modules/uid_avp_db/Makefile +++ b/modules/uid_avp_db/Makefile @@ -8,7 +8,6 @@ include ../../Makefile.defs auto_gen= NAME=uid_avp_db.so LIBS= -DEFS += -Wall DEFS+=-DSER_MOD_INTERFACE diff --git a/sr_module.h b/sr_module.h index 6eb42fb6227..e42ccdf1dd3 100644 --- a/sr_module.h +++ b/sr_module.h @@ -208,7 +208,7 @@ struct ser_cmd_export_ { int param_no; /**< number of parameters used by the function */ fixup_function fixup; /**< pointer to the function called to "fix" the parameters */ - int flags; /**< Function flags */ + unsigned int flags; /**< Function flags */ }; @@ -221,7 +221,7 @@ struct kam_cmd_export_ { parameters */ free_fixup_function free_fixup; /**< function called to free the "fixed" parameters */ - int flags; /**< Function flags */ + unsigned int flags; /**< Function flags */ }; /** sip-router version */ @@ -233,8 +233,8 @@ struct sr31_cmd_export_ { parameters */ free_fixup_function free_fixup; /**< function called to free the "fixed" parameters */ - int flags; /**< Function flags */ - int fixup_flags; + unsigned int flags; /**< Function flags */ + unsigned int fixup_flags; void* module_exports; /**< pointer to module structure */ }; diff --git a/tls_hooks.h b/tls_hooks.h index 3ac5bd28348..a789a496f4f 100644 --- a/tls_hooks.h +++ b/tls_hooks.h @@ -84,7 +84,7 @@ extern struct tls_hooks tls_hook; #ifdef __SUNPRO_C #define tls_hook_call(name, ret_not_set, ...) \ ((tls_hook.name)?(tls_hook.name(__VA_ARGS__)): (ret_not_set)) - #define tls_hook_call_v(name, __VA_ARGS__) \ + #define tls_hook_call_v(name, ...) \ do{ \ if (tls_hook.name) tls_hook.name(__VA_ARGS__); \ }while(0)