· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Jin LiveCD/Uc Libc

uClibc toolchain 설치

[root@localhost buildroot]# ls
CVS        config.arm    config.mips     config.sh4  target
Config.in  config.armeb  config.mipsel   docs        toolchain
Makefile   config.i386   config.powerpc  package
[root@localhost buildroot]# cd toolchain/
[root@localhost toolchain]# ls
CVS        Makefile.in  ccache  gdb             patch-kernel.sh
Config.in  binutils     gcc     kernel-headers  uClibc
[root@localhost toolchain]# cd ../package/
[root@localhost package]# ls
CVS          diffutils      iptables       microcom      patch      tar
Config.in    distcc         jpeg           microwin      pciutils   tinylogin
Makefile.in  dnsmasq        less           mkdosfs       pcmcia     tinyx
autoconf     dropbear_sshd  libfloat       mke2fs        portage    tn5250
automake     ed             libglib12      mpg123        portmap    ttcp
bash         fakeroot       libmad         mrouted       pppd       udhcp
berkeleydb   file           libpng         nano          procps     util-linux
bison        findutils      libtool        ncurses       python     valgrind
boa          flex           links          netkitbase    raidtools  vtun
bridge       gawk           linux          netkittelnet  rsync      wget
busybox      gettext        lrzsz          netsnmp       rxvt       which
bzip2        grep           ltp-testsuite  newt          sed        wtools
config       gzip           ltrace         ntp           sfdisk     zlib
coreutils    hostap         lzo            openssh       slang
customize    hotplug        m4             openssl       socat
dhcp_relay   iproute2       make           openvpn       strace
  • make menuconfig
  • Target Architecture (i386): hardware
  • Build options
  • Toolchain Options
    • Kernel Header Options
    • uClibc Options
    • Binutils Options
    • Gcc Options
    • Ccache Options
    • Gdb Options
    • Common Toolchain Options
  • Package Selection for the target
  • Target Options : target file system

    • BR2_KERNEL_HEADERS_2_6_12=y
    • BR2_GCC_VERSION_4_0_0=y
    • BR2_GCC_VERSION="4.0.0"
    • BR2_CCACHE=y
    • BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"

  • busybox config

  • make
    • 설정된 파일들을 wget 을 이용하여 다운로드
    • binutils 다운로드하고 컴파일 (시간이 제법 걸릴 것임)
      • 오류 발생
      • FC4 의 binutil 사용해 봄 같은 오류 발생
      • 원상 복귀
      • binutil-2.16.1 로 변경 통과
    • gcc 다운로드하고 컴파일 (역시 시간이 제법 걸릴까?)
    • rootfs.i386.ext2 생성됨
    • kernel include 와 busybox 를 변경시키고 만들어야 함.
      • DL_DIR : dl
      • BUILD_DIR : build_i386
      • TOOL_BUILD_DIR : toolchain_build_i386
      • STAGING_DIR : /buildroot/build_i386/staging_dir
      • /buildroot/toolchain_build_i386/linux/include 를 바꾸었음.
        touch $(LINUX_HEADERS_DIR)/.configured
        mv $(LINUX_HEADERS_DIR)/include $(LINUX_HEADERS_DIR)/include.org
        cp -Rp /usr/src/linux/include $(LINUX_HEADERS_DIR)/

buildroot Makefile

  • TOPDIR=./
  • CONFIG_CONFIG_IN = Config.in
  • CONFIG_DEFCONFIG = .defconfig
  • CONFIG = package/config
  • noconfig_targets := menuconfig config oldconfig randconfig \
  • defconfig allyesconfig allnoconfig clean distclean \
  • release tags
Variables defined with `=' are recursively expanded variables. Variables defined with `:=' are simply expanded variables;

foo = $(bar)
bar = $(ugh)
ugh = Huh?

all:;echo $(foo)

will echo `Huh?': `$(foo)' expands to `$(bar)' which expands to `$(ugh)' which finally expands to `Huh?'.

CFLAGS = $(include_dirs) -O
include_dirs = -Ifoo -Ibar

will do what was intended: when `CFLAGS' is expanded in a command, it will expand to `-Ifoo -Ibar -O'. 


because it will cause an infinite loop in the variable expansion. (Actually make detects the infinite loop and reports an error.)
  • ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  • -include $(TOPDIR).config
  • endif
    • .config 파일이 없어도 오류발생하지 않음.
    • 즉 make menuconfig 등을 사용하면, .config 가 없어도 menuconfig 를 수행하도록 하는 것임.
    • make menuconfig 를 하면, package/config 밑에 있는 mconf 를 수행함.
    • filter $(noconfig_targets),$(MAKECMDGOALS)
      • $(MAKECMDGOALS) 중에 $(noconfig_targets) 와 일치하는 것이 있으면 리턴함.
MAKECMDGOALS: The targets given to make on the command line. Setting this variable has no effect on the operation of make.
If an included makefile cannot be found in any of these directories, a warning message is generated, but it is not an immediately fatal error; processing of the makefile containing the include continues. Once it has finished reading makefiles, make will try to remake any that are out of date or don't exist. See section How Makefiles Are Remade. Only after it has tried to find a way to remake a makefile and failed, will make diagnose the missing makefile as a fatal error.

If you want make to simply ignore a makefile which does not exist and cannot be remade, with no error message, use the -include directive instead of include, like this:


-include filenames...

This acts like include in every way except that there is no error (not even a warning) if any of the filenames do not exist.
  • ifeq ($(BR2_TAR_VERBOSITY),y)
  • TAR_OPTIONS=-xvf
  • else
  • endif

  • ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
    • BR2_HAVE_DOT_CONFIG 가 y 면 endif 까지 수행.
strip 를 사용하는 것은 보다 안전하게 하기 위해서임.
Removes leading and trailing whitespace from string and replaces each internal sequence of one or more whitespace characters with a single space.
  • TARGETS:=host-sed kernel-headers uclibc-configured binutils gcc uclibc-target-utils
  • include toolchain/Makefile.in
# FIXME -- this is temporary
# gcc has a bunch of needed stuff....
include toolchain/gcc/Makefile.in

 * -Os 
Optimize for size.  -Os enables all -O2 optimizations that do not
typically increase code size.  It also performs further optimiza-
tions designed to reduce code size.

-Os disables the following optimization flags: -falign-functions
-falign-jumps  -falign-loops -falign-labels  -freorder-blocks
-freorder-blocks-and-partition -fprefetch-loop-arrays

If you use multiple -O options, with or without level numbers, the
last such option is the one that is effective.

 * -pipe : For a big program involving a lot of inter linked files and functions, temporary files tend to get created while compilation. When this option is specified, the compiler makes use of pipes rather than creating temporary files. The output of each function is piped to the next. The swap space is used instead.

endif ( y 로 되어야 문제가 없는 것으로 보임.)
옵션과 버전에 따라 다음 변수를 설정함.

  • include package/Makefile.in
MAKE=make -j$(BR2_JLEVEL)

 * -j jobs
