reported build issues with mac os 10.12.6 #338

Open
opened 2018-01-05 14:05:54 -06:00 by rofl0r · 5 comments
rofl0r commented 2018-01-05 14:05:54 -06:00 (Migrated from github.com)

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.

[pixiewps](https://github.com/wiire-a/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 commented 2018-01-09 10:11:27 -06:00 (Migrated from github.com)

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

> 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 commented 2018-01-09 10:23:50 -06:00 (Migrated from github.com)

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.

> 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 commented 2018-01-22 04:42:36 -06:00 (Migrated from github.com)

... 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?

> ... but as i do not have access to a mac, i can't tell for sure ...neither do I. @wiire-a you gave a :+1: to the issue, can you please elaborate on what we can/should do?
wiire-a commented 2018-01-22 11:12:25 -06:00 (Migrated from github.com)

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:

github.com/wiire-a/pixiewps@65dd9975da

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

github.com/wiire-a/pixiewps@61e73e5703
github.com/wiire-a/pixiewps@c14f1227af

Other minor issues (tomsfastmath):

  • Unused variable yy warning:

github.com/wiire-a/pixiewps@d6de90fb18

  • 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.

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: https://github.com/wiire-a/pixiewps/commit/65dd9975da8c22d14e495183af5ee35425b213a2 - `ulong64` redefinition as suggest by @rofl0r (we missed the `#ifndef CRYPT` logic): https://github.com/wiire-a/pixiewps/commit/61e73e570312370ed8ca43c3b32cf89fa54e19ab https://github.com/wiire-a/pixiewps/commit/c14f1227af347fbdd2f190f83e4a26a1abf0abed Other minor issues (tomsfastmath): - Unused variable `yy` warning: https://github.com/wiire-a/pixiewps/commit/d6de90fb181b8b8d0c6760d15be6835ead035e5b - 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`: ```C #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.
NickBrighten commented 2026-08-07 14:58:13 -05:00 (Migrated from github.com)

If your looking for an .framework or .xcframework than your can use this https://github.com/NickBrighten/NBSCrypto - if you looking for a .lib than not...

If your looking for an .framework or .xcframework than your can use this https://github.com/NickBrighten/NBSCrypto - if you looking for a .lib than not...
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#338
No description provided.