alpertron/calculators

Compilation issue on OSX High Sierra version 10.13.6 with xcode

oppressionslayer opened this issue · 5 comments

I get the following errors when trying to build from OSX, am i missing any libraries that would be causing this error. Thx.

Nadas-MacBook-Pro:calculators $ make
gcc -D_USING64BITS_ -DFACTORIZATION_APP=1 -c -Os -o from_musl.fco from_musl.c
from_musl.c:14:7: error: expected parameter declarator
void *memcpy(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:62:46: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:14:7: error: expected ')'
/usr/include/secure/_string.h:62:46: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:14:7: note: to match this '('
/usr/include/secure/_string.h:62:46: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:54: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:14:7: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
void *memcpy(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:62:46: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:32: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:14:7: error: conflicting types for '__builtin___memcpy_chk'
/usr/include/secure/_string.h:62:3: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:14:7: note: '__builtin___memcpy_chk' is a builtin with type 'void *(void *, const void *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:62:3: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:14:7: error: definition of builtin function '__builtin___memcpy_chk'
void *memcpy(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:62:3: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:129:7: error: expected parameter declarator
void *memmove(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:129:7: error: expected ')'
/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:129:7: note: to match this '('
/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:54: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:129:7: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
void *memmove(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:32: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:129:7: error: conflicting types for '__builtin___memmove_chk'
/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:129:7: note: '__builtin___memmove_chk' is a builtin with type 'void *(void *, const void *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:129:7: error: definition of builtin function '__builtin___memmove_chk'
void *memmove(void *dest, const void *src, size_t n)
^
/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
__builtin___memmove_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:135:35: error: too many arguments to function call, expected 1, have 2
if (s+n <= d || d+n <= s) return memcpy(d, s, n);
^~~~~~~~~~~~~~~
/usr/include/secure/_string.h:62:46: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^~~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
~~~~~~~~~~~~~~~~~~~~~ ^
from_musl.c:160:7: error: expected parameter declarator
void *memset(void *dest, int c, size_t n)
^
/usr/include/secure/_string.h:76:46: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:160:7: error: expected ')'
/usr/include/secure/_string.h:76:46: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:160:7: note: to match this '('
/usr/include/secure/_string.h:76:46: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:54: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:160:7: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
void *memset(void *dest, int c, size_t n)
^
/usr/include/secure/_string.h:76:46: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
/usr/include/secure/_common.h:38:32: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
^
from_musl.c:160:7: error: conflicting types for '__builtin___memset_chk'
/usr/include/secure/_string.h:76:3: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:160:7: note: '__builtin___memset_chk' is a builtin with type 'void *(void *, int, unsigned long, unsigned long)'
/usr/include/secure/_string.h:76:3: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:160:7: error: definition of builtin function '__builtin___memset_chk'
void *memset(void *dest, int c, size_t n)
^
/usr/include/secure/_string.h:76:3: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^
from_musl.c:238:7: error: expected parameter declarator
char *strcpy(char *dest, const char *src)
^
/usr/include/secure/_string.h:83:46: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'

define _USE_FORTIFY_LEVEL 2

                           ^

from_musl.c:238:7: error: expected ')'
/usr/include/secure/_string.h:83:46: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'

define _USE_FORTIFY_LEVEL 2

                           ^

from_musl.c:238:7: note: to match this '('
/usr/include/secure/_string.h:83:46: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
from_musl.c:238:7: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
char *strcpy(char *dest, const char *src)
^
/usr/include/secure/_string.h:83:46: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
from_musl.c:238:7: error: conflicting types for '__builtin___strcpy_chk'
/usr/include/secure/_string.h:83:3: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
from_musl.c:238:7: note: '__builtin___strcpy_chk' is a builtin with type 'char *(char *, const char *, unsigned long)'
/usr/include/secure/_string.h:83:3: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
from_musl.c:238:7: error: definition of builtin function '__builtin___strcpy_chk'
char *strcpy(char *dest, const char *src)
^
/usr/include/secure/_string.h:83:3: note: expanded from macro 'strcpy'
__builtin___strcpy_chk (dest, VA_ARGS, __darwin_obsz (dest))
^
4 warnings and 17 errors generated.
make: *** [from_musl.fco] Error 1

It appears that the compiler you are using defines the standard functions memcpy, strcpy, etc. as macros. That is not standard.

You can try compiling by commenting out the definition of the offending functions in the file from_musl.c

But notice that I need these functions because there is no standard library on WebAssembly, which is the target of the compilation.

Ok, i removed the offending functions and i got this to compile and work with the target only being ecm. I'm only using ecm in my app, and it's working. I'm doing some more testing and will provide more feedback tomorrow, but so far so good with target just bieng ECM and commenting out the offending functions you mentioned

Everything is working ok, with your suggestions for what i was working on with a target of ecm. Thank you for your help, i no longer have an issue with your suggested changes.

Your suggested changes worked for what i was working on which was compiling and using only ecm. Closing issue and thank you very much.

You are welcome.