Specifies the number of jobs (commands) to run simultaneously.  If
there  is  more than one -j option, the last one is effective.  If
the -j option is given without an argument, make  will  not  limit
the number of jobs that can run simultaneously.

# Strip off the quoting

ifneq ($(BR2_LARGEFILE),y)
DISABLE_LARGEFILE= --disable-largefile
$(TARGET_OPTIMIZATION) 을 -march=i386 -mcpu=i686 으로 만드는 것이 좋을 것 같음.
BASE_DIR:=${shell pwd}
 * BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
 * TARGET_CROSS: build_i386/staging_dir/bin/i386-linux-uclibc-
STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
 * [root@localhost buildroot]# gcc -dumpmachine
 * i386-redhat-linux

                AR=$(TARGET_CROSS)ar \
                AS=$(TARGET_CROSS)as \
                LD=$(TARGET_CROSS)ld \
                NM=$(TARGET_CROSS)nm \
                CC=$(TARGET_CROSS)gcc \
                GCC=$(TARGET_CROSS)gcc \
                CXX=$(TARGET_CROSS)g++ \
                RANLIB=$(TARGET_CROSS)ranlib \

ifeq ($(ENABLE_LOCALE),true)
  • all: world
    • This should be the default target.
  • $(DL_DIR) $(BUILD_DIR)
    • dl, build_i386 디렉토리 생성
  • $(STAGING_DIR)은 build_i386/staging_dir 임
    • $(STAGING_DIR) 디렉토리 밑에 lib, include, i386-linux-uclibc 디렉토리 생성
    • $(REAL_GNU_TARGET_NAME) 은 i386-linux-uclibc 임
    • ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
  • $(TARGET_DIR): 은 build_i386/root 임
  • if -f "$(TARGET_SKELETON)" ; then \
  • zcat $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \
  • fi;
  • if -d "$(TARGET_SKEL_DIR)" ; then \
  • cp -a $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \
  • fi;
  • touch $(STAGING_DIR)/fakeroot.env
  • -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
  • -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
    • $(BUILD_DIR)/root 가 없으면 다음 작업 수행
    • $(TARGET_SKELETON) 이 있으면, uncompress 해서 root 디렉토리 생성
    • $(TARGET_SKEL_DIR) 이 있으면 root 밑에 복사

  • $(TARGETS)
    • TARGETS:=host-sed kernel-headers uclibc-configured binutils gcc uclibc-target-utils
 * package/sed/sed.mk
host-sed: $(HOST_SED_TARGET)
 * toolchain/kernel-headers/kernel-headers.mk
kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 * toolchain/uClibc/uclibc.mk
uclibc-configured: $(UCLIBC_DIR)/.configured
 * toolchain/binutils/binutils.mk
binutils: binutils-dependancies $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld
 * toolchain/gcc/gcc-uclibc-3.x.mk
gcc: uclibc-configured binutils gcc_initial $(LIBFLOAT_TARGET) uclibc \
        $(TARGET_DIR)/lib/libgcc_s.so.1 $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS)
 * toolchain/uClibc/uclibc.mk
