Newb question: is g++ part of NestedVM MIPS toolchain?

86 views
Skip to first unread message

rapodaca

unread,
Nov 17, 2007, 2:29:03 PM11/17/07
to NestedVM
I've seen only scattered references to it, but is mips-unknown-elf-g++
part of the NestedVM MIPS toolchain?

The version I'm using (checked out w/ darcs) doesn't seem to have it:

$ ls upstream/install/bin/
mips-unknown-elf-addr2line* mips-unknown-elf-gcc-3.3.6* mips-unknown-
elf-objdump*
mips-unknown-elf-ar* mips-unknown-elf-gccbug* mips-unknown-
elf-ranlib*
mips-unknown-elf-as* mips-unknown-elf-gcov* mips-unknown-
elf-readelf*
mips-unknown-elf-c++filt* mips-unknown-elf-ld* mips-unknown-
elf-size*
mips-unknown-elf-cpp* mips-unknown-elf-nm* mips-unknown-
elf-strings*
mips-unknown-elf-gcc* mips-unknown-elf-objcopy* mips-unknown-
elf-strip*

The build system I'm using for some source I'm trying to compile seems
to need g++.

Thanks,
Rich

Joe Wilson

unread,
Nov 17, 2007, 3:13:46 PM11/17/07
to NestedVM
--- rapodaca <rich.a...@gmail.com> wrote:
> I've seen only scattered references to it, but is mips-unknown-elf-g++
> part of the NestedVM MIPS toolchain?
>
> The version I'm using (checked out w/ darcs) doesn't seem to have it:
>
> $ ls upstream/install/bin/
> mips-unknown-elf-addr2line* mips-unknown-elf-gcc-3.3.6* mips-unknown-
> elf-objdump*
> mips-unknown-elf-ar* mips-unknown-elf-gccbug* mips-unknown-
> elf-ranlib*
> mips-unknown-elf-as* mips-unknown-elf-gcov* mips-unknown-
> elf-readelf*
> mips-unknown-elf-c++filt* mips-unknown-elf-ld* mips-unknown-
> elf-size*
> mips-unknown-elf-cpp* mips-unknown-elf-nm* mips-unknown-
> elf-strings*
> mips-unknown-elf-gcc* mips-unknown-elf-objcopy* mips-unknown-
> elf-strip*

g++ was there when I last tried:

make cxxtest

You can see the c++ option in upstream/Makefile:

configure_gcc_step2 = $(configure_gcc) --enable-languages="c,c++,f77"

How did you build NestedVM?

mips-unknown-elf-addr2line.exe
mips-unknown-elf-ar.exe
mips-unknown-elf-as.exe
mips-unknown-elf-c++.exe
mips-unknown-elf-c++filt.exe
mips-unknown-elf-cpp.exe
mips-unknown-elf-g77.exe
mips-unknown-elf-gcc-3.3.3
mips-unknown-elf-gccbug
mips-unknown-elf-gcc.exe
mips-unknown-elf-gcov.exe
mips-unknown-elf-g++.exe
mips-unknown-elf-ld.exe
mips-unknown-elf-nm.exe
mips-unknown-elf-objcopy.exe
mips-unknown-elf-objdump.exe
mips-unknown-elf-ranlib.exe
mips-unknown-elf-readelf.exe
mips-unknown-elf-size.exe
mips-unknown-elf-strings.exe
mips-unknown-elf-strip.exe

____________________________________________________________________________________
Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/

Brian Alliet

unread,
Nov 17, 2007, 4:21:21 PM11/17/07
to rapodaca, NestedVM
On Sat, Nov 17, 2007 at 11:29:03AM -0800, rapodaca wrote:
> I've seen only scattered references to it, but is mips-unknown-elf-g++
> part of the NestedVM MIPS toolchain?
>
> The version I'm using (checked out w/ darcs) doesn't seem to have it:

It is but it actually isn't built by default (since most people don't
need it). "make cxxtest" (as Joe mentioned) or
"make upstream/tasks/build_gcc_step2" should build it for you.

