1 (edited by FHDNS 2015-09-17 07:14:51)

Topic: Build error with last clang "bad math long / long long settings"

I've updated Xcode to Version 7.0 (7A220)

$clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

And now, I can't build cyassl:

In file included from ./cyassl/internal.h:27:
./cyassl/ctaocrypt/types.h:276:6: error: "bad math long / long long settings"
    #error "bad math long / long long settings"
     ^
./cyassl/ctaocrypt/types.h:278:1: error: use of empty enum
};
^
In file included from src/io.c:33:
In file included from ./cyassl/internal.h:27:
./cyassl/ctaocrypt/types.h:276:6: error: "bad math long / long long settings"
    #error "bad math long / long long settings"
     ^
./cyassl/ctaocrypt/types.h:278:1: error: use of empty enum
};
^
In file included from src/keys.c:29:
In file included from ./cyassl/internal.h:27:
./cyassl/ctaocrypt/types.h:276:6: error: "bad math long / long long settings"
    #error "bad math long / long long settings"
     ^
./cyassl/ctaocrypt/types.h:278:1: error: use of empty enum
};
^
clang: warning: argument unused during compilation: '-pthreads'
2 errors generated.
In file included from src/ssl.c:34:
In file included from ./cyassl/internal.h:27:
./cyassl/ctaocrypt/types.h:276:6: error: "bad math long / long long settings"
    #error "bad math long / long long settings"
     ^
./cyassl/ctaocrypt/types.h:278:1: error: use of empty enum
};
^
2 errors generated.
In file included from src/tls.c:29:
In file included from ./cyassl/internal.h:27:
./cyassl/ctaocrypt/types.h:276:6: error: "bad math long / long long settings"
    #error "bad math long / long long settings"
     ^
./cyassl/ctaocrypt/types.h:278:1: error: use of empty enum
};
^
make[1]: *** [src/src_libcyassl_la-keys.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [src/src_libcyassl_la-io.lo] Error 1
2 errors generated.
2 errors generated.
make[1]: *** [src/src_libcyassl_la-tls.lo] Error 1
make[1]: *** [src/src_libcyassl_la-internal.lo] Error 1
2 errors generated.
make[1]: *** [src/src_libcyassl_la-ssl.lo] Error 1
make: *** [install] Error 2

command which I use:

./configure --enable-shared=no --prefix=$(dirname $(pwd)) CC=clang CFLAGS=-DSIZEOF_LONG_LONG=8 CXX=clang++ CXXFLAGS='-stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++'

The same problem with last version wolfSSL from site.
I tried to use "CFLAGS=-DSIZEOF_LONG_LONG=8" for building cyassl, but it does not fix the problem

Share

Re: Build error with last clang "bad math long / long long settings"

Hi FHDNS,

Since upgrading xcode have you run:  xcode-select --install

Failing to do so often causes issues with mac command line linking and autoconf.

As a side note:
Unfortunately we over-write CFLAGS in our configure script. Instead use C_EXTRA_FLAGS="-DSOMETHING -DWHATEVER" etc and LD_FLAGS=" ..." etc.

Regards,

Kaleb

Re: Build error with last clang "bad math long / long long settings"

If I set ./configure ... CF_EXTRA_FLAGS=-DSIZEOF_LONG_LONG=8,
compiler generates warning:
"SIZEOF_LONG_LONG from command line is overridden in config.h: #define SIZEOF_LONG_LONG=0"

If I set #define SIZEOF_LONG_LONG=8 in config.h, some script rewrite my config.h (config.h is autogenerated as I understood)

How to build with configure and cyassl 2.7.0?

Share

Re: Build error with last clang "bad math long / long long settings"

Hi,

It sounds like XCode is detecting the sizeof(long long) as 0, which seems incorrect.

If you write a simple app that prints out the sizeof(long long), do you get 0 as well?

Best Regards,
Chris