New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toolchain: fix bracket-depth gcc build error when using clang #63
Conversation
That kind of alignment only makes editing harder... |
well maybe but it's much easier to read and since we basically never edit those lines... |
wget -c ftp://sourceware.org/pub/newlib/$NEWLIB.tar.gz -O download/$NEWLIB.tar.gz && tar xvzf download/$NEWLIB.tar.gz && \ | ||
wget -c ftp://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.bz2 -O download/$GCC.tar.bz2 && tar xvjf download/$GCC.tar.bz2 && \ | ||
wget -c ftp://ftp.gnu.org/gnu/gdb/$GDB.tar.xz -O download/$GDB.tar.xz && tar xvJf download/$GDB.tar.xz && \ | ||
wget -c ftp://sourceware.org/pub/newlib/$NEWLIB.tar.gz -O download/$NEWLIB.tar.gz && tar xvzf download/$NEWLIB.tar.gz && \ | ||
touch .downloaded | ||
if [ $? -ne 0 ]; then | ||
echo "Download failed!" | ||
exit 1 | ||
fi | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always initialize variables in bash. Everything should still run fine with set +u
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
touch .downloaded | ||
if [ $? -ne 0 ]; then | ||
echo "Download failed!" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
if [ ! $(gcc -v 2>&1 | grep clang > /dev/null) ]; then | ||
EXTRAGCCOPTS='CXXFLAGS="-fbracket-depth=512"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that this works, it should be an option to ./configure instead, maybe using environment variables
# Section 1: GNU Binutils. | ||
echo "Building Binutils..." | ||
[ -f .built_binutils ] || (cd build && rm -rf * && ../$BINUTILS/configure $OPTIONS_BINUTILS && make $PARALLEL all && make install && cd .. && rm -rf build/* && touch .built_binutils) || exit 1; | ||
|
||
# Section 2: GCC, step 1. | ||
echo "Building GCC (step 1)..." | ||
[ -f .built_gcc_step1 ] || (cd build && rm -rf * && ../$GCC/configure $OPTIONS_GCC && make $PARALLEL all-gcc && make install-gcc && cd .. && rm -rf build/* && touch .built_gcc_step1) || exit 1; | ||
[ -f .built_gcc_step1 ] || (cd build && rm -rf * && ../$GCC/configure $OPTIONS_GCC && make $PARALLEL $EXTRAGCCOPTS all-gcc && make install-gcc && cd .. && rm -rf build/* && touch .built_gcc_step1) || exit 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move to configure as it's also done on https://github.com/busterb/musl-cross-make/blob/fcf2604a5a1c91f2fd590af83c2dc691a6ee49a2/litecross/Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last time I tried that, I don't believe it fixed it, but I can try again...
- align some things here and there... - use -j4 by default, not -j8 - remove commented out check and the useless texinfo one
@@ -30,6 +30,10 @@ OPTIONS_GCC="--target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multi | |||
OPTIONS_NEWLIB="--target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --disable-newlib-may-supply-syscalls --disable-newlib-supplied-syscalls --with-float=soft --disable-werror --disable-nls --enable-newlib-io-float" | |||
OPTIONS_GDB="--target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --disable-werror --with-python" | |||
|
|||
if [ ! $(gcc -v 2>&1 | grep clang > /dev/null) ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You test the output of nothing here, that just can't work.
Just do
if (gcc -v 2>&1 | grep clang > /dev/null); then
Looks better as well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, add a comment why this is needed
Done (I edited online directly, I guess you'll have to squash merge...) |
or not :P |
And align some things here and there...