-Brian

rapodaca

unread,
Nov 18, 2007, 12:20:12 AM11/18/07
to NestedVM
On Nov 17, 12:13 pm, Joe Wilson <develo...@yahoo.com> wrote:
> g++ was there when I last tried:
>
> make cxxtest

Here's my output when I try:

$ make cxxtest
make -C upstream tasks/build_gcc_step2 usr="/home/rich/local/nestedvm/
upstream/install" \
MIPS_CFLAGS="-O3 -mmemcpy -ffunction-sections -fdata-
sections -falign-functions=512 -fno-rename-registers -fno-schedule-
insns -fno-delayed-branch -freduce-all-givs -march=mips1 -I. -Wall -
Wno-unused" \
MIPS_PCFLAGS="-O3 -mmemcpy -ffunction-sections -fdata-
sections -falign-functions=512 -fno-rename-registers -fno-schedule-
insns -fno-delayed-branch -freduce-all-givs -march=mips1 -I. -Wall -
Wno-unused --big-endian" \
MIPS_LDFLAGS="-march=mips1 --static -Wl,--gc-sections"
make[1]: Entering directory `/home/rich/local/nestedvm/upstream'
mkdir -p /home/rich/local/nestedvm/upstream/install
mkdir -p build/gcc-obj && cd build/gcc-obj && \
echo | ../gcc-3.3.6/configure --prefix=/home/rich/
local/nestedvm/upstream/install --target=mips-unknown-elf --disable-
threads --with-gnu-ld --with-gnu-as --with-newlib=yes --enable-sjlj-
exceptions --enable-languages="c" --enable-languages="c,c++,f77" && \
make TARGET_CFLAGS="-O3 -mmemcpy -ffunction-sections -
fdata-sections -falign-functions=512 -fno-rename-registers -fno-
schedule-insns -fno-delayed-branch -freduce-all-givs -march=mips1 -I. -
Wall -Wno-unused" && \
make install
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /home/rich/local/nestedvm/upstream/build/gcc-obj
Configuring libiberty...
loading cache ../config.cache
checking whether to enable maintainer-specific portions of
Makefiles... no
checking for makeinfo... no
checking for perl... (cached) perl
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... (cached) ar
checking for ranlib... (cached) ranlib
checking for gcc... (cached) gcc
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking whether gcc and cc understand -c and -o together... (cached)
yes
checking for POSIXized ISC... no
checking for working const... (cached) yes
checking for inline... (cached) inline
checking for a BSD compatible install... (cached) /usr/bin/install -c
xhost-mkfrag is unchanged
checking how to run the C preprocessor... (cached) gcc -E
checking for sys/file.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for limits.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for malloc.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for time.h... (cached) yes
checking for sys/resource.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/mman.h... (cached) yes
checking for fcntl.h... (cached) yes
checking for alloca.h... (cached) yes
checking for sys/pstat.h... (cached) no
checking for sys/sysmp.h... (cached) no
checking for sys/sysinfo.h... (cached) yes
checking for machine/hal_sysinfo.h... (cached) no
checking for sys/table.h... (cached) no
checking for sys/sysctl.h... (cached) yes
checking for sys/systemcfg.h... (cached) no
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking whether time.h and sys/time.h may both be included...
(cached) yes
checking whether errno must be declared... (cached) no
checking for ANSI C header files... (cached) yes
checking for uintptr_t... (cached) no
checking for pid_t... (cached) yes
checking whether the C compiler (gcc -O3 -mmemcpy -ffunction-sections -
fdata-sections -falign-functions=512 -fno-rename-registers -fno-
schedule-insns -fno-delayed-branch -freduce-all-givs ) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
Configure in /home/rich/local/nestedvm/upstream/build/gcc-obj/
libiberty failed, exiting.
make[1]: *** [tasks/build_gcc_step2] Error 1
make[1]: Leaving directory `/home/rich/local/nestedvm/upstream'
make: *** [upstream/tasks/build_gcc_step2] Error 2

> How did you build NestedVM?

I used the directions posted at:

