SW 개발

Make Rule / make install 크로스 컴파일하기 / install 유틸의 strip 크로스 컴파일설정

. . . 2011. 5. 17. 14:22
반응형

install 유틸의 strip 크로스 컴파일설정

거의 모든 시스템 프로그래밍에서 make install 하게 되면 host 컴퓨터의 install 유틸을 갖고 파일시스템? 을 구축하게 된다.

( 물론 복사될 타겟 디렉토리는 만들기 나름이겠지요;;)

그냥 아무런 옵션없이 install 옵션중에는 자동으로 strip 하게 되어있는 경우가 있는데. 크로스 컴파일 환경에서는 문제가 발생한다.

즉 크로스 컴파일로된 오브젝트를 host 의 strip 유틸로 strip 하려고 한다는점이다.

대표적으로 PPPD를 크로스 컴파일 할경우 make install 할경우 아래와 같은 strip 에러가 난다.

install -s -c -m 4550 rp-pppoe.so /home/test_root/works/ppp-2.4.5/output_root/lib/pppd/2.4.5

strip: Unable to recognise the format of the input file `/home/test_root/works/ppp-2.4.5/output_root/lib/pppd/2.4.5/output_root/lib/pppd/2.4.5/rp-pppoe.so'

install: strip 프로세스가 비정상적으로 중단됨

이와 관련한 에러의 이유는 아래서 찾을수있다. (install 의 옵션내용)

  -b                  like --backup but does not accept an argument
  -c                  (ignored)
  -C, --compare       compare each pair of source and destination files, and
                        in some cases, do not modify the destination at all
  -d, --directory     treat all arguments as directory names; create all
                        components of the specified directories
  -D                  create all leading components of DEST except the last,
                        then copy SOURCE to DEST
  -g, --group=GROUP   set group ownership, instead of process' current group
  -m, --mode=MODE     set permission mode (as in chmod), instead of rwxr-xr-x
  -o, --owner=OWNER   set ownership (super-user only)
  -p, --preserve-timestamps   apply access/modification times of SOURCE files
                        to corresponding destination files
  -s, --strip         strip symbol tables
      --strip-program=PROGRAM  program used to strip binaries
  -S, --suffix=SUFFIX  override the usual backup suffix
  -t, --target-directory=DIRECTORY  copy all SOURCE arguments into DIRECTORY
  -T, --no-target-directory  treat DEST as a normal file
  -v, --verbose       print the name of each directory as it is created
      --preserve-context  preserve SELinux security context
  -Z, --context=CONTEXT  set SELinux security context of files and directories
      --help     이 도움말을 표시하고 끝냅니다
      --version  버전 정보를 출력하고 끝냅니다

-s 가 strip 을 하게 되는데 이때 기본적으로 -s 를 하게 되면 host 의 strip 옵션을 쓰게 된다.

즉 크로컴파일 환경에서는 install 유틸을 부를때 -s 말고 아래와 같은 옵션을 추가한다.

--strip-program=arm-linux-gnueabi-strip

끗.

반응형