最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c - How to use llvm to compile a project that uses standard library files to generate an executable file for hexagon - Stack Ove

programmeradmin1浏览0评论

I want to compile hqc using llvm's clang and ld.

llvm-project-19.1.0.src/build/bin/clang  --target=hexagon -mv73 -mhvx -std=c99 -integrated-as -I /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/include -Wall -g -I. -I./common -I./hqc-256 -I./hqc-256/clean -I./.vscode -c test_kem.c -o test_kem.o
llvm-project-19.1.0.src/build/bin/ld.lld test_kem.o common/aes.o common/fips202.o common/nistseedexpander.o common/randombytes.o common/sha2.o common/sp800-185.o hqc-256/clean/code.o hqc-256/clean/fft.o hqc-256/clean/gf2x.o hqc-256/clean/gf.o hqc-256/clean/hqc.o hqc-256/clean/kem.o hqc-256/clean/parsing.o hqc-256/clean/reed_muller.o hqc-256/clean/reed_solomon.o hqc-256/clean/shake_ds.o hqc-256/clean/shake_prng.o hqc-256/clean/vector.o -o program -L /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/*.a  

use this command to link,get this problem

ld.lld: error: duplicate symbol: .CONST_3FF0000000000000
>>> defined at xldtob.c
>>>            xldtob.o:(.gnu.linkonce.l8.CONST_3FF0000000000000+0x0) in archive /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a
>>> defined at xlprec.c
>>>            xlprec.o:(.gnu.linkonce.l8.CONST_3FF0000000000000+0x0) in archive /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a
make: *** [Makefile:46: program] Error 1

if I add --allow-multiple-definition this option,then I get

ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(localeco.o):(function localeconv: .text.localeconv+0x0): unknown relocation (11) against symbol _Tls_setup__Locale
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xmbtowc.o):(function _Mbtowc: .text._Mbtowc+0xc): unknown relocation (11) against symbol _Tls_setup__Mbstate
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xfinalize.o):(function __cxa_finalize: .text.__cxa_finalize+0x8): unknown relocation (11) against symbol _AtcountPublic
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xstate.o):(function _Getmbcurmax: .text._Getmbcurmax+0x0): unknown relocation (11) against symbol _Tls_setup__Mbcurmax
ld.lld: error: /home/plg/HDD/mzy_workspace/hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xctype.o):(function _Getpctype: .text._Getpctype+0x0): unknown relocation (11) against symbol _Tls_setup__Ctype
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(exit1.o):(function _Atrealloc: .text._Atrealloc+0x0): unknown relocation (11) against symbol _Nats
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xmt.o):(function __cxa_atexit: .text.__cxa_atexit+0x14): unknown relocation (11) against symbol _AtcountPublic
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(fesetenv.o):(function _Force_raise: .text._Force_raise+0x10): unknown relocation (12) against symbol .CONST_0000000000000000
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xctype.o):(function _Getpctype: .text._Getpctype+0x18): unknown relocation (11) against symbol _Ctype
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(exit1.o):(function _Atrealloc: .text._Atrealloc+0x24): unknown relocation (11) against symbol _AtcountPrivate
ld.lld: error: /hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xwctomb.o):(function _Wctomb: .text._Wctomb+0xc): unknown relocation (11) against symbol _Tls_setup__Mbstate
/hexagon/5.5.1.1/tools/HEXAGON_Tools/8.7.06/Tools/target/hexagon/lib/v73/libc.a(xlprec.o):(function _LXp_invx: .text._LXp_invx+0x7c): unknown relocation (12) against symbol .CONST_3FF0000000000000
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
malloc_consolidate(): unaligned fastbin chunk detected

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论