MongoDB v3.2编译的二进制文件超过500 MB

MongoDB v3.2编译的二进制文件超过500 MB,mongodb,compilation,scons,Mongodb,Compilation,Scons,我刚刚编译了MongoDB v3.2,使用了一个非常标准的标志来scons,正如它们的: 这是可行的,但二进制文件相当大,每个都有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 G

我刚刚编译了
MongoDB v3.2
,使用了一个非常标准的标志来
scons
,正如它们的:

这是可行的,但二进制文件相当大,每个都有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

这看起来很奇怪。。。好像我忘记了一些压缩标志或类似的东西。我相信这与
文件
命令输出中的
未剥离
有关。我怎样才能告诉scons剥离/压缩它呢?

为了完整起见,正如评论中提到的,GNU开发工具的剥离是答案:

# for x in mongo*; do strip -s $x; 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, stripped
16M     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, stripped
30M     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, stripped
30M     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, stripped
14M     mongos

只需运行
strip mongod
,也可以运行
man strip
,了解详细信息。:-)谢谢你,先生,效果很好:)
# for x in mongo*; do strip -s $x; 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, stripped
16M     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, stripped
30M     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, stripped
30M     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, stripped
14M     mongos