代码之家  ›  专栏  ›  技术社区  ›  greywolf82

静态链接库asan与gcc4.8

  •  0
  • greywolf82  · 技术社区  · 6 年前

    我使用gcc 4.8.3以这种方式编译测试可执行文件:

    gcc -o test -g -L/lib64 -fsanitize=address -static-libasan
    

    结果:

    /usr/bin/ld: cannot find -lasan
    collect2: error: ld returned 1 exit status
    

    Libasan已经安装,如果我编译时没有使用static选项,它就可以工作了。如何静态编译库?

    1 回复  |  直到 6 年前
        1
  •  2
  •   yugr    6 年前

    $ sudo apt-get install libgcc-4.8-dev