【问题标题】:Prevent the building of static libraries when building glibc构建 glibc 时防止构建静态库
【发布时间】:2019-11-16 09:17:56
【问题描述】:

我正在交叉编译 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

【问题讨论】:

    标签: gcc makefile glibc


    【解决方案1】:

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

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

    【讨论】:

    • 嗯,libc.a 只是一个例子。有很多静态文件。似乎很奇怪,我必须定义我不想要的每个文件,而不是仅仅关闭静态文件的构建,然后进行简单的“make install”。这适用于大多数其他程序,那么为什么不适用于 glibc?
    猜你喜欢
    • 2014-02-10
    • 2011-08-09
    • 2016-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多