Problem compiling gcc 4.0.2 with latest patch (0.99.2)

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there,

I'm trying to recompile my gcc crosscompiler with the current patches in order to test and possibly work with the Qtopia port. Unfortunally, I'm stuck with the following error:

Quote:

/home/correa/avr32/gcc/build-avr32-linux-gcc/gcc/xgcc -B/home/correa/avr32/gcc/build-avr32-linux-gcc/gcc/ -B/usr/local/avr32-linux/bin/ -B/usr/local/avr32-linux/lib/ -isystem /usr/local/avr32-linux/include -isystem /usr/local/avr32-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../gcc-4.0.2/gcc -I../../gcc-4.0.2/gcc/. -I../../gcc-4.0.2/gcc/../include -I../../gcc-4.0.2/gcc/../libcpp/include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -mrelax \
-Dinhibit_libc -c ../../gcc-4.0.2/gcc/crtstuff.c -DCRT_BEGIN \
-o crtbegin.o
as: unrecognized option `--pic'
make[1]: ** [crtbegin.o] Erro 1
make[1]: Saindo do diretrio `/home/correa/avr32/gcc/build-avr32-linux-gcc/gcc'
make: ** [all-gcc] Erro 2
correa@correa-desktop:~/avr32/gcc/build-avr32-linux-gcc$

Have anyone got this? Or hopefully got past this issue? Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any issue with --pic tends to mean that for some reason an i386 compiler is being called with AVR32 options. Did you use the correct ./configure line? If unsure check the Getting Started page on avr32linux.org

Cheers,
-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's what I have used, verbatim :P

It looks like I had to rebuild binutils, even thought having the .deb of all packages from BSP 2.0beta installed in my Kubunto. It did build ok with the threads option disabled (as if I was to bootstrap) but it won't work in the final config (C++ enabled).
So I started recompiling everything but I got stuck again with uClib:

Quote:

make[2]: Entering directory `/home/correa/avr32/sources/uClibc-0.9.28/ldso/ldso'
gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-stack-protector -Os -funit-at-a-time -DUCLIBC_LDSO=\"ld-uClibc.so.0\" -mcpu=ap7000 -fPIC -DUCLIBC_RUNTIME_PREFIX=\"/usr/avr32-linux-uclibc/\" -fno-builtin -nostdinc -D_LIBC -I../../ldso/include -I. -I../../include -isystem /usr/lib/gcc/i486-linux-gnu/4.1.2/include -Wa,--noexecstack -c avr32/resolve.S -o avr32/resolve.o
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
avr32/resolve.S:0: error: bad value (ap7000) for -mtune= switch
make[2]: *** [avr32/resolve.o] Error 1
make[2]: Leaving directory `/home/correa/avr32/sources/uClibc-0.9.28/ldso/ldso'
make[1]: *** [ldso] Error 2
make[1]: Leaving directory `/home/correa/avr32/sources/uClibc-0.9.28/ldso'
make: ** [_dir_ldso] Erro 2

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
gcc -Wall -Wstrict-prototypes

If you build uClib it must execute avr32-linux-gcc instead of gcc. So something wrong here.
If you follow "Getting Started" - it must work.
Usually erasing all sources and starting over helps (but sometimes does not:) )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Getting Started" had an error, it said to simply run make when one has to actually run "make CROSS=avr32-linux-"... I've changed it in the wiki.

After building uClib I finally got GCC to fully build! Yay :P
I'm still puzzled thought why I had to rebuild all of those stuff if I had the binaries properly installed from the .deb packages.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you follow

GettingStarted wrote:
Configure uClibc by running make menuconfig. Make sure you specify AVR32 as the target architecture as well as avr32-linux- as a cross-compilation prefix.
then you shouldn't need to specify it on the command line.

Yeah, I wonder why you had to rebuild everything too. Odd, it has worked for me on a number of machines.

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hehe, I thought so. Despite having in menuconfig set it to AVR32 (it was even the default value actually), I still had to check the INSTALL to figure what was the variable.

I did manage to get gcc to build, but now I'm struggling with the install part *g*. Apparently automake didn't substitute the @mkdir_p@ in the makefiles... Updated to 1.8, and rebuilding.... :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Correa wrote:
hehe, I thought so. Despite having in menuconfig set it to AVR32 (it was even the default value actually), I still had to check the INSTALL to figure what was the variable.

GettingStarted wrote:
Configure uClibc by running make menuconfig. Make sure you specify AVR32 as the target architecture as well as avr32-linux- as a cross-compilation prefix.
These are in different places, in fact the cross compilation prefix is pretty much the last thing in the menu.

As for why you still have @mkdir_p@s in your Makefile, that just ain't right either!

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah... well... I'm using Kubunto, latest stable, hopefully some other brave soul using it could try to build those packages so we have a second opinion... but I couldn't manage to get around the @mkdir_p@ after installing all avaliable versions of autoconf, automake. In the end I end up editing the makefiles by hand since what I really wanted was to try out Qtopia :P

I guess I will try the uClib again more carefully just for the sake of testing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also had a mkdir_p problem on two machines and used vim to replace it with mkdir -p. Somewhat boring but works.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or use perl

perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/uc/libstdc++-v3/src/Makefile
perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/uc/libstdc++-v3/libsupc++/Makefile
perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/libstdc++-v3/src/Makefile
perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/libstdc++-v3/libsupc++/Makefile
perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/avr32_ap/libstdc++-v3/src/Makefile
perl -pi -e 's/mkdir_p = \@mkdir_p\@/mkdir_p = mkdir -p/' avr32-linux/avr32_ap/libstdc++-v3/libsupc++/Makefile

Those were the ones I found in my history.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually now I think about it, I had some of these at some stage too. I wonder where they're coming from..? I seem to remember using sed to fix em, but whatever roger's your hammerstein.

-S.