http://wiki.brianweb.net/NestedVM/QuickStartGuide

Thanks,
Rich

rapodaca

unread,
Nov 18, 2007, 12:24:32 AM11/18/07
to NestedVM
Couldn't get "make cxxtest" to work (output shown in response to Joe's
message).

Also, I don't seem to have the build_gcc_step2 task:

$ ls upstream/tasks
build_binutils build_newlib download_gcc-core
extract_darcs_classgen
build_darcs_classgen build_openbsdglob download_gcc-g77
extract_gcc
build_extraheaders build_regex download_newlib
extract_newlib
build_gcc download_binutils download_openbsdglob
patch_binutils
build_libc download_gcc download_regex
patch_gcc
build_linker download_gcc-c++ extract_binutils
patch_newlib

So "make upstream/tasks/build_gcc_step2" doesn't seem to be an
option...

Thanks,
Rich

Brian Alliet

unread,
Nov 18, 2007, 12:45:48 AM11/18/07
to rapodaca, NestedVM
On Sat, Nov 17, 2007 at 09:20:12PM -0800, rapodaca wrote:
> checking whether the C compiler (gcc -O3 -mmemcpy -ffunction-sections -
> fdata-sections -falign-functions=512 -fno-rename-registers -fno-
> schedule-insns -fno-delayed-branch -freduce-all-givs ) works... no
> configure: error: installation or configuration problem: C compiler
> cannot create executables.

Something isn't right here. You've got all the mips specific CFLAGS
going to the native gcc. Do you by chance have CFLAGS (the environment
variable) set? If so unset it. If not I'm not sure where it would be
pulling those from. If you can figure out how to get them to go away
that should fix the problem.

-Brian

Brian Alliet

unread,
Nov 18, 2007, 12:47:36 AM11/18/07
to rapodaca, NestedVM
On Sat, Nov 17, 2007 at 09:24:32PM -0800, rapodaca wrote:
> Also, I don't seem to have the build_gcc_step2 task:
>
> $ ls upstream/tasks
[snip]

Right, it isn't supposed to be there yet.
upstream/tasks/build_gcc_step2 gets touched when the build succeeds.

Just run the command anyway (or do make cxxtest, it depends on
build_gcc_step2 so it'll implicitly do that for you). It'll work.

-Brian

rapodaca

unread,
Nov 18, 2007, 11:06:03 AM11/18/07
to NestedVM
I decided to start from scratch, incorporating the suggestions from
this forum into my build process... and it worked.

Here's how I did it (from the top):

$ darcs get --repo-name=nestedvm http://nestedvm.ibex.org

$ cd nestedvm

$ make

$ make test

[tests seemed to pass]

$ make cxxtest
...
java -cp build tests.CXXTest
Test's constructor
Name: 0x50b40
Name: PKc
Is pointer: 1
Name: 0x50b3c
Name: i
Is pointer: 0
Hello, World from Test
Now throwing an exception
sayhi threw: const char *:Hello, Exception Handling!
Test's destructor

$ make env.sh

$ source env.sh

The only thing I think I did differently was to run "make env.sh" at
the end. So the reason this wasn't working for me before might have
been that env.sh needs to be built _after_ "make cxxtest" is run
(makes sense now).

Many thanks for all the help.

Brian Alliet

unread,
Nov 18, 2007, 8:33:48 PM11/18/07
to rapodaca, NestedVM
On Sun, Nov 18, 2007 at 08:06:03AM -0800, rapodaca wrote:
> The only thing I think I did differently was to run "make env.sh" at
> the end. So the reason this wasn't working for me before might have
> been that env.sh needs to be built _after_ "make cxxtest" is run
> (makes sense now).

That does make sense. I didn't think of that. env.sh does set CFLAGS,
which autoconf happily picks up, even for native compilation. I guess
the rule is don't source env.sh when you're using NestedVM's build
process, only use it for compiling stuff outside the NestedVM tree.

Glad you got everything worked out.

-Brian

Reply all
Reply to author
Forward
0 new messages