Skip to content
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

Merged
merged 2 commits into from Mar 2, 2017
Merged

Conversation

adriweb
Copy link
Contributor

@adriweb adriweb commented Feb 27, 2017

And align some things here and there...

@Vogtinator
Copy link
Contributor

That kind of alignment only makes editing harder...

@adriweb
Copy link
Contributor Author

adriweb commented Feb 27, 2017

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

Copy link
Contributor

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

Copy link
Contributor Author

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"'
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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
Copy link
Contributor

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!

Copy link
Contributor

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

@adriweb
Copy link
Contributor Author

adriweb commented Mar 2, 2017

Done (I edited online directly, I guess you'll have to squash merge...)

@Vogtinator Vogtinator merged commit 362926f into ndless-nspire:master Mar 2, 2017
@adriweb
Copy link
Contributor Author

adriweb commented Mar 2, 2017

or not :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants