How i can static build GDB from source?

前端 未结 3 1788
走了就别回头了
走了就别回头了 2021-02-07 14:42

I\'ve download gdb-6.5.bz2.tar. Untar this file. I write: LDFLAGS=-static ./configure

but as a result i get a gdb, which require a so files, for instance: ncurses.so.5

3条回答
  •  情歌与酒
    2021-02-07 15:18

    Both gcc and gdb disrespect the --enable-static flag which should be passed to configure, the correct way to do this is:

    In the case of gdb 8.0, you have to also add the --disable-interprocess-agent to successfully build a static version:

    mkdir build-gdb && cd build-gdb && ../configure --prefix=... --enable-static --disable-interprocess-agent ...

    In the case of gcc 7.1, you have to also add the --disable-libcc1 to successfully build a static version:

    mkdir build-gcc && cd guild-gcc && ../configure --prefix=... --enable-static --disable-shared --disable-libcc1 ...

提交回复
热议问题