首页 > 解决方案 > 构建 glibc 时防止构建静态库

问题描述

我正在交叉编译 glibc 以在自定义 Linux 系统中使用。我只需要共享 glibc 库,所以我试图阻止 glibc 构建静态库,例如“libc.a”。我曾尝试使用“--disable-static”标志,但这似乎不起作用。

我当前的配置命令:

../configure \
  CFLAGS="-O2" \
  --host=arm-linux-gnueabihf \
  --prefix= \
  --includedir=/usr/include \
  --libexecdir=/usr/libexec \
  --datarootdir=/tmp \
  --localstatedir=/tmp \
  --with-__thread \
  --with-tls \
  --with-fp \
  --with-headers=/opt/sysroot/usr/include \
  --without-cvs \
  --without-gd \
  --enable-kernel=3.18.0 \
  --enable-stack-protector=strong \
  --enable-shared \
  --enable-add-ons=no \
  --enable-obsolete-rpc \
  --disable-profile \
  --disable-debug \
  --disable-sanity-checks \
  --disable-static \
  --disable-werror

标签: gccmakefileglibc

解决方案


由于这不会让您在构建时间上获得任何胜利(将一堆文件转储到.a文件中并创建索引与将它们链接到共享库相比应该没什么),我认为您所追求的是一种方便的安装方式只是你需要的部分。

我自己没有尝试过,但没有make install-no-libc.a做你想做的事?


推荐阅读