【发布时间】:2016-05-21 20:10:11
【问题描述】:
我刚刚通过使用非常标准的标志编译MongoDB v3.2 到scons,正如他们的wiki 中所记录的那样:
scons core --ssl --disable-warnings-as-errors
scons install --prefix /usr/local --disable-warnings-as-errors
这行得通,但二进制文件相当大,每个 200~500 MB:
# for x in mongo*; do file $x; du -sh $x; done
mongo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=69333c37057636d730d21940550f6ecc45f7474b, not stripped
196M mongo
mongod: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=1d1b8122b74729d042fee025a1bdb2999fe99fcc, not stripped
521M mongod
mongoperf: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=5bfb47e755271efbdbed1de5b8130a41da5d026e, not stripped
511M mongoperf
mongos: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=6409c6eb3d4f771fd9e41fbc87985384cc7b5453, not stripped
254M mongos
这看起来很奇怪......就像我忘记了一些压缩标志或类似的东西。我相信这与file 命令输出中的not stripped 有关。我如何告诉scons 剥离/压缩它?
【问题讨论】:
-
只需运行
strip mongod,也可以运行man strip了解详情。 :-) -
谢谢先生,效果很好:)
标签: mongodb compilation scons