Skip to content

make fail #1877

Description

@longtbl

master分支下,在wsl环境下,make 失败

mkdir build && cd build cmake .. make

首次maks显示失败为
/src/bn.c:18:18: error: unknown type name ‘uint32_t’
18 | void bn_set_word(uint32_t *r, uint32_t a, size_t k)
| ^~~~~~~~
/src/bn.c:16:1: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
15 | #include <gmssl/endian.h>
+++ |+#include <stdint.h>
16 |
/src/bn.c:18:31: error: unknown type name ‘uint32_t’
18 | void bn_set_word(uint32_t *r, uint32_t a, size_t k)
| ^~~~~~~~
/src/bn.c:18:31: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
/src/bn.c:26:14: error: unknown type name ‘uint32_t’
26 | void bn_copy(uint32_t *r, const uint32_t *a, size_t k)
| ^~~~~~~~
/src/bn.c:26:14: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
/src/bn.c:26:33: error: unknown type name ‘uint32_t’
26 | void bn_copy(uint32_t *r, const uint32_t *a, size_t k)
| ^~~~~~~~
/src/bn.c:33:18: error: unknown type name ‘uint32_t’
33 | int bn_cmp(const uint32_t *a, const uint32_t *b, size_t k)
| ^~~~~~~~
......

为bn.c添加#include <stdint.h>后,编译依然报错
In file included from /home/lbl/GMSSL/GmSSL/src/sphincs.c:22:
/home/lbl/GMSSL/GmSSL/src/sphincs.c: In function ‘sphincs_sign_finish_ex’:
/home/lbl/GMSSL/GmSSL/include/gmssl/sphincs.h:69:41: warning: ‘sha256_finish’ accessing 32 bytes in a region of size 30 [-Wstringop-overflow=]
69 | # define sphincs_hash256_finish sha256_finish
/home/lbl/GMSSL/GmSSL/src/sphincs.c:1561:17: note: in expansion of macro ‘sphincs_hash256_finish’
1561 | sphincs_hash256_finish(&ctx->hash_ctx, tbs + sizeof(dgst) * i);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/lbl/GMSSL/GmSSL/include/gmssl/sphincs.h:69:41: note: referencing argument 2 of type ‘uint8_t *’ {aka ‘unsigned char *’}
69 | # define sphincs_hash256_finish sha256_finish
/home/lbl/GMSSL/GmSSL/src/sphincs.c:1561:17: note: in expansion of macro ‘sphincs_hash256_finish’
1561 | sphincs_hash256_finish(&ctx->hash_ctx, tbs + sizeof(dgst) * i);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/lbl/GMSSL/GmSSL/src/sphincs.c:19:
/home/lbl/GMSSL/GmSSL/include/gmssl/sha2.h:56:6: note: in a call to function ‘sha256_finish’
56 | void sha256_finish(SHA256_CTX *ctx, uint8_t dgst[SHA256_DIGEST_SIZE]);
| ^~~~~~~~~~~~~
In file included from /home/lbl/GMSSL/GmSSL/src/sphincs.c:22:
/home/lbl/GMSSL/GmSSL/src/sphincs.c: In function ‘sphincs_verify_finish’:
/home/lbl/GMSSL/GmSSL/include/gmssl/sphincs.h:69:41: warning: ‘sha256_finish’ accessing 32 bytes in a region of size 30 [-Wstringop-overflow=]
69 | # define sphincs_hash256_finish sha256_finish
/home/lbl/GMSSL/GmSSL/src/sphincs.c:1706:17: note: in expansion of macro ‘sphincs_hash256_finish’
1706 | sphincs_hash256_finish(&ctx->hash_ctx, tbs + sizeof(dgst) * i);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/lbl/GMSSL/GmSSL/include/gmssl/sphincs.h:69:41: note: referencing argument 2 of type ‘uint8_t *’ {aka ‘unsigned char *’}
69 | # define sphincs_hash256_finish sha256_finish
/home/lbl/GMSSL/GmSSL/src/sphincs.c:1706:17: note: in expansion of macro ‘sphincs_hash256_finish’
1706 | sphincs_hash256_finish(&ctx->hash_ctx, tbs + sizeof(dgst) * i);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/lbl/GMSSL/GmSSL/src/sphincs.c:19:
/home/lbl/GMSSL/GmSSL/include/gmssl/sha2.h:56:6: note: in a call to function ‘sha256_finish’
56 | void sha256_finish(SHA256_CTX *ctx, uint8_t dgst[SHA256_DIGEST_SIZE]);
| ^~~~~~~~~~~~~
[ 13%] Building C object CMakeFiles/gmssl.dir/src/kyber.c.o
[ 14%] Building C object CMakeFiles/gmssl.dir/src/sha1.c.o
[ 14%] Building C object CMakeFiles/gmssl.dir/src/sha256.c.o
[ 15%] Building C object CMakeFiles/gmssl.dir/src/sha512.c.o
[ 15%] Building C object CMakeFiles/gmssl.dir/src/sha256_hmac.c.o
[ 15%] Building C object CMakeFiles/gmssl.dir/src/aes.c.o
[ 16%] Building C object CMakeFiles/gmssl.dir/src/aes_modes.c.o
[ 16%] Building C object CMakeFiles/gmssl.dir/src/chacha20.c.o
[ 16%] Building C object CMakeFiles/gmssl.dir/src/sm4_cbc_mac.c.o
[ 17%] Building C object CMakeFiles/gmssl.dir/src/rand_unix.c.o
[ 17%] Building C object CMakeFiles/gmssl.dir/src/http.c.o
[ 17%] Building C object CMakeFiles/gmssl.dir/src/sdf/sdf.c.o
[ 18%] Building C object CMakeFiles/gmssl.dir/src/sdf/sdf_lib.c.o
[ 18%] Building C object CMakeFiles/gmssl.dir/src/sdf/sdf_meth.c.o
[ 18%] Building C object CMakeFiles/gmssl.dir/src/sdf/sdf_ext.c.o
[ 19%] Building C object CMakeFiles/gmssl.dir/src/sdf/sdf_sansec.c.o
[ 19%] Linking C shared library bin/libgmssl.so
/usr/bin/ld: CMakeFiles/gmssl.dir/src/ec.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_alg.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_cer.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_ext.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_req.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_crl.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_new.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/x509_key.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/cms.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/tls.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/tls_ext.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/tls_trace.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/tlcp.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/tls12.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/tls13.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here /usr/bin/ld: CMakeFiles/gmssl.dir/src/secp256r1_key.c.o:(.bss+0x0): multiple definition of zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/gmssl.dir/src/kyber.c.o:(.bss+0x0): multiple definition of `zeta'; CMakeFiles/gmssl.dir/src/sm2_key.c.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/gmssl.dir/build.make:1441: bin/libgmssl.so.3.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:197: CMakeFiles/gmssl.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions