lixuewei / rt-n56u

Automatically exported from code.google.com/p/rt-n56u
0 stars 0 forks source link

Need help getting gcc 4.8.2 to work, please #1206

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, 

I wondering if somebody could help me get gcc 4.8.2 to work. I've gotten 4.7.3 
to work 
(https://github.com/moonman/rt-n56u/tree/master/toolchain-rt3883/src/mipsel-linu
x-uclibc-toolchain) and it works well (I haven't noticed any problems) but 
4.8.2 always fails miserably at the same place:

make[2]: Entering directory `/root/rt-n56u/trunk/user/libdisk'
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o usb_info.o usb_info.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o disk_io_tools.o disk_io_tools.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o disk_initial.o disk_initial.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o disk_share.o disk_share.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o disk_swap.o disk_swap.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-ld 
-shared -o libdisk.so usb_info.o disk_io_tools.o disk_initial.o disk_share.o 
disk_swap.o /root/rt-n56u/trunk/user/shared/shutils.o
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include   
-c -o test_share.o test_share.c
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/bin/mipsel-linux-uclibc-gcc 
-march=74kc -mtune=74kc -Os -fomit-frame-pointer -pipe  -Dlinux -D__linux__ 
-Dunix -DEMBED -I/root/rt-n56u/trunk/stage/include -Wall -Wno-trigraphs 
-Wno-strict-aliasing -Wno-pointer-sign -Wno-unused-but-set-variable 
-fno-aggressive-loop-optimizations -DBOARD_N56U -DBOARD_RAM_SIZE=128 -fPIC -I. 
-I/root/rt-n56u/trunk/user/shared -I/root/rt-n56u/trunk/user/shared/include 
-L/root/rt-n56u/trunk/user/shared -lshared -o test_share test_share.o libdisk.so
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/lib/gcc/mipsel-linux-uclibc/4.8.2
/../../../../mipsel-linux-uclibc/bin/ld: test_share: hidden symbol `__udivdi3' 
in 
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/lib/gcc/mipsel-linux-uclibc/4.8.2
/libgcc.a(_udivdi3.o) is referenced by DSO
/root/rt-n56u/toolchain-rt3883/toolchain-3.0.x/lib/gcc/mipsel-linux-uclibc/4.8.2
/../../../../mipsel-linux-uclibc/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [test_share] Error 1
make[2]: Leaving directory `/root/rt-n56u/trunk/user/libdisk'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/rt-n56u/trunk/user'
make: *** [user_only] Error 2

I've tried adding -lgcc to the makefile in libdisk already, tried looking for a 
gcc patch to fix this without any luck. It seems to be caused by some function 
that divides unsigned long long by something else.

Original issue reported on code.google.com by moonman...@gmail.com on 4 Apr 2014 at 11:20

GoogleCodeExporter commented 9 years ago
Alright... I noticed that Padavan changed the source of libdisk, so I tried it 
today again and it compiled. Gcc 4.8.2 works now! Thanks Andy! Спасибо :)

Original comment by moonman...@gmail.com on 29 Apr 2014 at 10:30

GoogleCodeExporter commented 9 years ago
BTW the main reason for me trying to get it to work was the new optimizations, 
specifically:
- GCC now generates better DSP code for MIPS 74k cores thanks to further 
scheduling optimizations.
It might be the placebo effect, but the f/w does seem a little snappier.

Original comment by moonman...@gmail.com on 29 Apr 2014 at 10:33

GoogleCodeExporter commented 9 years ago
Just some info for anyone trying to accomplish the same:
Kernel needs patching. I found the patch for 3.5 which works for 3.4. I had to 
create a similar patch for 3.0 myself. Both are located here: 
https://github.com/moonman/rt-n56u/tree/master/trunk/patches

Patches for gcc are located here:
https://github.com/moonman/rt-n56u/tree/master/toolchain-rt3883/src/mipsel-linux
-uclibc-toolchain/patches

I left CFLAGS += -fno-aggressive-loop-optimizations commented because without 
it there is more optimization by gcc and in my testing I didn't notice any 
breakage.

Original comment by moonman...@gmail.com on 1 May 2014 at 4:33