I just ran a test with all the optimizations from the firefox ebuilds: --enable-fpu=neon --with-thumb=yes --with-thumb-interwork=no they work fine with gcc, and both saves a lot of space and should give faster runtime binaries. If you intend pick it up, please don't forget that CC=clang doesn't understand all of these options. A simple copy of the log from the firefox ebuild should work for both cases.
without neon optimization: bloaty /usr/lib/libmozjs-68.so.0 VM SIZE FILE SIZE -------------- -------------- 89.6% 8.27Mi .text 8.27Mi 89.6% 3.1% 291Ki .rodata 291Ki 3.1% 1.6% 149Ki .rel.dyn 149Ki 1.6% 1.4% 131Ki .dynstr 131Ki 1.4% 1.3% 126Ki .ARM.extab 126Ki 1.3% 1.2% 109Ki .ARM.exidx 109Ki 1.2% 1.1% 107Ki .data.rel.ro 107Ki 1.1% 0.4% 38.6Ki .dynsym 38.6Ki 0.4% 0.2% 14.6Ki .gnu.hash 14.6Ki 0.2% 0.1% 5.16Ki .bss 0 0.0% 0.1% 4.83Ki .gnu.version 4.83Ki 0.1% 0.0% 3.37Ki .got 3.37Ki 0.0% 0.0% 2.84Ki .plt 2.84Ki 0.0% 0.0% 1.88Ki .rel.plt 1.88Ki 0.0% 0.0% 9 [Unmapped] 1.85Ki 0.0% 0.0% 276 [ELF Headers] 1.32Ki 0.0% 0.0% 416 .data 416 0.0% 0.0% 368 .gnu.version_r 368 0.0% 0.0% 328 .dynamic 328 0.0% 0.0% 0 .shstrtab 240 0.0% 0.0% 136 [Other] 185 0.0% 100.0% 9.24Mi TOTAL 9.24Mi 100.0% with all optimizations: bloaty /usr/lib/libmozjs-68.so.0 VM SIZE FILE SIZE -------------- -------------- 86.6% 5.68Mi .text 5.68Mi 86.6% 4.3% 291Ki .rodata 291Ki 4.3% 2.2% 149Ki .rel.dyn 149Ki 2.2% 2.0% 131Ki .dynstr 131Ki 2.0% 1.6% 107Ki .data.rel.ro 107Ki 1.6% 1.6% 107Ki .ARM.exidx 107Ki 1.6% 0.6% 40.5Ki .ARM.extab 40.5Ki 0.6% 0.6% 38.6Ki .dynsym 38.6Ki 0.6% 0.2% 14.6Ki .gnu.hash 14.6Ki 0.2% 0.1% 5.16Ki .bss 0 0.0% 0.1% 4.83Ki .gnu.version 4.83Ki 0.1% 0.1% 3.37Ki .got 3.37Ki 0.1% 0.0% 2.94Ki .plt 2.94Ki 0.0% 0.0% 1.88Ki .rel.plt 1.88Ki 0.0% 0.0% 276 [ELF Headers] 1.32Ki 0.0% 0.0% 416 .data 416 0.0% 0.0% 368 .gnu.version_r 368 0.0% 0.0% 328 .dynamic 328 0.0% 0.0% 5 [Unmapped] 314 0.0% 0.0% 0 .shstrtab 240 0.0% 0.0% 136 [Other] 187 0.0% 100.0% 6.56Mi TOTAL 6.56Mi 100.0%
for now I've dropped this into /usr/armv7a-unknown-linux-gnueabihf/etc/portage/env/dev-lang/spidermonkey EXTRA_ECONF="--with-fpu=neon --with-thumb=yes --with-thumb-interwork=no" if you want to compile nativly, please make sure to use gcc. clang doesn't understand thumb instructions. So only apply --with-fpu=neon in this case.
I've tested this extensivly, and I would suggest to add only --enable-fpu=neon for now, so that we can spare the headache with gcc vs clang about thumb support
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ffddcc20f7ac8ce504a8937ffaa1f2942ce9715 commit 0ffddcc20f7ac8ce504a8937ffaa1f2942ce9715 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2020-09-20 13:36:33 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2020-09-20 14:04:04 +0000 dev-lang/spidermonkey: add CPU_FLAGS_ARM=neon Closes: https://bugs.gentoo.org/717344 Package-Manager: Portage-3.0.7, Repoman-3.0.1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> dev-lang/spidermonkey/spidermonkey-68.12.0.ebuild | 53 +++++++++++++++-------- dev-lang/spidermonkey/spidermonkey-78.2.0.ebuild | 53 +++++++++++++++-------- 2 files changed, 68 insertions(+), 38 deletions(-)