2012.10 fails to build on powerpc because of dyncall #62

Closed
ghedo opened this Issue Oct 22, 2012 · 1 comment

2 participants

@ghedo

I currently get this when building nqp 2012.10 on powerpc:

make -C dyncallback 
make[4]: Entering directory `/build/buildd-nqp_2012.10-1-powerpc-u2Xzm4/nqp-2012.10/3rdparty/dyncall/dyncallback'
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  -DHASATTRIBUTE_HOT  -DHASATTRIBUTE_COLD  -DHAS_GETTEXT -fPIC -g -falign-functions=16 -funit-at-a-time -fexcess-precision=standard -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wdiv-by-zero -Wenum-compare -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wjump-misses-init -Wlogical-op -Werror=missing-braces -Wmissing-declarations -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wparentheses -Wpointer-arith -Wpointer-sign -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Werror=undef -Wno-unused -Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -Wc++-compat -Werror=declaration-after-statement -Werror=implicit-function-declaration -Wmissing-prototypes -Werror=nested-externs -Werror=old-style-definition -Werror=strict-prototypes -fvisibility=hidden   -Wno-strict-prototypes -O3 -O3 -D_FORTIFY_SOURCE=2 -I../dyncall  -c dyncall_thunk.c -o dyncall_thunk.o
In file included from dyncall_thunk.c:35:0:
dyncall_thunk_ppc32.c:28:16: warning: no previous prototype for 'hi16' [-Wmissing-prototypes]
dyncall_thunk_ppc32.c: In function 'hi16':
dyncall_thunk_ppc32.c:28:16: error: old-style function definition [-Werror=old-style-definition]
dyncall_thunk_ppc32.c:28:16: warning: type of 'x' defaults to 'int' [-Wmissing-parameter-type]
dyncall_thunk_ppc32.c: At top level:
dyncall_thunk_ppc32.c:29:16: warning: no previous prototype for 'lo16' [-Wmissing-prototypes]
dyncall_thunk_ppc32.c: In function 'lo16':
dyncall_thunk_ppc32.c:29:16: error: old-style function definition [-Werror=old-style-definition]
dyncall_thunk_ppc32.c:29:16: warning: type of 'x' defaults to 'int' [-Wmissing-parameter-type]
cc1: some warnings being treated as errors
make[4]: *** [dyncall_thunk.o] Error 1
make[4]: Leaving directory `/build/buildd-nqp_2012.10-1-powerpc-u2Xzm4/nqp-2012.10/3rdparty/dyncall/dyncallback'
make[3]: *** [dyncallback] Error 2
make[3]: Leaving directory `/build/buildd-nqp_2012.10-1-powerpc-u2Xzm4/nqp-2012.10/3rdparty/dyncall'
make[2]: *** [3rdparty/dyncall/dyncall/libdyncall_s.a] Error 2
make[2]: Leaving directory `/build/buildd-nqp_2012.10-1-powerpc-u2Xzm4/nqp-2012.10'

I'm not sure where the -Werror=old-style-definition comes from, but removing it should fix the build.

@stefanor

Or, just give it some types:

--- a/3rdparty/dyncall/dyncallback/dyncall_thunk_ppc32.c
+++ b/3rdparty/dyncall/dyncallback/dyncall_thunk_ppc32.c
@@ -25,8 +25,8 @@

 #include "dyncall_thunk.h"

-unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
-unsigned short lo16(x) { return ( (unsigned short)  ((unsigned int)x)        ); }   
+unsigned short hi16(DCThunk* x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
+unsigned short lo16(DCThunk* x) { return ( (unsigned short)  ((unsigned int)x)        ); }   

 void dcbInitThunk(DCThunk* p, void (*entry)())
 {
@moritz moritz closed this in e3a67e4 May 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment