-
Notifications
You must be signed in to change notification settings - Fork 30
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
Build g++ configuration proposal #6
Comments
FYI, running a command like $ strings avr32-g++ | grep configure on the Atmel Toolchain for Linux produced the following result: /home/tools/hudson/workspace/avr32-gnu-toolchain/src/gcc/configure |
Thanks for the config options from the Linux toolchain that should be helpful. In reference to the lack of logic, it's possible that there are some things in there that are unneeded or don't have useful effects in this particular build situation, but gcc and newlib in particular have some arcane options and flags that are sometimes necessary or were suggested to help certain issues at different times. It's possible that there's some unnecessary cruft depending on the GCC version and the platform being used :-)
GCC needs to be bootstrapped to build g++ as far as I can recall. So, instead of doing a bare bootstrap install and then recompiling gcc with c & c++ enabled, I install the C version first which then allows the rest of it to be built. There's a bit of information about it here: http://gcc.gnu.org/install/build.html The example I started with used the approach of building the C then C++ compilers as stages rather than building a minimal bootstrap version then the C/C++ and it has seemed to work fine for me, however I don't use g++ a huge amount so if you have trouble, definitely file an issue and I can look into it, especially if you have a test case I can run. I'll give this a try and push it to the repo if it builds for me as well. |
Hmm... do I miss something? After the successful build there is avr32-g++ and it tends to work for me. |
Since the projects I need to build witth this toolchain are all C++, I tried to also build the g++, currently not implemented by the Makefile.
I did it more like a copy/paste experiment, based on the gcc code, and less based on any knowledge.
However, the configure parameters I used have no logic behind, I just added those from the gross-g++ over those of build-gcc.
Could you review these configuration details and update the Makefile accordingly, in order to also build the g++?
Thank you,
Liviu
p.s. BTW, why does the Makefile need to build gcc and g++ separately?
.PHONY: prep-g++
prep-g++ stamps/prep-g++: stamps/patch-gcc
[ -d stamps ] || mkdir stamps;
touch stamps/prep-g++;
.PHONY: build-g++
$(MAKE) -j$ (PROCS)
build-g++ stamps/build-g++: stamps/install-binutils stamps/prep-newlib stamps/prep-g++
mkdir -p build/g++ && cd build/g++ &&
pushd ../../gcc-$(GCC_VERSION) ;
make clean ;
popd ;
../../gcc-$(GCC_VERSION)/configure --prefix=$(PREFIX)
--target=$(TARGET) $(DEPENDENCIES) --enable-languages="c++" --with-gnu-ld
--with-gnu-as --with-newlib --disable-nls --disable-libssp
--with-newlib --with-dwarf2 --enable-sjlj-exceptions
--enable-version-specific-runtime-libs --disable-libstdcxx-pch
--disable-shared
--without-headers
--disable-threads --disable-libmudflap --disable-libgomp
--disable-libunwind-exceptions --disable-libffi --enable-extra-sgxxlite-multilibs
--with-build-time-tools=$(PREFIX)/$(TARGET)/bin
--enable-cxx-flags=$(CFLAGS_FOR_TARGET)
--with-sysroot=$(PREFIX)/$(TARGET)
--with-build-sysroot=$(PREFIX)/$(TARGET)
--with-build-time-tools=$(PREFIX)/$(TARGET)/bin
CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)
LDFLAGS_FOR_TARGET="--sysroot=$(PREFIX)/$(TARGET)"
CPPFLAGS_FOR_TARGET="--sysroot=$(PREFIX)/$(TARGET)"
--with-bugurl=$(BUG_URL) &&
[ -d stamps ] || mkdir stamps
touch stamps/build-g++;
.PHONY: install-g++
install-g++ stamps/install-g++: stamps/build-g++
cd build/g++ &&
$(MAKE) installdirs install-target &&
$(MAKE) -C gcc install-common install-cpp install- install-driver install-headers install-man
[ -d stamps ] || mkdir stamps
touch stamps/install-g++;
The text was updated successfully, but these errors were encountered: