Skip to content

sha1_x86.c related failures with old compilers (Linux, FreeBSD) #738

@karel-m

Description

@karel-m

FreeBSD 9.2 / amd64 / gcc 4.2.1 20070831 patched [FreeBSD]

https://www.cpantesters.org/cpan/report/5b495d5a-3f2b-11f1-bba7-a1476e8775ea

cc -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include -DPIC -fPIC -O  -DLTC_NO_AES_NI -DLTC_NO_GCM_PCLMUL -DARGTYPE=4 -c ltc/hashes/sha1_x86.c -o ltc/hashes/sha1_x86.o
ltc/hashes/sha1_x86.c:14: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
In file included from ltc/hashes/sha1_x86.c:22:
/usr/include/gcc/4.2/tmmintrin.h:34:3: error: #error "SSSE3 instruction set not enabled"
ltc/hashes/sha1_x86.c:23:54: error: smmintrin.h: No such file or directory
ltc/hashes/sha1_x86.c:24:111: error: immintrin.h: No such file or directory
ltc/hashes/sha1_x86.c:27: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
ltc/hashes/sha1_x86.c:53: warning: '__target__' attribute directive ignored
ltc/hashes/sha1_x86.c: In function 's_sha1_x86_compress':
ltc/hashes/sha1_x86.c:75: error: incompatible types in assignment
ltc/hashes/sha1_x86.c:77: error: incompatible types in assignment
ltc/hashes/sha1_x86.c:79: error: incompatible types in assignment

FreeBSD 10.3 / amd64 / gcc 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)

https://www.cpantesters.org/cpan/report/55835eb6-3f2b-11f1-bba7-a1476e8775ea

cc -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_FORTIFY_SOURCE=2 -DPIC -fPIC -O2 -pipe  -DLTC_NO_AES_NI -DLTC_NO_GCM_PCLMUL -DARGTYPE=4 -c ltc/hashes/sha1_x86.c -o ltc/hashes/sha1_x86.o
In file included from ltc/hashes/sha1_x86.c:22:
/usr/include/clang/3.4.1/tmmintrin.h:28:2: error: "SSSE3 instruction set not enabled"
#error "SSSE3 instruction set not enabled"
 ^
In file included from ltc/hashes/sha1_x86.c:23:
/usr/include/clang/3.4.1/smmintrin.h:28:2: error: "SSE4.1 instruction set not enabled"
#error "SSE4.1 instruction set not enabled"
 ^
ltc/hashes/sha1_x86.c:51:12: warning: unknown attribute '__target__' ignored [-Wattributes]
static int LTC_SHA_TARGET s_sha1_x86_compress(hash_state *md, const unsigned char *buf)
           ^
ltc/headers/tomcrypt_cfg.h:394:39: note: expanded from macro 'LTC_SHA_TARGET'
#define LTC_SHA_TARGET __attribute__((__target__("sse2,ssse3,sse4.1,sha")))
                                      ^
ltc/hashes/sha1_x86.c:75:13: warning: implicit declaration of function '_mm_shuffle_epi8' is invalid in C99 [-Wimplicit-function-declaration]
    msg_0 = _mm_shuffle_epi8(msg_0, reverse_8);
            ^
ltc/hashes/sha1_x86.c:75:11: error: assigning to '__m128i' from incompatible type 'int'
    msg_0 = _mm_shuffle_epi8(msg_0, reverse_8);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ltc/hashes/sha1_x86.c:77:13: warning: implicit declaration of function '_mm_sha1rnds4_epu32' is invalid in C99 [-Wimplicit-function-declaration]
    abcdy = _mm_sha1rnds4_epu32(abcdx, e, 0);
            ^
ltc/hashes/sha1_x86.c:77:11: error: assigning to '__m128i' from incompatible type 'int'
    abcdy = _mm_sha1rnds4_epu32(abcdx, e, 0);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Linux debian wheezy / amd64 / gcc 4.7.2

https://www.cpantesters.org/cpan/report/85a15c86-3f0a-11f1-971e-0f146e8775ea

cc -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -O2  -DLTC_NO_AES_NI -DLTC_NO_GCM_PCLMUL -DARGTYPE=4 -c ltc/hashes/sha1_x86.c -o ltc/hashes/sha1_x86.o
In file included from ltc/hashes/sha1_x86.c:22:0:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/tmmintrin.h:31:3: error: #error "SSSE3 instruction set not enabled"
In file included from ltc/hashes/sha1_x86.c:23:0:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/smmintrin.h:31:3: error: #error "SSE4.1 instruction set not enabled"
ltc/hashes/sha1_x86.c:53:1: error: attribute(target("sha")) is unknown
ltc/hashes/sha1_x86.c: In function �s_sha1_x86_compress�:
ltc/hashes/sha1_x86.c:75:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:77:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:79:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:80:7: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:81:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:83:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:84:7: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:85:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:87:11: error: incompatible types when assigning to type �__m128i� from type �int�
ltc/hashes/sha1_x86.c:88:7: error: incompatible types when assigning to type �__m128i� from type �int�

@MarekKnapek any ideas for a fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions