Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reported build issues with mac os 10.12.6 #338

Open
rofl0r opened this issue Jan 5, 2018 · 4 comments
Open

reported build issues with mac os 10.12.6 #338

rofl0r opened this issue Jan 5, 2018 · 4 comments
Labels

Comments

@rofl0r
Copy link

rofl0r commented Jan 5, 2018

pixiewps user @DJDan reported the following issues:

n file included from src/crypto/tc/tomcrypt.h:82:
src/crypto/tc/tomcrypt_cfg.h:203:31: warning: redefinition of typedef 'ulong64' is a C11 feature
      [-Wtypedef-redefinition]
   typedef unsigned long long ulong64;
                              ^
src/crypto/tfm/tfm.h:276:31: note: previous definition is here
   typedef unsigned long long ulong64;
                              ^

seems both tomsfastmath and libtomcrypt typedef ulong64, which is not quite conforming. maybe it'd be a good idea to add a #define ULONG64_DEFINED and only do the typedef if it wasnt defined already.

In file included from src/crypto/tc/tomcrypt_argchk.h:14:
/usr/include/signal.h:69:42: error: use of undeclared identifier 'NSIG'
extern __const char *__const sys_signame[NSIG];
                                         ^
/usr/include/signal.h:70:42: error: use of undeclared identifier 'NSIG'
extern __const char *__const sys_siglist[NSIG];
                                         ^

i just added tomcrypt this week, so we're using the latest bleeding edge sources of both tfm and tc.

@sjaeckel
Copy link
Member

sjaeckel commented Jan 9, 2018

seems both tomsfastmath and libtomcrypt typedef ulong64, which is not quite conforming. maybe it'd be a good idea to add a #define ULONG64_DEFINED and only do the typedef if it wasnt defined alrea

well I guess that's caused by an incomplete rip-apart of ltc
normally either you use tfm and include tfm.h OR ltc+tfm and include tomcrypt.h which includes tfm.h which has the typedef protected by #ifndef CRYPT

regarding the signal.h error... that smells like an error in the toolchain to me... CMIIW

@rofl0r
Copy link
Author

rofl0r commented Jan 9, 2018

normally either you use tfm and include tfm.h OR ltc+tfm and include tomcrypt.h which includes tfm.h which has the typedef protected by #ifndef CRYPT

i see

regarding the signal.h error... that smells like an error in the toolchain to me... CMIIW

from what i've heard you would need to define #define _DARWIN_C_SOURCE to get NSIG for some reason, but as i do not have access to a mac, i can't tell for sure.

@sjaeckel
Copy link
Member

... but as i do not have access to a mac, i can't tell for sure

...neither do I.

@wiire-a you gave a 👍 to the issue, can you please elaborate on what we can/should do?

@wiire-a
Copy link

wiire-a commented Jan 22, 2018

The issue was reported to me by @rofl0r after he integrated tomcrypt e tomsfastmath. It was a quick job so we probably missed the correct way of doing things.

Later I just pushed some quick changes to fix all the issues / warnings:

  • We didn't need the LTC_ARGCHK macro:

wiire-a/pixiewps@65dd997

  • ulong64 redefinition as suggest by @rofl0r (we missed the #ifndef CRYPT logic):

wiire-a/pixiewps@61e73e5
wiire-a/pixiewps@c14f122

Other minor issues (tomsfastmath):

  • Unused variable yy warning:

wiire-a/pixiewps@d6de90f

  • Compilation with TCC due to missing some asm definitions (@rofl0r) ?:

https://github.com/wiire-a/pixiewps/blob/master/src/crypto/tfm/tfm.h#L19

The NSIG issue might be due to the fact that we define _POSIX_C_SOURCE ?

From Apple's signal.h:

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define NSIG	__DARWIN_NSIG
#endif

But I don't have a Mac either and I never used tomcrypt and tomsfastmath before so I'm not sure what the best strategy is in that regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants