Two years ago, cegcc0.51 was used for porting some Linux functional libraries (the code was downloaded and re-compiled by myself. During the past two days, I had nothing to worry about porting pixman to wince, and I found that it had been updated to 0.59.1. At the moment, I started code compilation again, record the problems that have occurred. Note that there are three cross-compiling environments on SF, cygwin is used in windows, and cegcc and mingw32ce are used in Linux. Since pixman is used in Linux, download cegcc for compilation.
Preparation: I am using VMware 7.1 + Ubuntu 11.10. Considering that the GCC version of ubuntu 11.10 is 4.6 and cegcc is 4.4.0, we need to reduce the GCC version of ubuntu to 4.4.5 to avoid some inexplicable problems, in addition, you need to install basic libraries such as texinfo, flex, Bison, and gawk, create a directory named cegcc to store the local code downloaded from SVN.
Cegcc itself provides a compilation script build-cegcc.sh, but it can only compile a single module, so you can first create a directory cegcc-builds (I am built at the same level as the source directory) used to store the intermediate compilation files, and then create another script file in this directory for batch compilation. The content is as follows:
../Cegcc/src/scripts/build-cegcc.sh -- prefix = $ cegcc_path -- components = "binutils bootstrap_gcc w32api newlib dummy_cegccdll GCC cegccdll cegccthrddll libstdcppdll profile"
Based on the previous compilation experience of 0.51, considering that an error occurs during compilation of a module, you can specify only one components parameter so that you can pass it one by one, avoid compiling all errors every time. (Note: if an error occurs, you do not need to re-execute it. It will re-configure it, as long as you enter the corresponding directory and modify it to make it ).
Compilation of binutils was successful, but when compiling to bootstrap_gcc, we found that gcc4.4.0 needed support from GMP and mpfr, according to the statement on the Internet as long as the source code of the two libraries to the GCC root directory can be, So download the gmp4.3.1 and mpfr3.1.1 put in the gcc-4.4.0 directory, then compile the prompt that the mpfr cannot be found. h, the original 3.1.1 directory structure has been adjusted to put the source file to the src directory rather than its root directory, re-download 3.1.0 compilation prompt can not find the gmp-impl.h and Longlong. h. The two files are in GMP, And the configuration files point to the GMP under cegcc-builds. These two files are not copied, add a line of path setting before the first make in the build_bootstrap_gcc function in the build-cegcc.sh.
...
Cppflags = "-I $ {base_directory}/$ {gcc_src}/GMP "\
Make $ {parallelism} All-gcc
...
If -- With-GMP-include =$ {base_directory}/$ {gcc_src}/GMP is added, the error "do not use -- With-GMP- build and other -- With-GMP options simultaneously ", because -- With-GMP-build is used in mpfr, this option is estimated to be used when the system has installed the GMP and mpfr libraries and does not need to compile the source code separately (note: later, it was found that if the mpfr and GMP components are installed in cygwin, you do not need to download the source code to make the above changes)
W32api, newlib, and dummy_cegccdll are no problem. GCC and bootstrap_gcc are the same problem, and the solution is the same.
After these modifications, You can compile the required toolchain. Now, pixman compilation is started.
I'm using the pixman-0.24, the configuration script is as follows
Path =/opt/cegcc/bin: $ path \
./Configure -- Host = arm-cegcc -- prefix =/usr/wince -- enable-static -- disable-shared
Note that static compilation is required; otherwise, _ imp ___ nedf2 redefinition errors will be reported. Even static compilation may have some warnings. I think this may be related to cegcc, I have not done any further research. Another error is that libtool is not installed. After compilation, make install generates the corresponding library and header file under/usr/wince, and the test program under test is also generated. The program under demos is related to GTK +, therefore, no compilation is required. It is estimated that GTK + must be generated for compilation.
Last question: how can we add SIMD and Neno functions?
You can use cygwin + mingw32ce for compiling to generate a library that supports neon, but make some modifications:
1. Modify configure to support neon
Use the # ifndef _ arm_eabi _ macro definition segment to contain # ifndef _ win32_wce. The Eabi is used for elf target.
2. Add @ In Front Of The. eabi_attribute directive for the same reason. In the Assembly file, the pseudo commands must be modified first.
3. Configure Parameters
Ldflags = "-l/usr/wince/lib" cflags = "-I/usr/wince/include-d_win32_wce" png_cflags = "/usr/wince/include/libpng15" png_libs = "-l/usr/wince/lib-lpng" pkg_config_path = "/usr/wince/lib/pkgconfig" cc = arm-mingw32ce-gcc AR = arm-mingw32ce-ar LD = arm-mingw32ce-ld. /configure
-- Prefix =/usr/wince -- Host = arm-mingw32ce
/Usr/wince is the place where all transplanted inventory is stored. pixman can use PNG as backend.