[GH-ISSUE #1874] clang build for Raspberry Pi 2 fails #1245

Closed
opened 2026-10-14 03:40:57 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @frank-dittrich on GitHub (Nov 1, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1874

Originally assigned to: @jfoug on GitHub.

A regular autoconf build works, with and without openmp. But using clang instead of gcc doesn't.

$ clang --version
Raspbian clang version 3.5.0-10+rpi1 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: arm-unknown-linux-gnueabihf
Thread model: posix
$ clang -dumpversion
4.2.1
$ uname -a
Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
clang -DAC_BUILT -march=native  -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1   -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -std=gnu89 -Wdate-time -D_POSIX_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE      -pthread  -I/usr/local/include -funroll-loops MD5_fmt.c -o MD5_fmt.o
MD5_fmt.c:389:10: error: expected '}'
                "MD5 " MD5_ALGORITHM_NAME,
                       ^
./simd-intrinsics.h:79:29: note: expanded from macro 'MD5_ALGORITHM_NAME'
#define MD5_ALGORITHM_NAME              BITS " " SIMD_TYPE " " MD5_N_STR
                                        ^
MD5_fmt.c:386:2: note: to match this '{'
        {
        ^
1 error generated.
Makefile:1534: recipe for target 'MD5_fmt.o' failed
make[1]: *** [MD5_fmt.o] Error 1
make[1]: Leaving directory '/usb/home/fd/git/JtR/src'
Makefile:187: recipe for target 'default' failed
make: *** [default] Error 2

If I try to compile that that single file with gcc, I get the same error:

 $ gcc  -DAC_BUILT -march=native  -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1   -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -std=gnu89 -Wdate-time -D_POSIX_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE      -pthread  -I/usr/local/include -funroll-loops MD5_fmt.c -o MD5_fmt.o
In file included from MD5_fmt.c:17:0:
simd-intrinsics.h:79:29: error: expected ‘}’ before ‘BITS’
 #define MD5_ALGORITHM_NAME  BITS " " SIMD_TYPE " " MD5_N_STR
                             ^
MD5_fmt.c:389:10: note: in expansion of macro ‘MD5_ALGORITHM_NAME’
   "MD5 " MD5_ALGORITHM_NAME,
          ^
MD5_fmt.c:52:25: warning: ‘tests’ defined but not used [-Wunused-variable]
 static struct fmt_tests tests[] = {
                         ^

To see what else fails, I just touched MD5_fmt.o and continued.

$ touch MD5_fmt.o; make -s
dynamic_fmt.c:4837:8: error: use of undeclared identifier 'input_buf'
                        p = input_buf[i+j].w;
                            ^
dynamic_fmt.c:4838:20: error: use of undeclared identifier 'SIMD_COEF_32'
                        for (k = 0; k < SIMD_COEF_32; k++)
                                        ^
dynamic_fmt.c:4839:10: error: use of undeclared identifier 'SIMD_COEF_32'
                                p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3;
                                     ^
dynamic_fmt.c:4839:28: error: use of undeclared identifier 'total_len'
                                p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3;
                                                       ^
dynamic_fmt.c:4846:8: error: use of undeclared identifier 'input_buf2'
                        p = input_buf2[i+j].w;
                            ^
dynamic_fmt.c:4847:20: error: use of undeclared identifier 'SIMD_COEF_32'
                        for (k = 0; k < SIMD_COEF_32; k++)
                                        ^
dynamic_fmt.c:4848:10: error: use of undeclared identifier 'SIMD_COEF_32'
                                p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3;
                                     ^
dynamic_fmt.c:4848:28: error: use of undeclared identifier 'total_len2'
                                p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3;
                                                       ^
dynamic_fmt.c:4862:8: error: use of undeclared identifier 'input_buf'
                        p = input_buf[i+j].w;
                            ^
dynamic_fmt.c:4863:20: error: use of undeclared identifier 'SIMD_COEF_32'
                        for (k = 0; k < SIMD_COEF_32; k++)
                                        ^
dynamic_fmt.c:4864:10: error: use of undeclared identifier 'SIMD_COEF_32'
                                p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3;
                                     ^
dynamic_fmt.c:4864:28: error: use of undeclared identifier 'total_len'
                                p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3;
                                                       ^
dynamic_fmt.c:4871:8: error: use of undeclared identifier 'input_buf2'
                        p = input_buf2[i+j].w;
                            ^
dynamic_fmt.c:4872:20: error: use of undeclared identifier 'SIMD_COEF_32'
                        for (k = 0; k < SIMD_COEF_32; k++)
                                        ^
dynamic_fmt.c:4873:10: error: use of undeclared identifier 'SIMD_COEF_32'
                                p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3;
                                     ^
dynamic_fmt.c:4873:28: error: use of undeclared identifier 'total_len2'
                                p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3;
                                                       ^
16 errors generated.
Makefile:1534: recipe for target 'dynamic_fmt.o' failed
make[1]: *** [dynamic_fmt.o] Error 1
Makefile:187: recipe for target 'default' failed
make: *** [default] Error 2

Next error:

 $ touch dynamic_fmt.o; make -s
dynamic_big_crypt.c:521:33: error: use of undeclared identifier 'SIMD_COEF_32'
static const uint32_t MD5_inc = MD5_LOOPS;
                                ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:523:54: error: use of undeclared identifier 'SIMD_COEF_32'
static void DoMD5_crypt_f_sse(void *in, uint32_t len[MD5_LOOPS], void *out) {
                                                     ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:524:47: error: use of undeclared identifier 'SIMD_COEF_32'
        JTR_ALIGN(MEM_ALIGN_SIMD) ARCH_WORD_32 a[(16*MD5_LOOPS)/sizeof(ARCH_WORD_32)];
                                                     ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:525:23: error: use of undeclared identifier 'SIMD_COEF_32'
        uint32_t i, j, loops[MD5_LOOPS], bMore, cnt;
                             ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:528:18: error: use of undeclared identifier 'SIMD_COEF_32'
        for (i = 0; i < MD5_LOOPS; ++i) {
                        ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:529:3: error: use of undeclared identifier 'loops'
                loops[i] = Do_FixBufferLen32(cp, len[i], 0);
                ^
dynamic_big_crypt.c:535:2: error: use of undeclared identifier 'bMore'
        bMore = 1;
        ^
dynamic_big_crypt.c:536:2: error: use of undeclared identifier 'cnt'
        cnt = 1;
        ^
dynamic_big_crypt.c:537:9: error: use of undeclared identifier 'bMore'
        while (bMore) {
               ^
dynamic_big_crypt.c:538:66: error: use of undeclared identifier 'cnt'; did you mean 'int'?
                SIMDmd5body(cp, a, a, SSEi_FLAT_IN |SSEi_4BUF_INPUT_FIRST_BLK|(cnt==1?0:SSEi_RELOAD));
                                                                               ^
dynamic_big_crypt.c:539:3: error: use of undeclared identifier 'bMore'
                bMore = 0;
                ^
dynamic_big_crypt.c:540:19: error: use of undeclared identifier 'SIMD_COEF_32'
                for (i = 0; i < MD5_LOOPS; ++i) {
                                ^
dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS'
#define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5)
                   ^
dynamic_big_crypt.c:541:8: error: use of undeclared identifier 'cnt'
                        if (cnt == loops[i]) {
                            ^
dynamic_big_crypt.c:541:15: error: use of undeclared identifier 'loops'
                        if (cnt == loops[i]) {
                                   ^
dynamic_big_crypt.c:542:25: error: use of undeclared identifier 'SIMD_COEF_32'
                                uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1));
                                                    ^
dynamic_big_crypt.c:542:65: error: use of undeclared identifier 'SIMD_COEF_32'
                                uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1));
                                                                                            ^
dynamic_big_crypt.c:542:83: error: use of undeclared identifier 'SIMD_COEF_32'
                                uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1));
                                                                                                              ^
dynamic_big_crypt.c:544:44: error: use of undeclared identifier 'SIMD_COEF_32'
                                        ((ARCH_WORD_32*)out)[(i*4)+j] =  a[(j*SIMD_COEF_32)+offx];
                                                                              ^
dynamic_big_crypt.c:546:15: error: use of undeclared identifier 'cnt'
                        } else if (cnt < loops[i]) bMore = 1;
                                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Makefile:1534: recipe for target 'dynamic_big_crypt.o' failed
make[1]: *** [dynamic_big_crypt.o] Error 1
Makefile:187: recipe for target 'default' failed
make: *** [default] Error 2

Next error:

$ touch dynamic_big_crypt.o; make -s
FGT_fmt_plug.c:245:3: error: expected '}'
                ALGORITHM_NAME,
                ^
FGT_fmt_plug.c:54:33: note: expanded from macro 'ALGORITHM_NAME'
#define ALGORITHM_NAME          "SHA1 " SHA1_ALGORITHM_NAME
                                        ^
./simd-intrinsics.h:98:30: note: expanded from macro 'SHA1_ALGORITHM_NAME'
#define SHA1_ALGORITHM_NAME             BITS " " SIMD_TYPE " " SHA1_N_STR
                                        ^
FGT_fmt_plug.c:242:5: note: to match this '{'
    {
    ^
1 error generated.
Makefile:1534: recipe for target 'FGT_fmt_plug.o' failed
make[1]: *** [FGT_fmt_plug.o] Error 1
Makefile:187: recipe for target 'default' failed
make: *** [default] Error 2

and so on...

Originally created by @frank-dittrich on GitHub (Nov 1, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1874 Originally assigned to: @jfoug on GitHub. A regular autoconf build works, with and without openmp. But using clang instead of gcc doesn't. ``` $ clang --version Raspbian clang version 3.5.0-10+rpi1 (tags/RELEASE_350/final) (based on LLVM 3.5.0) Target: arm-unknown-linux-gnueabihf Thread model: posix $ clang -dumpversion 4.2.1 $ uname -a Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux ``` ``` clang -DAC_BUILT -march=native -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1 -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -std=gnu89 -Wdate-time -D_POSIX_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -pthread -I/usr/local/include -funroll-loops MD5_fmt.c -o MD5_fmt.o MD5_fmt.c:389:10: error: expected '}' "MD5 " MD5_ALGORITHM_NAME, ^ ./simd-intrinsics.h:79:29: note: expanded from macro 'MD5_ALGORITHM_NAME' #define MD5_ALGORITHM_NAME BITS " " SIMD_TYPE " " MD5_N_STR ^ MD5_fmt.c:386:2: note: to match this '{' { ^ 1 error generated. Makefile:1534: recipe for target 'MD5_fmt.o' failed make[1]: *** [MD5_fmt.o] Error 1 make[1]: Leaving directory '/usb/home/fd/git/JtR/src' Makefile:187: recipe for target 'default' failed make: *** [default] Error 2 ``` If I try to compile that that single file with gcc, I get the same error: ``` $ gcc -DAC_BUILT -march=native -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1 -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -std=gnu89 -Wdate-time -D_POSIX_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -pthread -I/usr/local/include -funroll-loops MD5_fmt.c -o MD5_fmt.o In file included from MD5_fmt.c:17:0: simd-intrinsics.h:79:29: error: expected ‘}’ before ‘BITS’ #define MD5_ALGORITHM_NAME BITS " " SIMD_TYPE " " MD5_N_STR ^ MD5_fmt.c:389:10: note: in expansion of macro ‘MD5_ALGORITHM_NAME’ "MD5 " MD5_ALGORITHM_NAME, ^ MD5_fmt.c:52:25: warning: ‘tests’ defined but not used [-Wunused-variable] static struct fmt_tests tests[] = { ^ ``` To see what else fails, I just touched MD5_fmt.o and continued. ``` $ touch MD5_fmt.o; make -s dynamic_fmt.c:4837:8: error: use of undeclared identifier 'input_buf' p = input_buf[i+j].w; ^ dynamic_fmt.c:4838:20: error: use of undeclared identifier 'SIMD_COEF_32' for (k = 0; k < SIMD_COEF_32; k++) ^ dynamic_fmt.c:4839:10: error: use of undeclared identifier 'SIMD_COEF_32' p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3; ^ dynamic_fmt.c:4839:28: error: use of undeclared identifier 'total_len' p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3; ^ dynamic_fmt.c:4846:8: error: use of undeclared identifier 'input_buf2' p = input_buf2[i+j].w; ^ dynamic_fmt.c:4847:20: error: use of undeclared identifier 'SIMD_COEF_32' for (k = 0; k < SIMD_COEF_32; k++) ^ dynamic_fmt.c:4848:10: error: use of undeclared identifier 'SIMD_COEF_32' p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3; ^ dynamic_fmt.c:4848:28: error: use of undeclared identifier 'total_len2' p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3; ^ dynamic_fmt.c:4862:8: error: use of undeclared identifier 'input_buf' p = input_buf[i+j].w; ^ dynamic_fmt.c:4863:20: error: use of undeclared identifier 'SIMD_COEF_32' for (k = 0; k < SIMD_COEF_32; k++) ^ dynamic_fmt.c:4864:10: error: use of undeclared identifier 'SIMD_COEF_32' p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3; ^ dynamic_fmt.c:4864:28: error: use of undeclared identifier 'total_len' p[14*SIMD_COEF_32+k] = total_len[i+j][k] << 3; ^ dynamic_fmt.c:4871:8: error: use of undeclared identifier 'input_buf2' p = input_buf2[i+j].w; ^ dynamic_fmt.c:4872:20: error: use of undeclared identifier 'SIMD_COEF_32' for (k = 0; k < SIMD_COEF_32; k++) ^ dynamic_fmt.c:4873:10: error: use of undeclared identifier 'SIMD_COEF_32' p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3; ^ dynamic_fmt.c:4873:28: error: use of undeclared identifier 'total_len2' p[14*SIMD_COEF_32+k] = total_len2[i+j][k] << 3; ^ 16 errors generated. Makefile:1534: recipe for target 'dynamic_fmt.o' failed make[1]: *** [dynamic_fmt.o] Error 1 Makefile:187: recipe for target 'default' failed make: *** [default] Error 2 ``` Next error: ``` $ touch dynamic_fmt.o; make -s dynamic_big_crypt.c:521:33: error: use of undeclared identifier 'SIMD_COEF_32' static const uint32_t MD5_inc = MD5_LOOPS; ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:523:54: error: use of undeclared identifier 'SIMD_COEF_32' static void DoMD5_crypt_f_sse(void *in, uint32_t len[MD5_LOOPS], void *out) { ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:524:47: error: use of undeclared identifier 'SIMD_COEF_32' JTR_ALIGN(MEM_ALIGN_SIMD) ARCH_WORD_32 a[(16*MD5_LOOPS)/sizeof(ARCH_WORD_32)]; ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:525:23: error: use of undeclared identifier 'SIMD_COEF_32' uint32_t i, j, loops[MD5_LOOPS], bMore, cnt; ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:528:18: error: use of undeclared identifier 'SIMD_COEF_32' for (i = 0; i < MD5_LOOPS; ++i) { ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:529:3: error: use of undeclared identifier 'loops' loops[i] = Do_FixBufferLen32(cp, len[i], 0); ^ dynamic_big_crypt.c:535:2: error: use of undeclared identifier 'bMore' bMore = 1; ^ dynamic_big_crypt.c:536:2: error: use of undeclared identifier 'cnt' cnt = 1; ^ dynamic_big_crypt.c:537:9: error: use of undeclared identifier 'bMore' while (bMore) { ^ dynamic_big_crypt.c:538:66: error: use of undeclared identifier 'cnt'; did you mean 'int'? SIMDmd5body(cp, a, a, SSEi_FLAT_IN |SSEi_4BUF_INPUT_FIRST_BLK|(cnt==1?0:SSEi_RELOAD)); ^ dynamic_big_crypt.c:539:3: error: use of undeclared identifier 'bMore' bMore = 0; ^ dynamic_big_crypt.c:540:19: error: use of undeclared identifier 'SIMD_COEF_32' for (i = 0; i < MD5_LOOPS; ++i) { ^ dynamic_big_crypt.c:520:20: note: expanded from macro 'MD5_LOOPS' #define MD5_LOOPS (SIMD_COEF_32*SIMD_PARA_MD5) ^ dynamic_big_crypt.c:541:8: error: use of undeclared identifier 'cnt' if (cnt == loops[i]) { ^ dynamic_big_crypt.c:541:15: error: use of undeclared identifier 'loops' if (cnt == loops[i]) { ^ dynamic_big_crypt.c:542:25: error: use of undeclared identifier 'SIMD_COEF_32' uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1)); ^ dynamic_big_crypt.c:542:65: error: use of undeclared identifier 'SIMD_COEF_32' uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1)); ^ dynamic_big_crypt.c:542:83: error: use of undeclared identifier 'SIMD_COEF_32' uint32_t offx = ((i/SIMD_COEF_32)*(16/sizeof(ARCH_WORD_32))*SIMD_COEF_32)+(i&(SIMD_COEF_32-1)); ^ dynamic_big_crypt.c:544:44: error: use of undeclared identifier 'SIMD_COEF_32' ((ARCH_WORD_32*)out)[(i*4)+j] = a[(j*SIMD_COEF_32)+offx]; ^ dynamic_big_crypt.c:546:15: error: use of undeclared identifier 'cnt' } else if (cnt < loops[i]) bMore = 1; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. Makefile:1534: recipe for target 'dynamic_big_crypt.o' failed make[1]: *** [dynamic_big_crypt.o] Error 1 Makefile:187: recipe for target 'default' failed make: *** [default] Error 2 ``` Next error: ``` $ touch dynamic_big_crypt.o; make -s FGT_fmt_plug.c:245:3: error: expected '}' ALGORITHM_NAME, ^ FGT_fmt_plug.c:54:33: note: expanded from macro 'ALGORITHM_NAME' #define ALGORITHM_NAME "SHA1 " SHA1_ALGORITHM_NAME ^ ./simd-intrinsics.h:98:30: note: expanded from macro 'SHA1_ALGORITHM_NAME' #define SHA1_ALGORITHM_NAME BITS " " SIMD_TYPE " " SHA1_N_STR ^ FGT_fmt_plug.c:242:5: note: to match this '{' { ^ 1 error generated. Makefile:1534: recipe for target 'FGT_fmt_plug.o' failed make[1]: *** [FGT_fmt_plug.o] Error 1 Makefile:187: recipe for target 'default' failed make: *** [default] Error 2 ``` and so on...
bsakaguchi 2026-10-14 03:40:57 +07:00
Author
Owner

@magnumripper commented on GitHub (Nov 1, 2015):

What did you get for arch.h? Does that clang support NEON instructions? I guess not. Try clang -dM -E -x c /dev/null | grep __ARM_NEON__

<!-- gh-comment-id:152869352 --> @magnumripper commented on GitHub (Nov 1, 2015): What did you get for arch.h? Does that clang support NEON instructions? I guess not. Try `clang -dM -E -x c /dev/null | grep __ARM_NEON__`
Author
Owner

@magnumripper commented on GitHub (Nov 1, 2015):

Made a small correction in 6493ce1, not sure if it will make any difference in this case.

<!-- gh-comment-id:152869586 --> @magnumripper commented on GitHub (Nov 1, 2015): Made a small correction in 6493ce1, not sure if it will make any difference in this case.
Author
Owner

@frank-dittrich commented on GitHub (Nov 1, 2015):

$ clang -dM -E -x c /dev/null | grep __ARM_NEON__
$ clang -dM -E -x c /dev/null | grep __ARM_
#define __ARM_32BIT_STATE 1
#define __ARM_ACLE 200
#define __ARM_ARCH 6
#define __ARM_ARCH_6K__ 1
#define __ARM_ARCH_ISA_ARM 1
#define __ARM_EABI__ 1
#define __ARM_PCS 1
#define __ARM_PCS_VFP 1
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_SIZEOF_WCHAR_T 4
#define __ARM_VFPV2__ 1
$ gcc -dM -E -x c /dev/null | grep __ARM_
#define __ARM_SIZEOF_WCHAR_T 32
#define __ARM_FEATURE_SAT 1
#define __ARM_ARCH_ISA_ARM 1
#define __ARM_FEATURE_UNALIGNED 1
#define __ARM_FP 12
#define __ARM_NEON_FP 4
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_PCS_VFP 1
#define __ARM_FEATURE_LDREX 4
#define __ARM_FEATURE_QBIT 1
#define __ARM_ARCH_6__ 1
#define __ARM_32BIT_STATE 1
#define __ARM_FEATURE_CLZ 1
#define __ARM_ARCH_ISA_THUMB 1
#define __ARM_ARCH 6
#define __ARM_FEATURE_SIMD32 1
#define __ARM_EABI__ 1
#define __ARM_FEATURE_DSP 1

I just fetched your latest changes, and will report the result once the build completed.

<!-- gh-comment-id:152869943 --> @frank-dittrich commented on GitHub (Nov 1, 2015): ``` $ clang -dM -E -x c /dev/null | grep __ARM_NEON__ $ clang -dM -E -x c /dev/null | grep __ARM_ #define __ARM_32BIT_STATE 1 #define __ARM_ACLE 200 #define __ARM_ARCH 6 #define __ARM_ARCH_6K__ 1 #define __ARM_ARCH_ISA_ARM 1 #define __ARM_EABI__ 1 #define __ARM_PCS 1 #define __ARM_PCS_VFP 1 #define __ARM_SIZEOF_MINIMAL_ENUM 4 #define __ARM_SIZEOF_WCHAR_T 4 #define __ARM_VFPV2__ 1 $ gcc -dM -E -x c /dev/null | grep __ARM_ #define __ARM_SIZEOF_WCHAR_T 32 #define __ARM_FEATURE_SAT 1 #define __ARM_ARCH_ISA_ARM 1 #define __ARM_FEATURE_UNALIGNED 1 #define __ARM_FP 12 #define __ARM_NEON_FP 4 #define __ARM_SIZEOF_MINIMAL_ENUM 4 #define __ARM_PCS_VFP 1 #define __ARM_FEATURE_LDREX 4 #define __ARM_FEATURE_QBIT 1 #define __ARM_ARCH_6__ 1 #define __ARM_32BIT_STATE 1 #define __ARM_FEATURE_CLZ 1 #define __ARM_ARCH_ISA_THUMB 1 #define __ARM_ARCH 6 #define __ARM_FEATURE_SIMD32 1 #define __ARM_EABI__ 1 #define __ARM_FEATURE_DSP 1 ``` I just fetched your latest changes, and will report the result once the build completed.
Author
Owner

@frank-dittrich commented on GitHub (Nov 1, 2015):

Looks better now. Just some warnings.

Unused functions:

dynamic_big_crypt.c:394:24: warning: unused function 'Do_FixBufferLen32' [-Wunused-function]
static inline uint32_t Do_FixBufferLen32(unsigned char *input_buf, int total_len, int BE_HASH)
                       ^
dynamic_big_crypt.c:431:24: warning: unused function 'Do_FixBufferLen64' [-Wunused-function]
static inline uint32_t Do_FixBufferLen64(unsigned char *input_buf, int total_len, int BE_HASH)
                       ^
blake2b-ref_plug.c:70:19: warning: unused function 'blake2b_clear_lastblock' [-Wunused-function]
static inline int blake2b_clear_lastblock( blake2b_state *S )
                  ^
blake2b-ref_plug.c:88:19: warning: unused function 'blake2b_param_set_digest_length' [-Wunused-function]
static inline int blake2b_param_set_digest_length( blake2b_param *P, const uint8_t digest_length )
                  ^
blake2b-ref_plug.c:94:19: warning: unused function 'blake2b_param_set_fanout' [-Wunused-function]
static inline int blake2b_param_set_fanout( blake2b_param *P, const uint8_t fanout )
                  ^
blake2b-ref_plug.c:100:19: warning: unused function 'blake2b_param_set_max_depth' [-Wunused-function]
static inline int blake2b_param_set_max_depth( blake2b_param *P, const uint8_t depth )
                  ^
blake2b-ref_plug.c:106:19: warning: unused function 'blake2b_param_set_leaf_length' [-Wunused-function]
static inline int blake2b_param_set_leaf_length( blake2b_param *P, const uint32_t leaf_length )
                  ^
blake2b-ref_plug.c:112:19: warning: unused function 'blake2b_param_set_node_offset' [-Wunused-function]
static inline int blake2b_param_set_node_offset( blake2b_param *P, const uint64_t node_offset )
                  ^
blake2b-ref_plug.c:118:19: warning: unused function 'blake2b_param_set_node_depth' [-Wunused-function]
static inline int blake2b_param_set_node_depth( blake2b_param *P, const uint8_t node_depth )
                  ^
blake2b-ref_plug.c:124:19: warning: unused function 'blake2b_param_set_inner_length' [-Wunused-function]
static inline int blake2b_param_set_inner_length( blake2b_param *P, const uint8_t inner_length )
                  ^
blake2b-ref_plug.c:130:19: warning: unused function 'blake2b_param_set_salt' [-Wunused-function]
static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] )
                  ^
blake2b-ref_plug.c:136:19: warning: unused function 'blake2b_param_set_personal' [-Wunused-function]
static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
                  ^

And some singed/unsigned issues?

pomelo_plug.c:281:62: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
    if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1;
                                                       ~~~~~ ^ ~
pomelo_plug.c:281:77: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
    if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1;
                                                                    ~~~~~~~ ^ ~
pomelo_plug.c:281:91: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
    if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1;
                                                                                   ~~~~~~ ^ ~
tgtsnarf.c:259:43: warning: comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare]
  while ((c = getopt(argc, argv, "h?AV")) != EOF) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
cprepair.c:281:48: warning: comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare]
        while ((c = getopt(argc, argv, "si:f:hldpn")) != -1) {
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~
<!-- gh-comment-id:152870327 --> @frank-dittrich commented on GitHub (Nov 1, 2015): Looks better now. Just some warnings. Unused functions: ``` dynamic_big_crypt.c:394:24: warning: unused function 'Do_FixBufferLen32' [-Wunused-function] static inline uint32_t Do_FixBufferLen32(unsigned char *input_buf, int total_len, int BE_HASH) ^ dynamic_big_crypt.c:431:24: warning: unused function 'Do_FixBufferLen64' [-Wunused-function] static inline uint32_t Do_FixBufferLen64(unsigned char *input_buf, int total_len, int BE_HASH) ^ blake2b-ref_plug.c:70:19: warning: unused function 'blake2b_clear_lastblock' [-Wunused-function] static inline int blake2b_clear_lastblock( blake2b_state *S ) ^ blake2b-ref_plug.c:88:19: warning: unused function 'blake2b_param_set_digest_length' [-Wunused-function] static inline int blake2b_param_set_digest_length( blake2b_param *P, const uint8_t digest_length ) ^ blake2b-ref_plug.c:94:19: warning: unused function 'blake2b_param_set_fanout' [-Wunused-function] static inline int blake2b_param_set_fanout( blake2b_param *P, const uint8_t fanout ) ^ blake2b-ref_plug.c:100:19: warning: unused function 'blake2b_param_set_max_depth' [-Wunused-function] static inline int blake2b_param_set_max_depth( blake2b_param *P, const uint8_t depth ) ^ blake2b-ref_plug.c:106:19: warning: unused function 'blake2b_param_set_leaf_length' [-Wunused-function] static inline int blake2b_param_set_leaf_length( blake2b_param *P, const uint32_t leaf_length ) ^ blake2b-ref_plug.c:112:19: warning: unused function 'blake2b_param_set_node_offset' [-Wunused-function] static inline int blake2b_param_set_node_offset( blake2b_param *P, const uint64_t node_offset ) ^ blake2b-ref_plug.c:118:19: warning: unused function 'blake2b_param_set_node_depth' [-Wunused-function] static inline int blake2b_param_set_node_depth( blake2b_param *P, const uint8_t node_depth ) ^ blake2b-ref_plug.c:124:19: warning: unused function 'blake2b_param_set_inner_length' [-Wunused-function] static inline int blake2b_param_set_inner_length( blake2b_param *P, const uint8_t inner_length ) ^ blake2b-ref_plug.c:130:19: warning: unused function 'blake2b_param_set_salt' [-Wunused-function] static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] ) ^ blake2b-ref_plug.c:136:19: warning: unused function 'blake2b_param_set_personal' [-Wunused-function] static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] ) ^ ``` And some singed/unsigned issues? ``` pomelo_plug.c:281:62: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1; ~~~~~ ^ ~ pomelo_plug.c:281:77: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1; ~~~~~~~ ^ ~ pomelo_plug.c:281:91: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (inlen > 256 || saltlen > 64 || outlen > 256 || inlen < 0 || saltlen < 0 || outlen < 0) return 1; ~~~~~~ ^ ~ ``` ``` tgtsnarf.c:259:43: warning: comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare] while ((c = getopt(argc, argv, "h?AV")) != EOF) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~ ``` ``` cprepair.c:281:48: warning: comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare] while ((c = getopt(argc, argv, "si:f:hldpn")) != -1) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~ ```
Author
Owner

@frank-dittrich commented on GitHub (Nov 1, 2015):

All 333 formats passed self-tests!

./jtrts.pl has that same mem_alloc(): Cannot allocate memory trying to allocate 1073741824 bytes problem as the gcc build, which I've not yet been able to track down.

But we have https://github.com/magnumripper/JohnTheRipper/issues/1872 for that.

I'll keep this issue open, because of the remaining clang warnings.

<!-- gh-comment-id:152874390 --> @frank-dittrich commented on GitHub (Nov 1, 2015): ``` All 333 formats passed self-tests! ``` ./jtrts.pl has that same `mem_alloc(): Cannot allocate memory trying to allocate 1073741824 bytes` problem as the gcc build, which I've not yet been able to track down. But we have https://github.com/magnumripper/JohnTheRipper/issues/1872 for that. I'll keep this issue open, because of the remaining clang warnings.
Author
Owner

@magnumripper commented on GitHub (Nov 1, 2015):

Signed/unsigned stuff fixed in 04787fd (please test). I guess clang would have hinted about #1863 had I not already fixed it.

<!-- gh-comment-id:152878585 --> @magnumripper commented on GitHub (Nov 1, 2015): Signed/unsigned stuff fixed in 04787fd (please test). I guess clang would have hinted about #1863 had I not already fixed it.
Author
Owner

@magnumripper commented on GitHub (Nov 1, 2015):

I guess clang would have hinted about #1863 had I not already fixed it.

And BTW hopefully this means we have now fixed all similar problems.

<!-- gh-comment-id:152878650 --> @magnumripper commented on GitHub (Nov 1, 2015): > I guess clang would have hinted about #1863 had I not already fixed it. And BTW _hopefully_ this means we have now fixed all similar problems.
Author
Owner

@magnumripper commented on GitHub (Nov 2, 2015):

All fixed except these

dynamic_big_crypt.c:394:24: warning: unused function 'Do_FixBufferLen32' [-Wunused-function]
static inline uint32_t Do_FixBufferLen32(unsigned char *input_buf, int total_len, int BE_HASH)
                       ^
dynamic_big_crypt.c:431:24: warning: unused function 'Do_FixBufferLen64' [-Wunused-function]
static inline uint32_t Do_FixBufferLen64(unsigned char *input_buf, int total_len, int BE_HASH)
                       ^

Leaving them to @jfoug.

<!-- gh-comment-id:152881924 --> @magnumripper commented on GitHub (Nov 2, 2015): All fixed except these ``` dynamic_big_crypt.c:394:24: warning: unused function 'Do_FixBufferLen32' [-Wunused-function] static inline uint32_t Do_FixBufferLen32(unsigned char *input_buf, int total_len, int BE_HASH) ^ dynamic_big_crypt.c:431:24: warning: unused function 'Do_FixBufferLen64' [-Wunused-function] static inline uint32_t Do_FixBufferLen64(unsigned char *input_buf, int total_len, int BE_HASH) ^ ``` Leaving them to @jfoug.
Author
Owner

@frank-dittrich commented on GitHub (Nov 2, 2015):

@magnumripper dropping the unused blake2b functions made another function unused. Fixed in 63d3aa15c6.
Otherwise, I didn't notice any problems. Those two unused dynamic functions are the only remaining.

BTW: I wonder why gcc isn't able to detect the unused functions detected by clang.
I even tried ./configure CC="gcc -Wunused". Didn't help.

<!-- gh-comment-id:152985223 --> @frank-dittrich commented on GitHub (Nov 2, 2015): @magnumripper dropping the unused blake2b functions made another function unused. Fixed in 63d3aa15c669c20463f54adf996618a5de345b90. Otherwise, I didn't notice any problems. Those two unused dynamic functions are the only remaining. BTW: I wonder why gcc isn't able to detect the unused functions detected by clang. I even tried `./configure CC="gcc -Wunused"`. Didn't help.
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

@frank-dittrich please check now.

<!-- gh-comment-id:153054205 --> @jfoug commented on GitHub (Nov 2, 2015): @frank-dittrich please check now.
Author
Owner

@frank-dittrich commented on GitHub (Nov 2, 2015):

@jfoug thanks!

<!-- gh-comment-id:153076910 --> @frank-dittrich commented on GitHub (Nov 2, 2015): @jfoug thanks!
Author
Owner

@magnumripper commented on GitHub (Nov 2, 2015):

BTW: I wonder why gcc isn't able to detect the unused functions detected by clang. I even tried ./configure CC="gcc -Wunused". Didn't help.

Because with gcc you had NEON and an other source file was used for Blake, already fixed long ago.

<!-- gh-comment-id:153120885 --> @magnumripper commented on GitHub (Nov 2, 2015): > BTW: I wonder why gcc isn't able to detect the unused functions detected by clang. I even tried ./configure CC="gcc -Wunused". Didn't help. Because with gcc you had NEON and an other source file was used for Blake, already fixed long ago.
Sign in to join this conversation.
No milestone
No project
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
openwall/john#1245
No description provided.