Compilation of ARM-ELF Compilation Toolchain
I. Environmental description
PC-CPU: I386
Operating system: Fedora II
Operating system comes with GCC: Version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
Embedded CPU: ARM 920T
Embedded kernel: uclinux-samsung-2510
Embedded graphics system: miniGui-1.3.3
Embedded application: mgdillo (browser)
Second, recompile the reason
1. Solution A 20011219 version ARM-ELF compiler
The purchased test development board comes with the UClinux-Samsung-2510 kernel and its compiler version is 20011219. However, there are many difficulty compilation errors when compiling MiniGUI (the recommended version of the MiniGUI is 20030314).
2. Plan 2 uses the 20030314 version of the ARM-ELF compiler
If the 20030314 version is used to compile the kernel, you can compile, but the code cannot be completely running 1, but you can copy the 20011219 ELF2FLT file to overwrite the original file, and compile the kernel. Then compile MGDILLO, add some serious errors that cannot be corrected when compiling some compilation problems.
Due to the two programs, it may be necessary to upgrade the entire compilation tool according to the network information instructions, so there is a series of work.
Note: 1binfmt_flt: reloc outside program! Init
2 Paragraph error with ld.real
Third, the source code before compilation
1. Download tool chain
Enter http://www.uclinux.org/pub/uclinux/ARM-elf-tools/tools-20030314/ There is a file, see the note column description
File Name Remarks Stlport-4.5.3.patch Requires Stlport-4.5.3.tar.gz Need Binutils-2.10-Full.Patch Need to Upgrade Do not download binutils-2.10.tar.bz2 Need to download Build-uClinux-Tools.sh Need ELF2FLT-20030314.TAR.GZ requires ELF2FLT-CYGWIN-020612.Patch does not require GCC-2.95.3-Arm-mlib.patch requires GCC-2.95.3-ARM-Pic.Patch requires GCC-2.95.3-ARM- Pic.patch2 requires GCC-2.95.3-cygwin-020611.patch does not require GCC-2.95.3-Full.Patch requires GCC-2.95.3-SigSet.patch requires GENROMFS-0.5 .1-cygwin-020605.patch does not require genromfs-0.5.1.tar.gz Need Uclibc-0.9.19.patch.gz Need to upgrade UCLIBC-20030314.tar.gz Need to download
2. Binutils High Version Download
Enter http://ftp.gnu.org/gnu/binutils to download binutils-2.11.2.tar.gz file
3. UCLIBC High Versions Download
Enter http://www.uclibc.org/downloads/ Download file uclibc-0.9.26.tar.gz and uclibc-locale-030818.tgz.
4. Description
All downloaded files are unfained in your own directory.
Fourth, some source code upgrade instructions
1. Binutils upgrade instructions
Unzip binutils-2.11.2.tar.gz to the current directory generate a binutils-2.11.2 directory, some of the operations in the file build-uclinux-tools.sh are struggling to binutils-2.10, so as long as they correspond Modification and comment out the upgrade statement to binutils-2.10. 2. UCLIBC upgrade modification
Different UCLIBC-0.9.26.tar.gz to this directory, generate UCLIBC-0.9.26 directory, and file names are changed to UCLIBC.
Copy Uclibc-local-030818.tgz (no need to decompress) to the uclibc / extra / local directory. Because MgDillo's compilation requires Locale support.
Modify Uclibc / Extra / Configs / Config.in, there is a choice and endchchoice package code in the file, which is the configuration of Malloc. Delete the entire segment. Use the following code
Config malloc
Bool "malloc"
Default Y
Config malloc_simple
Bool "malloc-simple"
Default N
Config malloc_standard
Bool "Malloc-Standard"
Depends on uclibc_has_mmu
Because the compilation configuration confirmation is not allowed throughout the compilation process, all configurations must be completed. However, Choice's code will continue to confirm.
Configure the generated .config file, run in the Uclibc directory
Make oldconfig cross = arm-Elf target_arch = ARM
The configuration operation process will appear and select according to the actual situation. After the configuration is complete, a .config file is generated in the Uclibc directory, which contains the configuration. Copy the file to the Uclibc / Extra / Configs / Directory and renamed config.Arm.default. Here is the content of config.Arm.default I configured.
#
# Automatic Or generated make config: don't edit
#
# Target_alpha is not set
Target_arm = y
# Target_Cris Is Not Set
# Target_e1 is not set
# Target_H8300 IS Not Set
# Target_i386 is not set
# Target_i960 is not set
# Target_m68k is not set
# Target_microblaze is not set
# TARGET_MIPS IS Not Set
# Target_powerPC is not set
# Target_sh is not set
# Target_sparc is not set
# Target_v850 is not set
#
# Target Architecture Features and Options
#
Have_elf = Y
Target_arch = "ARM"
# Config_generic_arm is not set
# Config_arm610 is not set
# Config_arm710 is not set
# Config_arm720t is not set
Config_arm920t = y
# Config_arm922t is not set
# Config_arm926t is not set
# Config_arm_sa110 is not set
# Config_arm_sa1100 is not set # config_arm_xscale is not set
Arch_little_endian = y
# Arch_big_endian is not set
# Arch_HAS_NO_MMU IS Not Set
# Uclibc_has_mmu is not set
Uclibc_has_floats = y
# HAS_FPU IS Not Set
Uclibc_has_soft_float = y
Do_c99_math = Y
WARNINGS = "- wall"
Kernel_source = "/ home / houen / arm-elf-toolschain / linux-2.4.x"
Uclibc_uclinux_broken_munmap = Y
Exclude_brk = Y
C_SYMBOL_PREFIX = ""
Have_dot_config = y
#
# Ger library settings
#
# Have_no_pic is not set
# Dopic is not set
# Have_no_shared is not set
# Arch_HAS_NO_LDSO IS Not Set
# Uclibc_pie_support is not set
Uclibc_ctor_dtor = y
# Uclibc_propolice is not set
# Uclibc_profiling is not set
# HAS_NO_THREADS IS Not Set
Uclibc_has_threads = y
# Pthreads_debug_support is not set
Uclibc_has_lfs = y
Malloc = Y
Malloc_glibc_compat = y
Uclibc_dynamic_atexit = y
# HAS_SHADOW IS Not Set
# Unix98pty_only is not set
# Assume_devpts is not set
# Uclibc_has_tm_extensions is not set
# Uclibc_has_tz_caching is not set
# Uclibc_haas_tz_file is not set
#
# Networking support
#
# Uclibc_has_ipv6 is not set
# Uclibc_has_rpc is not set
#
# String and stdio support
#
Uclibc_has_cType_tables = Y
Uclibc_has_cType_signed = Y
Uclibc_has_cType_unsafe = Y
# Uclibc_has_cType_checked is not set
# Uclibc_has_cType_enforced is not set
Uclibc_has_wchar = y
Uclibc_has_locale = Y
Uclibc_pregenerated_locale_data = Y
# Uclibc_download_pregenerated_locale_data is not set
# Uclibc_has_xlocale is not set
# Uclibc_has_hexadecimal_floats is not set
# Uclibc_has_glibc_digit_grouping is not set
# Uclibc_has_glibc_custom_printf is not set
Uclibc_printf_scanf_positional_args = 9 # uclibc_has_scanf_glibc_a_flag is not set
# Uclibc_has_stdio_bufsiz_none is not set
# Uclibc_has_stdio_bufsiz_256 is not set
# Uclibc_has_stdio_bufsiz_512 is not set
# Uclibc_has_stdio_bufsiz_1024 is not set
# Uclibc_haas_stdio_bufsiz_2048 is not set
Uclibc_has_stdio_bufsiz_4096 = y
# Uclibc_has_stdio_bufsiz_8192 is not set
Uclibc_HAS_STDIO_BUILTIN_BUFFER_NONE = Y
# Uclibc_has_stdio_builtin_buffer_4 is not set
# Uclibc_has_stdio_builtin_buffer_8 is not set
Uclibc_has_stdio_getc_macro = Y
Uclibc_HAS_STDIO_PUTC_MACRO = Y
Uclibc_has_stdio_auto_rw_transition = y
# Uclibc_has_fopen_largefile_mode is not set
# Uclibc_has_fopen_exclusive_mode is not set
# Uclibc_has_glibc_custom_streams is not set
# Uclibc_haas_printf_m_spec is not set
Uclibc_has_errno_messages = Y
# Uclibc_has_sys_ERRLIST IS Not Set
UCLIBC_HAS_SIGNUM_MESSAGES = Y
# Uclibc_has_sys_siglist is not set
# Uclibc_haas_gettext_awareness is not set
Uclibc_has_gnu_getopt = Y
#
# Big and Tall
#
Uclibc_has_regex = y
# Uclibc_has_wordexp is not set
# Uclibc_has_ftw is not set
Uclibc_has_glob = y
#
# Ilbrary installation options
#
Runtime_prefix = "/ usr / $ (target_arch) -linux-uclibc /"
DEVEL_PREFIX = "/ usr / $ (target_arch) -linux-uclibc / usr /"
#
# uclibc development / debugging options
#
# Dodebug is not set
# Doasserts is not set
# Uclibc_malloc_debugging is not set
# Uclibc_mjn3_only is not set
This is theoretically no configuration prompt during the compilation process, but I don't know why. But it can be solved additionally.
Modify the fix_uclibc_config () function of Build-Uclinux-Tools.sh. The Xu change part is as follows
Echo '# uclibc_has_mmu is not set'
echo '# Have_shared is not set'
echo '# build_uclibc_ldso is not set'
Echo '# HAS_SHADOW IS Not set'Echo' malloc = Y '
Echo '# malloc_simple is not set'
echo 'malloc_glibc_compat = y'
Echo '# malloc_930716 is not set'
Echo '# UNIX98pty_only is not set'
echo 'uclibc_ctor_dtor = y'
echo 'uclibc_dynamic_atexit = y'
Echo '# uclibc_malloc_debugging is not set'
echo "uclibc_has_wchar = y"
echo "uclibc_has_locale = y"
echo "uclibc_has_threads = y"
Echo "# dopic is not set"
Modify uclibc / libc / unistd / exec.c, this file doesn't know if it is a bug, when compiling, the file will be compiled many times, and different predefined conditions generate multiple .o files.
L_execl -> Execl.o
L_execv -> EXECV.O
L_execle -> execL.o
L_execlp -> EXECLP.O
L_execvp -> EXECVP.O
There is also a definition of l___exec_alloc in the file. It contains two functions that are not compiled, so link the application generates a link error, no define _exec_alloc and __exec_free. According to the actual situation, I made the following modification, and modified L___exec_alloc to l_execl to compile _exec_alloc and __exec_free into Execl.o.
3. Other modifications
Modify the multilib_table () function of build-uclinux-tools.sh
The note is as follows
#echo "Mbig-endian / fp
#echo "Mbig-endian / fp
#echo "Mbig-endian / Ma
#echo "Mbig-endian / fp
#echo "Mbig-endian / fp
Because the system is small, UCLIBC configuration is also small end.
At the beginning of the build-uclinux-tools.sh file, there is prefix = / usr / local settings the installation path.
V. Compile and maybe Issue
1. Officially compiled
Elf2flt-20030314.tar.gz must be extracted before compilation, generate an ELF2FLT directory. In the current directory, you also need to generate a link to the embedded kernel link name to Linux-2.4.x.
Running in the current path
./build-uclinux-tools.sh build 2> & 1 | TEE Errs
I started compiling.
2. problem solved
There are some STAGE1 Stage2 function call at the end of the build-uclinux-tools.sh file. You can view the progress based on the Stage file generated in the directory. If Stage1 appears, the function stage1 is executed.
In the compilation process, there is a problem, you can comment out of other stages, just debug the wrong Stage. There is also an error file is the process of compilation, which is a great help to the error.
4. Compile the kernel problem
Before compiling the kernel, do the following modification: kernel path / uclibc / config --------- kernel_source = ../../linux-2.4.x kernel path /Linux-2.4.x/arch/armnommu/kernel/ Process.c Add #include
The latest idea:
Since the compiler of Huaheng must compile Huaheng kernels, it is suspected that it also has a hands-on the kernel, causing binfmt_flt: reloc outside program phenomenon. It may be that the kernel parses the FLAT format changes, so the standard uclinux's binfmt_flat.c is overridden to Linux-2.4.x / fs /. Elf2flt uses standard procedures to compile trial operation.
5.
Sixth, the compilation environment of joining miniGUI is compiled in Fedora to generate an error, which should be an error of the assembled statement.
You can modify it as follows in the original file ("ABCD" ... "modified to (" ABCD "empty line ... hypothesis path is / usr / local cc = ARM-ELF-GCC Ar = ARM-ELF -ar ranlib = arm-elf-ranlib ldflags = "- elf2flt" ./configure / --prefix = "/ usr / local / arm-Elf" / --Host = arm-Elf / --build = i386-linux / --disable-shared / --enable-limited = yes / --enable-video-fbcon = yes / --enable-nativegal = yes / --enable-native = yes / --enable-newgal = yes / Enable-timerunitms = no / --enable-nativegalqvfb = no / --enable-fblin16 = no / --enable-fblin24 = no / --enable-fblin32 = yes / --enable- Dummyial = yes / --enable-qvfbial = no / --enable-nativeps2 = no / --enable-nativeMs = no / --enable-nativeMs3 = no / --enable-nativeGPM =Nenable-nativeGPM = NO / --ENABLE-NATIVEGPM = NO / --ENABLE-TEXTMODE = NO / --ENABLE-RBFSUPPORT = YES / --ENABLE-RBFGB12 = no / --enable-vbfsupport = no / --enable-fontsserif = no / --enable-fontcourier = no / --enable-fontsymbol = no / --enable-fontvgas = no / --enable-qpfsupport = no / --enable-ttfsupport = no / --enable-type1support = no / --disab Le-ttfsupport / --enable-latin2support = no / --enable-latin3support = no / --enable-latin4support = no / --enable-latin9support = yes / --enable-gbsupport = yes / --enable-gbksupport = NO / --ENABLE-BIG5SUPPORT = no / --enable-unicoidesupport = no / --enable-savebitmap = yes / --enable-gifsupport = yes / --enable-jpgsupport = no / --enable-pngsupport = no / --Nable-Imegb2312 = no / --enable-Imegb2312py = no / --enable-Aboutdlg = YES / --Nable-SAVESCREEN = no / --enable-tinyScreen = no / --enable-extfullgif = no / - Enable-video-dummy =