Created
October 14, 2024 23:37
-
-
Save dcci/2aeedfaa23bf3f8df963523442181202 to your computer and use it in GitHub Desktop.
gcc size bisect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# My git clone of the gcc tree | |
GCCSRC=~/bisect/gcc-bisect/gcc | |
# My pre-processed test case | |
TESTSRC=~/bisect/gcc-bisect/test.cpp | |
cd ~/bisect/gcc-bisect | |
rm -f /tmp/out | |
rm -rf build | |
mkdir build | |
(cd build; | |
$GCCSRC/configure --prefix=$HOME/bisect/gcc-bisect/gcc-install --enable-languages=c,c++ --disable-libquadmath --disable-libquadmath-support --disable-werror --disable-bootstrap --without-gmp --disable-multilib; | |
make -j64; | |
make install) | |
# build my test case | |
$HOME/bisect/gcc-bisect/gcc-install/bin/gcc -Os $TESTSRC -o /tmp/out -c | |
text_size=$(size /tmp/out | tail -n 1 | awk '{print $1}') | |
if [ $text_size -eq 171 ]; then | |
exit 1 | |
elif [ $text_size -eq 134 ]; then | |
exit 0 | |
else | |
exit 125 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment