Skip to content

Commit

Permalink
core: fix Sun Studio build
Browse files Browse the repository at this point in the history
- update Makefile.defs for recent versions of Solaris Studio
  • Loading branch information
sjthomason committed Jul 1, 2016
1 parent 750f983 commit 2a3915d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
27 changes: 16 additions & 11 deletions Makefile.defs
Expand Up @@ -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)))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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/' )
Expand Down
4 changes: 2 additions & 2 deletions action.c
Expand Up @@ -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) */
Expand Down Expand Up @@ -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); \
Expand Down
3 changes: 3 additions & 0 deletions atomic/atomic_sparc64.h
Expand Up @@ -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 && \
Expand Down
4 changes: 4 additions & 0 deletions io_wait.h
Expand Up @@ -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{
Expand Down
1 change: 0 additions & 1 deletion ip_addr.h
Expand Up @@ -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;
}


Expand Down
8 changes: 4 additions & 4 deletions sr_module.h
Expand Up @@ -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 */
};


Expand All @@ -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 */
Expand All @@ -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 */
};

Expand Down
2 changes: 1 addition & 1 deletion tls_hooks.h
Expand Up @@ -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)
Expand Down

0 comments on commit 2a3915d

Please sign in to comment.