uclibc-target-utils: $(TARGET_DIR)/usr/bin/ldd
 * 이 외에 .mk 파일에서 TARGETS+=busybox 와 같이 TARGETS 에 추가를 하기도 함.

  • include .config.cmd
  • include toolchain/*/*.mk
  • include package/*/*.mk
  • include target/*/*.mk

  • host-sed: $(HOST_SED_TARGET)
    • HOST_SED_TARGET=$(shell package/sed/sedcheck.sh)
    • /usr/bin/sed 나 /bin/sed 가 없으면 build-sed-host-binary 를 수행하고 아니면 use-sed-host-binary 수행함
build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
        @if [ -L $(HOST_SED_DIR)/$(SED_TARGET_BINARY) ] ; then \
                rm -f $(HOST_SED_DIR)/$(SED_TARGET_BINARY); fi;
        -ot $(SED_DIR1)/$(SED_BINARY) ] ; then \
            set -x; \
            mkdir -p $(HOST_SED_DIR)/bin; \
            $(MAKE) DESTDIR=$(HOST_SED_DIR) -C $(SED_DIR1) install; \
            mv $(HOST_SED_DIR)/usr/bin/sed $(HOST_SED_DIR)/bin/; \
            rm -rf $(HOST_SED_DIR)/share/locale $(HOST_SED_DIR)/usr/info \
                    $(HOST_SED_DIR)/usr/man $(HOST_SED_DIR)/usr/share/doc; fi

        @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
            if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
            mkdir -p $(HOST_SED_DIR)/bin; \
            rm -f $(HOST_SED_DIR)/$(SED_TARGET_BINARY); \
            ln -s $$SED $(HOST_SED_DIR)/$(SED_TARGET_BINARY)
  • kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 * dl 에 linux-libc-headers- 이 없으면 wget 으로 가지고 온다.
 * $(LINUX_HEADERS_DIR)에 .unpacked 파일이 없으면, $(TOOL_BUILD_DIR) 에 uncopmress 하고, touch .unpacked
 * $(LINUX_HEADERS_DIR)에 .patched파일이 없으면, toolchain/patch-kernel.sh 수행
 * $(LINUX_HEADERS_DIR)에 .configured 파일이 없으면, $(LINUX_HEADERS_DIR)/include/asm 의 링크를 새로 만들고, Makefile 에 버전관련 부분을 넣음. 
  • uclibc-configured: $(UCLIBC_DIR)/.configured
    • wget, uncompress, and patch-kernel.sh 수행
    • .config 수정
    • 필요한 디렉토리 생성
    • $(MAKE1) -C $(UCLIBC_DIR) \
    • PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
    • DEVEL_PREFIX=/usr/ \
    • RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
    • HOSTCC="$(HOSTCC)" \
    • pregen install_dev;
MAKE=make -j$(BR2_JLEVEL)
`-C dir'
    Change to directory dir before reading the makefiles. If multiple `-C' options are specified, each is interpreted relative to the previous one: `-C / -C etc' is equivalent to `-C /etc'. This is typically used with recursive invocations of make (see section Recursive Use of make).
pregen: headers
  • binutils: binutils-dependancies $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld
    • binutils-dependancies: bison, flex, msgfmt(gettext) 가 있어야 함. 아니면 오류 발생

$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump        $(MAKE) -C $(BINUTILS_DIR1) install
$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
        $(MAKE) -C $(BINUTILS_DIR1) all
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
        mkdir -p $(BINUTILS_DIR1)
        (cd $(BINUTILS_DIR1); \
                $(BINUTILS_DIR)/configure \
                --prefix=$(STAGING_DIR) \
                --build=$(GNU_HOST_NAME) \
                --host=$(GNU_HOST_NAME) \
                --target=$(REAL_GNU_TARGET_NAME) \
                $(DISABLE_NLS) \
                $(MULTILIB) \
                --disable-werror \
                $(SOFT_FLOAT_CONFIG_OPTION) );
        touch $(BINUTILS_DIR1)/.configured
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
        # Apply appropriate binutils patches.
        toolchain/patch-kernel.sh $(BINUTILS_DIR) toolchain/binutils/$(BINUTILS_VERSION) \*.patch
        touch $(BINUTILS_DIR)/.patched
        mkdir -p $(TOOL_BUILD_DIR)
        touch $(BINUTILS_DIR)/.unpacked
        mkdir -p $(DL_DIR)
  • TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
  • TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
  • TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))

$(subst from,to,text)
    Performs a textual replacement on the text text: each occurrence of from is replaced by to. The result is substituted for the function call.
$(patsubst pattern,replacement,text)
    Finds whitespace-separated words in text that match pattern and replaces them with replacement. Here pattern may contain a `%' which acts as a wildcard, matching any number of any characters within a word. If replacement also contains a `%', the `%' is replaced by the text that matched the `%' in pattern. Only the first `%' in the pattern and replacement is treated this way; any subsequent `%' is unchanged.
  • .PHONY: all world clean dirclean distclean source $(TARGETS) \
  • .PHONY: all world clean dirclean distclean source $(TARGETS) \
A phony target is one that is not really the name of a file. It is just a name for some commands to be executed when you make an explicit request. There are two reasons to use a phony target: to avoid a conflict with a file of the same name, and to improve performance.

If you write a rule whose commands will not create the target file, the commands will be executed every time the target comes up for remaking. Here is an example:


        rm *.o temp

Because the rm command does not create a file named `clean', probably no such file will ever exist. Therefore, the rm command will be executed every time you say `make clean'.

The phony target will cease to work if anything ever does create a file named `clean' in this directory. Since it has no prerequisites, the file `clean' would inevitably be considered up to date, and its commands would not be executed. To avoid this problem, you can explicitly declare the target to be phony, using the special target .PHONY (see section Special Built-in Target Names) as follows:


.PHONY : clean

Once this is done, `make clean' will run the commands regardless of whether there is a file named `clean'.

uclibc makefile

  • config 시행하여 .config 파일 생성
  • headers 에서는 필요한 include 파일 링크
  • pregen 에서는 먼저 만들어 놓은 locale 이 있으면 이를 적용.
  • subdirs 에서 필요한 라이브러리 생성
  • shared 에서 shared libtary 생성
  • finished 는 echo 만 함.
noconfig_targets := menuconfig config oldconfig randconfig \
        defconfig allyesconfig allnoconfig clean distclean \
        release tags TAGS
include Rules.mak

DIRS = ldso libc libcrypt libresolv libnsl libutil libm libpthread librt
        DIRS += libintl

ifeq ($(strip $(HAVE_DOT_CONFIG)),y)

all: headers pregen subdirs shared finished
  • headers: include/bits/uClibc_config.h
  • include/bits/uClibc_config.h: .config
include/bits/uClibc_config.h: .config
        @if [ ! -x ./extra/config/conf ] ; then \
            $(MAKE) -C extra/config conf; \
 * extra/config 밑에 conf 실행 파일이 없으면, extra/config 의 makefile 을 수행함. (make conf)
 * make conf 는 conf 실행 파일을 만듬.
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
 * INSTALL 은 Rules.mak 에 install 로 정의되어 있음.
 * sh 명령임.
  * 단지 include/bits 디렉토리를 만드는 것으로 생각됨.
        @./extra/config/conf -o extra/Configs/Config.in
 * extra/config/conf 를 실행하여 extra/Configs 밑에 Config.in 을 입력파일로 사용하여 .confog 파일을 생성함.
  * extra/config/conf.c
  * extra/config/confdata.c
   * .config 파일은 이 곳에 정의되어 있음.
headers: include/bits/uClibc_config.h
        @$(SHELL_SET_X); \
 * Rules.mak 에 정의되어 있음. set -x 또는 set +x
        ./extra/scripts/fix_includes.sh \
                -k $(KERNEL_SOURCE) -t $(TARGET_ARCH) \
 * Target_ARCH 에 필요한 include 파일이 있는가 점검 
        @cd include/bits; \
        set -e; \
        for i in `ls ../../libc/sysdeps/linux/common/bits/*.h` ; do \
                $(LN) -fs $$i .; \
        done; \
        if [ -d ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits ] ; then \
                for i in `ls ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h` ; do \
                        $(LN) -fs $$i .; \
                done; \
 * include/bits 디렉토리 밑에 필요한 파일들을 링크 시킴.
 * buildroot/toolchain_build_i386/uClibc/include/bits 밑에는 아무 것도 없음.
 * 어디에선가 지운 것인지? 
        @cd include/sys; \
        set -e; \
        for i in `ls ../../libc/sysdeps/linux/common/sys/*.h` ; do \
                $(LN) -fs $$i .; \
        done; \
        if [ -d ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
                for i in `ls ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h` ; do \
                        $(LN) -fs $$i .; \
                done; \
 * include/sys 밑에 필요한 파일을 링크함.
        @cd $(TOPDIR); \
        set -e; \
        $(SHELL_SET_X); \
        TOPDIR=. CC="$(CC)" /bin/sh extra/scripts/gen_bits_syscall_h.sh > include/bits/sysnum.h.new; \
        if cmp include/bits/sysnum.h include/bits/sysnum.h.new >/dev/null 2>&1; then \
                $(RM) include/bits/sysnum.h.new; \
        else \
                mv -f include/bits/sysnum.h.new include/bits/sysnum.h; \
        $(MAKE) -C libc/sysdeps/linux/common headers
        $(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) headers
 * include 밑에 fpu_control.h 를 링크 시킴. 
  • pregen
    • locale 관련 작업을 함.
    • locale 를 넣을 것인가? 한글 codeset 을 지원하지 않는 것 같음.
    • 잊어 버릴 것
  • subdirs
DIRS = ldso libc libcrypt libresolv libnsl libutil libm libpthread librt
subdirs: $(patsubst %, _dir_%, $(DIRS))
$(patsubst %, _dir_%, $(DIRS)): headers
        $(MAKE) -C $(patsubst _dir_%, %, $@)
DIRS 의 각 디렉토리로 가서 make 를 수행함.
  • shared
    • shared library 생성
    • lib 로 시작하고 .so 로 끝나는 라이브러리임.
shared: subdirs
ifeq ($(strip $(HAVE_SHARED)),y)
        $(SECHO) Building shared libraries ...
        @$(MAKE) -C libc shared
        @$(MAKE) -C ldso shared
        @$(MAKE) -C libcrypt shared
        @$(MAKE) -C libresolv shared
        @$(MAKE) -C libnsl shared
        @$(MAKE) -C libutil shared
        @$(MAKE) -C libm shared
        @$(MAKE) -C libpthread shared
        @$(MAKE) -C librt shared
        @$(MAKE) -C libintl shared
        $(SECHO) Not building shared libraries ...
  • finished
finished: shared
        $(SECHO) Finally finished compiling ...
  • install_dev
    • PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/
    • DEVEL_PREFIX=/usr/
        $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
        $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
        -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
        if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
                extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
        else \
                extra_exclude="" ; \
        fi ; \
        tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
                | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
        # Remove floating point related headers since float support is disabled.        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/complex.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fpu_control.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ieee754.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/math.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tgmath.h
ifneq ($(strip $(UCLIBC_HAS_WCHAR)),y)
        # Remove wide char headers since wide char support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wctype.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wchar.h
ifneq ($(strip $(UCLIBC_HAS_LOCALE)),y)
        # Remove iconv header since locale support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/iconv.h
ifneq ($(strip $(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF)),y)
        # Remove printf header since custom print specifier support is disabled.        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/printf.h
ifneq ($(strip $(UCLIBC_HAS_XLOCALE)),y)
        # Remove xlocale header since extended locale support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/xlocale.h
ifneq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
        # Remove libintl header since gettext support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/libintl.h
ifneq ($(strip $(UCLIBC_HAS_REGEX)),y)
        # Remove regex headers since regex support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regex.h
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h
ifneq ($(strip $(UCLIBC_HAS_WORDEXP)),y)
        # Remove wordexp header since wordexp support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wordexp.h
ifneq ($(strip $(UCLIBC_HAS_FTW)),y)
        # Remove ftw header since ftw support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ftw.h
ifneq ($(strip $(UCLIBC_HAS_GLOB)),y)
        # Remove glob header since glob support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/glob.h
ifneq ($(strip $(UCLIBC_HAS_GNU_GETOPT)),y)
        # Remove getopt header since gnu getopt support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/getopt.h
ifneq ($(strip $(HAS_SHADOW)),y)
        # Remove getopt header since shadow password support is disabled.
        $(RM) $(PREFIX)$(DEVEL_PREFIX)include/shadow.h
        -@for i in `find  $(PREFIX)$(DEVEL_PREFIX) -type d` ; do \
            chmod 755 $$i; chmod 644 $$i/*.h > /dev/null 2>&1; \
        -find $(PREFIX)$(DEVEL_PREFIX) -name .svn | xargs $(RM) -r;
        -chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$$/\1:\2/'` $(PREFIX)$(DEVEL_PREFIX)
ifeq ($(strip $(HAVE_SHARED)),y)
        for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
        sed -e 's/lib\///'` ; do \
                $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \
ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
        $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \                $(PREFIX)$(DEVEL_PREFIX)lib/libthread_db.so
#       # If we build shared libraries then the static libs are PIC...
#       # Make _pic.a symlinks to make mklibs.py and similar tools happy.
        for i in `find lib/  -type f -name '*.a' | sed -e 's/lib\///'` ; do \
                $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \
                        | sed -e 's/\.a$$/_pic.a/'`; \
        # Ugh!!! Remember that libdl.a and libdl_pic.a are different.  Since
        # libdl is pretty small, and not likely to benefit from mklibs.py and
        # similar, lets just remove libdl_pic.a and avoid the issue
        rm -f $(PREFIX)$(DEVEL_PREFIX)lib/libdl_pic.a
cd extra/locale
cat >codesets.txt «EOF
cat >locales.txt «EOF
@euro e
@cyrillic c
UTF-8 yes
8-BIT yes
en_US ISO-8859-1
en_US.UTF-8 UTF-8
        tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
                | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
 * include 디렉토리의 tar 파일을 만드는데, .svn, CVS 는 제외한다.
 * 이를 $(PREFIX)$(DEVEL_PREFIX) 밑에 푼다.

root@localhost ~# mv UCLIBC /mnt/hdc3 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/frv/fr450-insn.s': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/h8300/h8sx_rtsl.s': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/h8300/t04_sub.exp': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/h8300/t07_ari3.exp': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/h8300/t09_xor.exp': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/h8300/t11_logs.exp': 입력/출력 오류 mv: reading `UCLIBC/buildroot/toolchain_build_i386/binutils-2.16.1/gas/testsuite/gas/hppa/basic/basic.exp': 입력/출력 오류


mkdir -p dl
mkdir -p build_i386
mkdir -p build_i386/staging_dir/lib
mkdir -p build_i386/staging_dir/include
mkdir -p build_i386/staging_dir/i386-linux-uclibc
ln -sf ../lib build_i386/staging_dir/i386-linux-uclibc/lib

zcat target/default/skel.tar.gz | tar -C build_i386 -xf -
cp -a target/default/target_skeleton/* build_i386/root/
find build_i386/root -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1

[root@localhost bin]# pwd
[root@localhost bin]# ls -l
합계 0
lrwxrwxrwx  1 root root 8  9월  5 00:41 sed -> /bin/sed

[root@localhost buildroot]# make
mkdir -p /root/buildroot/toolchain_build_i386
bzcat /root/buildroot/dl/uClibc-snapshot.tar.bz2 | tar -C /root/buildroot/toolchain_build_i386 -xf -
touch /root/buildroot/toolchain_build_i386/uClibc/.unpacked
's,^CROSS=.*,CROSS=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-,g' /root/buildroot/toolchain_build_i386/uClibc/Rules.mak
make: s,^CROSS=.*,CROSS=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-,g: 명령을 찾지 못했음
make: *** [/root/buildroot/toolchain_build_i386/uClibc/.configured] 오류 127

menuconfig 에서 ccache, busybox, ext2 file system 제거
target 은 host-sed 만 주면
buildroot/build_i386/staging_dir/bin 이 생기고 이 밑에 sed 생김.
[root@localhost bin]# pwd
[root@localhost bin]# ls -l
합계 0
lrwxrwxrwx  1 root root 8  9월  5 03:23 sed -> /bin/sed

target 에 kernel-headers 추가 
mkdir -p /root/buildroot/toolchain_build_i386
bzcat /root/buildroot/dl/linux-libc-headers-2.4.27.tar.bz2 | tar -C /root/buildroot/toolchain_build_i386 -xf -
mv /root/buildroot/toolchain_build_i386/linux-libc-headers-2.4.27 /root/buildroot/toolchain_build_i386/linux
touch /root/buildroot/toolchain_build_i386/linux/.unpacked
toolchain/patch-kernel.sh /root/buildroot/toolchain_build_i386/linux toolchain/kernel-headers linux-libc-headers-2.4.25-\*.patch

Applying toolchain/kernel-headers/linux-libc-headers-2.4.25-*.patch using plaintext:
cat: toolchain/kernel-headers/linux-libc-headers-2.4.25-*.patch: 그런 파일이나 디렉토리가 없음
touch /root/buildroot/toolchain_build_i386/linux/.patched
rm -f /root/buildroot/toolchain_build_i386/linux/include/asm
touch /root/buildroot/toolchain_build_i386/linux/include/linux/autoconf.h;
touch /root/buildroot/toolchain_build_i386/linux/.configured


[root@localhost buildroot]# make
mkdir -p /root/buildroot/toolchain_build_i386
bzcat /root/buildroot/dl/uClibc-snapshot.tar.bz2 | tar -C /root/buildroot/toolchain_build_i386 -xf -
touch /root/buildroot/toolchain_build_i386/uClibc/.unpacked
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^CROSS=.*,CROSS=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-,g' /root/buildroot/toolchain_build_i386/uClibc/Rules.mak
cp toolchain/uClibc/uClibc.config-locale /root/buildroot/toolchain_build_i386/uClibc/.config
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^.*TARGET_i386.*,TARGET_i386=y,g' \
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^TARGET_ARCH.*,TARGET_ARCH=\"i386\",g' /root/buildroot/toolchain_build_i386/uClibc/.config
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"/root/buildroot/toolchain_build_i386/linux\",g' \
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' /root/buildroot/toolchain_build_i386/uClibc/.config
/root/buildroot/build_i386/staging_dir/bin/sed -i -e 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' /root/buildroot/toolchain_build_i386/uClibc/.config
mkdir -p /root/buildroot/toolchain_build_i386/uClibc_dev/usr/include
mkdir -p /root/buildroot/toolchain_build_i386/uClibc_dev/usr/lib
mkdir -p /root/buildroot/toolchain_build_i386/uClibc_dev/lib
make -C /root/buildroot/toolchain_build_i386/uClibc \
PREFIX=/root/buildroot/toolchain_build_i386/uClibc_dev/ \
RUNTIME_PREFIX=/root/buildroot/toolchain_build_i386/uClibc_dev/ \
HOSTCC="gcc" \
        pregen install_dev;
make[1]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: 명령 을 찾지 못했음
make[1]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc'
make[1]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: 명령 을 찾지 못했음
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/extra/config'
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
cp zconf.tab.h_shipped zconf.tab.h
gcc -O2 -Wall -I. -c conf.c -o conf.o
cp zconf.tab.c_shipped zconf.tab.c
cp lex.zconf.c_shipped lex.zconf.c
gcc -O2 -Wall -I. -c zconf.tab.c -o zconf.tab.o
gcc  conf.o zconf.tab.o -o conf
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/extra/config'
rm -f -r include/bits
install -d include/bits
# using defaults found in .config
.config:46: trying to assign nonexistent symbol UCLIBC_PROPOLICE
.config:47: trying to assign nonexistent symbol UCLIBC_PROFILING
* uClibc Configuration
Target Architecture
  1. alpha (TARGET_alpha)
  2. arm (TARGET_arm)
  3. bfin (TARGET_bfin)
  4. cris (TARGET_cris)
  5. e1 (TARGET_e1)
  6. frv (TARGET_frv)
  7. h8300 (TARGET_h8300)
> 8. i386 (TARGET_i386)
  9. i960 (TARGET_i960)
  10. m68k (TARGET_m68k)
  11. microblaze (TARGET_microblaze)
  12. mips (TARGET_mips)
  13. nios (TARGET_nios)
  14. nios2 (TARGET_nios2)
  15. powerpc (TARGET_powerpc)
  16. superh (TARGET_sh)
  17. sh64 (TARGET_sh64) (NEW)
  18. sparc (TARGET_sparc)
  19. v850 (TARGET_v850)
  20. x86_64 (TARGET_x86_64) (NEW)
choice[1-20?]: 8
* Target Architecture Features and Options
Target x86 Processor Family
> 1. Generic 386 (CONFIG_GENERIC_386) (NEW)
  2. 386 (CONFIG_386) (NEW)
  3. 486 (CONFIG_486) (NEW)
  4. Pentium/586/K5/5x86/6x86/6x86MX (CONFIG_586) (NEW)
  5. Pentium-MMX (CONFIG_586MMX) (NEW)
  6. Pentium-Pro (CONFIG_686) (NEW)
  7. Celeron/Pentium-II (CONFIG_PENTIUMII) (NEW)
  8. Pentium-III/Celeron(Coppermine)/Pentium-III Xeon (CONFIG_PENTIUMIII) (NEW)
  9. Pentium-4/Celeron(P4-based)/Xeon (CONFIG_PENTIUM4) (NEW)
  10. K6/K6-II/K6-III (CONFIG_K6) (NEW)
  11. Athlon/Duron/K7 (CONFIG_K7) (NEW)
  12. Elan (CONFIG_ELAN) (NEW)
  13. Crusoe (CONFIG_CRUSOE) (NEW)
  14. Winchip-C6 (CONFIG_WINCHIPC6) (NEW)
  15. Winchip-2/Winchip-2A/Winchip-3 (CONFIG_WINCHIP2) (NEW)
  17. VIA C3-2 (Nehemiah) (CONFIG_NEHEMIAH) (NEW)
choice[1-17?]: 1
Target Processor Endianness
> 1. Little Endian (ARCH_LITTLE_ENDIAN) (NEW)
choice[1]: 1
Target CPU has a memory management unit (MMU) (ARCH_HAS_MMU) [Y/?] (NEW) y
Enable floating point number support (UCLIBC_HAS_FLOATS) [Y/n/?] y
  Target CPU has a floating point unit (FPU) (HAS_FPU) [Y/n/?] y
  Enable full C99 math library support (DO_C99_MATH) [Y/n/?] y
Linux kernel header location (KERNEL_SOURCE) [/root/buildroot/toolchain_build_i386/linux] /root/buildroot/toolchain_build_i386/linux
* General Library Settings
Generate Position Independent Code (PIC) (DOPIC) [Y/n/?] y
Enable support for shared libraries (HAVE_SHARED) [Y/n/?] y
Compile native shared library loader (BUILD_UCLIBC_LDSO) [Y/n/?] y
  Only load shared libraries which can share their text segment (FORCE_SHAREABLE_TEXT_SEGMENTS) [N/y/?] n
  Native shared library loader 'ldd' support (LDSO_LDD_SUPPORT) [Y/n/?] y
  Enable shared library loader cache (LDSO_CACHE_SUPPORT) [Y/n/?] (NEW) n
  Enable shared library loader preload file support (LDSO_PRELOAD_FILE_SUPPORT) [N/y/?] (NEW)
  Enable ELF RUNPATH tag support (LDSO_RUNPATH) [Y/n/?] (NEW)
uClibc 0.9.27 compatibility (DL_FINI_CRT_COMPAT) [N/y/?] (NEW)
Support global constructors and destructors (UCLIBC_CTOR_DTOR) [Y/n/?] y
POSIX Threading Support (UCLIBC_HAS_THREADS) [Y/n/?] y
  Build pthreads debugging support (PTHREADS_DEBUG_SUPPORT) [Y/n/?] y
Large File Support (UCLIBC_HAS_LFS) [N/y/?] n
Link ldconfig statically (UCLIBC_STATIC_LDCONFIG) [Y/n/?] (NEW)
Malloc Implementation
  1. malloc (MALLOC)
  2. malloc-simple (MALLOC_SIMPLE)
> 3. malloc-standard (MALLOC_STANDARD)
choice[1-3?]: 3
Malloc returns live pointer for malloc(0) (MALLOC_GLIBC_COMPAT) [Y/n/?] y
Dynamic atexit() Support (UCLIBC_DYNAMIC_ATEXIT) [Y/n/?] y
Shadow Password Support (HAS_SHADOW) [Y/n/?] y
Support only Unix 98 PTYs (UNIX98PTY_ONLY) [N/y/?] n
Assume that /dev/pts is a devpts or devfs file system (ASSUME_DEVPTS) [Y/n/?] y
Support 'struct tm' timezone extension fields (UCLIBC_HAS_TM_EXTENSIONS) [Y/n/?] y
Enable caching of the last valid timezone 'TZ' string (UCLIBC_HAS_TZ_CACHING) [Y/n/?] y
Enable '/etc/TZ' file support to set a default timezone (uClibc-specific) (UCLIBC_HAS_TZ_FILE) [Y/n/?] y
  Repeatedly read the '/etc/TZ' file (UCLIBC_HAS_TZ_FILE_READ_MANY) [Y/n/?] y
  Path to the 'TZ' file for setting the global timezone (UCLIBC_TZ_FILE_PATH) [/etc/TZ] /etc/TZ
* Networking Support
IP version 6 Support (UCLIBC_HAS_IPV6) [Y/n/?] y
Remote Procedure Call (RPC) support (UCLIBC_HAS_RPC) [Y/n/?] y
  Full RPC support (UCLIBC_HAS_FULL_RPC) [Y/n/?] y
  Reentrant RPC support (UCLIBC_HAS_REENTRANT_RPC) [N/y/?] (NEW)
* String and Stdio Support
Use glibc generic string functions (UCLIBC_HAS_STRING_GENERIC_OPT) [Y/n/?] (NEW)
Use arch-specific string functions (UCLIBC_HAS_STRING_ARCH_OPT) [Y/n/?] (NEW)
Use Table Versions Of 'ctype.h' Functions. (UCLIBC_HAS_CTYPE_TABLES) [Y/?] y
  Support Signed Characters In 'ctype.h' Functions. (UCLIBC_HAS_CTYPE_SIGNED) [Y/n/?] y
  ctype argument checking
    1. Do not check -- unsafe (UCLIBC_HAS_CTYPE_UNSAFE)
  > 2. Detect and handle appropriately (UCLIBC_HAS_CTYPE_CHECKED)
    3. Issue a diagnostic and abort() (UCLIBC_HAS_CTYPE_ENFORCED)
  choice[1-3?]: 2
Wide Character Support (UCLIBC_HAS_WCHAR) [Y/?] y
Locale Support (UCLIBC_HAS_LOCALE) [Y/n/?] y
  Use Pre-generated Locale Data (UCLIBC_PREGENERATED_LOCALE_DATA) [Y/n/?] y
    Automagically Download the Pre-generated Locale Data (if necessary) (UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA) [Y/n/?] y
  Extended Locale Support (experimental/incomplete) (UCLIBC_HAS_XLOCALE) [Y/n/?] y
Support hexadecimal float notation (UCLIBC_HAS_HEXADECIMAL_FLOATS) [Y/n/?] y
Support glibc's "'" flag for allowing locale-specific digit grouping (UCLIBC_HAS_GLIBC_DIGIT_GROUPING) [Y/n/?] y
  Do not require digit grouping when the "'" flag is specified (UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING) [Y/n/?] y
Support glibc's register_printf_function() (glibc-compat) (UCLIBC_HAS_GLIBC_CUSTOM_PRINTF) [Y/n/?] y
Maximum number of positional args.  Either 0 or >= 9. (UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS) [9] 9
Support glibc's 'a' flag for scanf string conversions (not implemented) (UCLIBC_HAS_SCANF_GLIBC_A_FLAG) [Y/n/?] y
Stdio buffer size
  1. 256 (minimum ANSI/ISO C99 value) (UCLIBC_HAS_STDIO_BUFSIZ_256)
  3. 1024 (UCLIBC_HAS_STDIO_BUFSIZ_1024)
  4. 2048 (UCLIBC_HAS_STDIO_BUFSIZ_2048)
> 5. 4096 (UCLIBC_HAS_STDIO_BUFSIZ_4096)
  6. 8192 (UCLIBC_HAS_STDIO_BUFSIZ_8192)
choice[1-6?]: 5
Stdio builtin buffer size (uClibc-specific)
choice[1-3?]: 1
Attemt to shutdown stdio subsystem when abort() is called. (UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT) [N/y/?] (NEW)
Provide a macro version of getc() (UCLIBC_HAS_STDIO_GETC_MACRO) [Y/n/?] y
Provide a macro version of putc() (UCLIBC_HAS_STDIO_PUTC_MACRO) [Y/n/?] y
Support auto-r/w transition (UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION) [Y/n/?] y
Support an fopen() 'x' flag for exclusive mode (glibc-compat) (UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE) [Y/n/?] y
Support fmemopen(), open_memstream(), and fopencookie() (glibc-compat) (UCLIBC_HAS_GLIBC_CUSTOM_STREAMS) [Y/n/?] y
Support the '%m' specifier in printf format strings (glibc-compat) (UCLIBC_HAS_PRINTF_M_SPEC) [Y/n/?] y
Include the errno message text in the library (UCLIBC_HAS_ERRNO_MESSAGES) [Y/n/?] y
  Support sys_errlist[] (obsolete-compat) (UCLIBC_HAS_SYS_ERRLIST) [N/y/?] n
Include the signum message text in the library (UCLIBC_HAS_SIGNUM_MESSAGES) [Y/n/?] y
  Support sys_siglist[] (bsd-compat) (UCLIBC_HAS_SYS_SIGLIST) [N/y/?] n
Support gnu getopt (UCLIBC_HAS_GNU_GETOPT) [Y/n/?] y
* Big and Tall
Regular Expression Support (UCLIBC_HAS_REGEX) [Y/n/?] y
Support the wordexp() interface (UCLIBC_HAS_WORDEXP) [Y/n/?] y
Support the ftw() and nftw() interfaces (UCLIBC_HAS_FTW) [Y/n/?] y
Support the glob() interface (UCLIBC_HAS_GLOB) [Y/n/?] y
* Library Installation Options
Shared library loader path (SHARED_LIB_LOADER_PREFIX) [/lib] /lib
uClibc runtime library directory (RUNTIME_PREFIX) [/] /
uClibc development environment directory (DEVEL_PREFIX) [/usr/] /usr/
* uClibc security related options
Enable security options (UCLIBC_SECURITY) [N/y] n
* uClibc development/debugging options
Cross-compiling toolchain prefix (CROSS_COMPILER_PREFIX) [] (NEW)
Build uClibc with debugging symbols (DODEBUG) [N/y/?] n
Build pthread with debugging output (DODEBUG_PT) [N/y/?] (NEW)
Build uClibc with run-time assertion testing (DOASSERTS) [N/y/?] n
Build the shared library loader with debugging support (SUPPORT_LD_DEBUG) [N/y/?] n
Build the shared library loader with early debugging support (SUPPORT_LD_DEBUG_EARLY) [N/y/?] n
Compiler Warnings (WARNINGS) [-Wall] -Wall
Manuel's hidden warnings (UCLIBC_MJN3_ONLY) [N/y/?] n
+ ./extra/scripts/fix_includes.sh -k /root/buildroot/toolchain_build_i386/linux -t i386 -n
Current kernel version is 2.6.12

Using kernel headers from 2.6.12 for architecture 'i386'
        provided in directory /root/buildroot/toolchain_build_i386/linux

+ CC=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc
+ /bin/sh extra/scripts/gen_bits_syscall_h.sh
extra/scripts/gen_bits_syscall_h.sh: line 15: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: No such file or directory
extra/scripts/gen_bits_syscall_h.sh: line 18: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: No such file or directory
+ cmp include/bits/sysnum.h include/bits/sysnum.h.new
+ mv -f include/bits/sysnum.h.new include/bits/sysnum.h
make -C libc/sysdeps/linux/common headers
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/libc/sysdeps/linux/common'
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
ln -fs ../libc/sysdeps/linux/common/fpu_control.h ../../../..//include/
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/libc/sysdeps/linux/common'
make -C libc/sysdeps/linux/i386 headers
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/libc/sysdeps/linux/i386'
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
ln -fs ../libc/sysdeps/linux/i386/fpu_control.h ../../../../include/
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/libc/sysdeps/linux/i386'
(cd extra/locale; \
if [ ! -f uClibc-locale-030818.tgz ] ; then \
wget --passive-ftp http://www.uclibc.org/downloads/uClibc-locale-030818.tgz ; \
fi );
--04:09:53--  http://www.uclibc.org/downloads/uClibc-locale-030818.tgz
           => `uClibc-locale-030818.tgz'
Resolving www.uclibc.org...
Connecting to www.uclibc.org[]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 236,073 [application/x-tar]

100%[====================================>] 236,073       70.37K/s    ETA 00:00

04:09:57 (70.19 KB/s) - `uClibc-locale-030818.tgz' saved [236,073/236,073]

(cd extra/locale; zcat uClibc-locale-030818.tgz | tar -xvf -)
make -C extra/locale pregen
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/extra/locale'
make[2]: /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc: Command not found
cat uClibc_locale_data.h | awk 'BEGIN{i=1}{ if ( /WANT_/ ) i = /endif/ ; else if (i) print  }' > ../../include/bits/uClibc_locale_data.h
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/extra/locale'
install -d /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib
install -d /root/buildroot/toolchain_build_i386/uClibc_dev//usr/include
install -m 644 lib/*.[ao] /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib/
install: cannot stat `lib/*.[ao]': No such file or directory
make[1]: [install_dev] 오류 1 (무시됨)
if [ ""/root/buildroot/toolchain_build_i386/linux"" == "/usr/" ] ; then \
        extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
else \
        extra_exclude="" ; \
fi ; \
tar -chf - include --exclude .svn --exclude CVS $extra_exclude \
        | tar -xf - -C /root/buildroot/toolchain_build_i386/uClibc_dev//usr/
tar: include/asm-generic: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
make[1]: [install_dev] 오류 1 (무시됨)
find /root/buildroot/toolchain_build_i386/uClibc_dev//usr/ -name .svn | xargs rm -f -r;
chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` /root/buildroot/toolchain_build_i386/uClibc_dev//usr/
for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
sed -e 's/lib\///'` ; do \
        ln -sf ../../root/buildroot/toolchain_build_i386/uClibc_dev/lib/$i.0 \
        /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib/$i; \
find: lib/: No such file or directory
ln -sf ../../root/buildroot/toolchain_build_i386/uClibc_dev/lib/libthread_db.so.1 \
        /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib/libthread_db.sofor i in `find lib/  -type f -name '*.a' | sed -e 's/lib\///'` ; do \
        ln -sf $i /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib/`echo $i \
                | sed -e 's/\.a$/_pic.a/'`; \
find: lib/: No such file or directory
# Ugh!!! Remember that libdl.a and libdl_pic.a are different.  Since
# libdl is pretty small, and not likely to benefit from mklibs.py and
# similar, lets just remove libdl_pic.a and avoid the issue
rm -f /root/buildroot/toolchain_build_i386/uClibc_dev//usr/lib/libdl_pic.a
make[1]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc'
touch /root/buildroot/toolchain_build_i386/uClibc/.configured
[root@localhost buildroot]#


[root@localhost buildroot]# make
if [ ! -e "/root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib" ] ; then \
        ln -snf ../lib /root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib; \
make -C /root/buildroot/toolchain_build_i386/uClibc PATH=/root/buildroot/build_i386/staging_dir/bin:/root/buildroot/toolchain_build_i386/bin:/bin:/sbin:/usr/bin:/usr/sbin AR=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-ar AS=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-as LD=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-ld NM=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-nm CC=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc GCC=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc CXX=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-g++ RANLIB=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-ranlib OBJCOPY=/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-objcopy \
        PREFIX=/root/buildroot/build_i386/root utils install_utils
make[1]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc'
make CROSS=" /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-" CC="/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc" -C utils
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/utils'
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing    -fno-builtin -nostdinc -D_LIBC -I../include -I.  -mpreferred-stack-boundary=2 -falign-jumps=0 -falign-loops=0 -Os -funit-at-a-time   -isystem /root/buildroot/build_i386/staging_dir/lib/gcc/i386-linux-uclibc/4.0.0/include -DNDEBUG -fPIC    \
        -DUCLIBC_LDSO=ld-uClibc.so.0 -I. -I../ldso/include \
        ldd.c -o ldd
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-strip -s -x -R .note -R .comment ldd
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing    -fno-builtin -nostdinc -D_LIBC -I../include -I.  -mpreferred-stack-boundary=2 -falign-jumps=0 -falign-loops=0 -Os -funit-at-a-time   -isystem /root/buildroot/build_i386/staging_dir/lib/gcc/i386-linux-uclibc/4.0.0/include -DNDEBUG -fPIC    \
        -DUCLIBC_LDSO=ld-uClibc.so.0 -I. -I../ldso/include \
        ldconfig.c -o ldconfig
ldconfig.c: In function 'is_shlib':
ldconfig.c:281: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-strip -s -x -R .note -R .comment ldconfig
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing    -fno-builtin -nostdinc -D_LIBC -I../include -I.  -mpreferred-stack-boundary=2 -falign-jumps=0 -falign-loops=0 -Os -funit-at-a-time   -isystem /root/buildroot/build_i386/staging_dir/lib/gcc/i386-linux-uclibc/4.0.0/include -DNDEBUG -fPIC  readelf.c -o readelf
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-strip -s -x -R .note -R .comment readelf
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing    -fno-builtin -nostdinc -D_LIBC -I../include -I.  -mpreferred-stack-boundary=2 -falign-jumps=0 -falign-loops=0 -Os -funit-at-a-time   -isystem /root/buildroot/build_i386/staging_dir/lib/gcc/i386-linux-uclibc/4.0.0/include -DNDEBUG -fPIC    \
        -DL_iconv_main \
        ../libc/misc/wchar/wchar.c -o iconv
../libc/misc/wchar/wchar.c: In function 'main':
../libc/misc/wchar/wchar.c:1628: warning: pointer targets in assignment differ in signedness
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-strip -s -x -R .note -R .comment iconv
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/utils'
make CROSS=" /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-" CC="/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc" -C utils install
make[2]: Entering directory `/root/buildroot/toolchain_build_i386/uClibc/utils'
install -d /root/buildroot/build_i386/root/sbin
install -d /root/buildroot/build_i386/root/usr/bin
install -m 755 ldd /root/buildroot/build_i386/root/usr/bin/ldd
install -m 755 ldconfig /root/buildroot/build_i386/root/sbin/ldconfig;
#install -m 755 readelf /root/buildroot/build_i386/root/usr/bin/readelf
install -m 755 iconv /root/buildroot/build_i386/root/usr/bin/iconv
make[2]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc/utils'
make[1]: Leaving directory `/root/buildroot/toolchain_build_i386/uClibc'
mkdir -p /root/buildroot/build_i386/staging_dir/i386-linux-uclibc/target_utils
install -c /root/buildroot/build_i386/root/usr/bin/ldd \
touch -c /root/buildroot/build_i386/root/usr/bin/ldd

[root@localhost buildroot]# make
if [ ! -e "/root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib" ] ; then \
        ln -snf ../lib /root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib; \
wget --passive-ftp -P /root/buildroot/dl http://ccache.samba.org/ftp/ccache/ccache-2.4.tar.gz
--04:08:14--  http://ccache.samba.org/ftp/ccache/ccache-2.4.tar.gz
           => `/root/buildroot/dl/ccache-2.4.tar.gz'
Resolving ccache.samba.org...
Connecting to ccache.samba.org[]:80... connected.
HTTP 요청을 보냅니다, 서버로부터의 응답을 기다림...200 OK
길이:   86,363 [application/x-tar]

100%[====================================>] 86,363        72.17K/s

04:08:16 (72.00 KB/s) - `/root/buildroot/dl/ccache-2.4.tar.gz' saved [86,363/86,363]

zcat /root/buildroot/dl/ccache-2.4.tar.gz | tar -C /root/buildroot/toolchain_build_i386 -xf -
touch /root/buildroot/toolchain_build_i386/ccache-2.4/.unpacked
# WARNING - this will break if the toolchain is moved.
# Should probably patch things to use a relative path.
/root/buildroot/toolchain_build_i386/bin/sed -i -e "s,getenv(\"CCACHE_PATH\"),\"/root/buildroot/build_i386/staging_dir/bin-ccache\",g" \
# WARNING - this will break if the toolchain build dir is deleted.
/root/buildroot/toolchain_build_i386/bin/sed -i -e "s,getenv(\"CCACHE_DIR\"),\"/root/buildroot/toolchain_build_i386/ccache-2.4/cache\",g" \
mkdir -p /root/buildroot/toolchain_build_i386/ccache-2.4/cache
touch /root/buildroot/toolchain_build_i386/ccache-2.4/.patched
mkdir -p /root/buildroot/toolchain_build_i386/ccache-2.4
(cd /root/buildroot/toolchain_build_i386/ccache-2.4; rm -rf config.cache; \
        CC=gcc \
        /root/buildroot/toolchain_build_i386/ccache-2.4/configure \
        --target=i386-pc-linux-gnu \
        --host=i386-pc-linux-gnu \
        --build=i386-pc-linux-gnu \
        --prefix=/usr \
configure: Configuring ccache
checking for i386-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for strings.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking for realpath... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for mkstemp... yes
checking for gethostname... yes
checking for getpwuid... yes
checking for compar_fn_t in stdlib.h... yes
checking for C99 vsnprintf... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
touch /root/buildroot/toolchain_build_i386/ccache-2.4/.configured
make -j1 CC=gcc -C /root/buildroot/toolchain_build_i386/ccache-2.4
make[1]: Entering directory `/root/buildroot/toolchain_build_i386/ccache-2.4'
gcc -g -O2 -Wall -W -I.   -c -o ccache.o ccache.c
gcc -g -O2 -Wall -W -I.   -c -o mdfour.o mdfour.c
gcc -g -O2 -Wall -W -I.   -c -o hash.o hash.c
gcc -g -O2 -Wall -W -I.   -c -o execute.o execute.c
gcc -g -O2 -Wall -W -I.   -c -o util.o util.c
gcc -g -O2 -Wall -W -I.   -c -o args.o args.c
gcc -g -O2 -Wall -W -I.   -c -o stats.o stats.c
gcc -g -O2 -Wall -W -I.   -c -o cleanup.o cleanup.c
gcc -g -O2 -Wall -W -I.   -c -o snprintf.o snprintf.c
gcc -g -O2 -Wall -W -I.   -c -o unify.o unify.c
gcc -g -O2 -Wall -W -I. -o ccache ccache.o mdfour.o hash.o execute.o util.o args.o stats.o cleanup.o snprintf.o unify.o
make[1]: Leaving directory `/root/buildroot/toolchain_build_i386/ccache-2.4'
mkdir -p /root/buildroot/build_i386/staging_dir/usr/bin;
cp /root/buildroot/toolchain_build_i386/ccache-2.4/ccache /root/buildroot/build_i386/staging_dir/usr/bin
# Keep the actual toolchain binaries in a directory at the same level.
# Otherwise, relative paths for include dirs break.
mkdir -p /root/buildroot/build_i386/staging_dir/bin-ccache;
(cd /root/buildroot/build_i386/staging_dir/bin-ccache; \
        ln -fs i386-linux-uclibc-gcc i386-linux-gcc; \
        ln -fs i386-linux-uclibc-gcc i386-linux-cc; \
        ln -fs i386-linux-uclibc-gcc i386-linux-uclibc-cc);
[ -f /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc ] && \
        mv /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc /root/buildroot/build_i386/staging_dir/bin-ccache/
(cd /root/buildroot/build_i386/staging_dir/bin; \
        ln -fs ../usr/bin/ccache i386-linux-cc; \
        ln -fs ../usr/bin/ccache i386-linux-gcc; \
        ln -fs ../usr/bin/ccache i386-linux-uclibc-cc; \
        ln -fs ../usr/bin/ccache i386-linux-uclibc-gcc);

[root@localhost buildroot]# make
if [ ! -e "/root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib" ] ; then \
        ln -snf ../lib /root/buildroot/build_i386/staging_dir/i386-linux-uclibc/lib; \
ln -snf ../../bin/i386-linux-uclibc-sstrip \
ln -snf i386-linux-uclibc-sstrip \
gcc .//toolchain/sstrip/sstrip.c -o /root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-sstrip
/root/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc -Os -pipe  .//toolchain/sstrip/sstrip.c -o /root/buildroot/build_i386/root/usr/bin/sstrip
host/build system
target system
  • make menuconfig : package/config 에서 make

  • build_i386
    • root
    • staging_dir : toolchain and header files
  • dl
  • toolchain_build_i386

It's a poor workman who blames his tools.

sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-11-09 23:56:25
Processing time 0.0177 sec