Rockbox Development > Starting Development and Compiling

Some glitches in Rockbox source code on MIPS...

(1/1)

victor:
Hi,
Currently the MIPS toolchain for Rockbox (gcc 4.1.2) seems to be a little outdated.Today I tried to compile Rockbox for Onda VX747 using mips-sde-elf-gcc 4.5.1. The compilation was not smooth, and I found some small glitches in the source code. With some efforts I fixed those problems and finally built Rockbox successfully.
Here is the list of problems I encountered:

@rockbox/apps/codecs/libmad/fixed.h,line 299
#  define MAD_F_MLX(hi, lo, x, y)  \
    asm ("mult  %2,%3"  \
         : "=l" (lo), "=h" (hi)  \
         : "%r" (x), "r" (y))
Since gcc 4.4 the MIPS port no longer recognizes the "h" asm constraint.
It was necessary to remove this constraint in order to avoid generating unpredictable code sequences.
You can achieve the same effect using 128-bit types:
typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
# define MAD_F_MLX(hi, lo, x, y) \
do { \
   u64_di_t __ll = (u64_di_t) (x) * (y); \
   hi = __ll >> 32; \
   lo = __ll; \
}while(0)

@rockbox/apps/codecs/libmusepack/requant.h,line 50
@rockbox/apps/plugins/fft/const.h, line 1-10
@rockbox/apps/plugins/goban/display.h, line 41, line 44
@rockbox/apps/plugins/rockboy/rockmacros.h, line 100
missing "extern". The linker will complain about duplicate symbols.

@rockbox/firmware/target/mips/ingenic_jz47xx/app.lds, line 3
@rockbox/firmware/target/mips/ingenic_jz47xx/boot.lds, line 3
@rockbox/apps/plugins/plugin.lds, line 12
OUTPUT_FORMAT("elf32-littlemips")
Binutil had given up elf32-littlemips since 2.11.90.04.
It Changed Linux/MIPS to use the SVR4 MIPS ABI instead of the IRIX ABI.
The current Linux/MIPS targets are elf32-tradlittlemips for little endian MIPS32.

@rockbox_fix/apps/codecs/libwma/SOURCES, line 3
@rockbox_fix/apps/codecs/libwmapro/SOURCES, line 3
"../lib/ffmpeg_bitstream.c" seems to be unnecessary in SOURCES file.

The attachment is a diff patch.

PS: The link time optimization (-flto) feature of gcc 4.5.1 was still buggy.
When enabled I got "internal compiler error: Segmentation fault" at /apps/plugins/mpegplayer/mpeg_settings.c:1281:6...
Hope it can be fixed in the new release 4.6.0. :)

Regards,
Victor.

Llorean:
Generally speaking, we tell people to use the exact version of compilers our script installs, rather than the newest one.

Newer compilers can always introduce incompatibilities or difficulties.

saratoga:

--- Quote from: victor on March 16, 2011, 09:01:37 AM ---Here is the list of problems I encountered:

--- End quote ---

Post a patch with your changes and an explanation of what they do on the tracker.  

They'll probably be missed on the forums.

victor:
Reported in #FS12013 and #FS12014. Please confirm.

saratoga:
Thanks, hopefully one of the MIPS people can review and commit that.

Navigation

[0] Message Index

Go to full version