티스토리 뷰

simple hints

--sysroot 용도

osnux 2015. 3. 14. 21:57

embedded 개발자인 환경 상, cross-compile 환경 구성을 자주 해야 한다.

요때, --sysroot 옵션이 중요하다.


먼저 --sysroot가 언제 쓰이는 지 보면,

[https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html 에서 발췌]

--sysroot=dir
Use dir as the logical root directory for headers and libraries. For example, if the compiler normally searches for headers in /usr/include and libraries in /usr/lib, it instead searches dir/usr/include anddir/usr/lib.
If you use both this option and the -isysroot option, then the --sysroot option applies to libraries, but the -isysroot option applies to header files.
The GNU linker (beginning with version 2.16) has the necessary support for this option. If your linker does not support this option, the header file aspect of --sysroot still works, but the library aspect does not.


하여, compiler가 인식하는 기본 include 및 library들의 위치를 SoC에서 제공되는 환경으로 세팅해 줄 수 있다. cross compiler를 이용해 build 환경 구성할 때, 제일 중요한 부분이 아닐까 싶다.


configure에서 --prefix와 --exec-prefix의 용도와 비슷하다고 할 수 있다.

'simple hints' 카테고리의 다른 글

logging - printf debugging  (0) 2015.06.24
Single UNIX Specification  (0) 2015.06.03
Qt에서 include 시 필요한 package matching  (0) 2015.03.19
서버 setting  (0) 2015.03.14
configure 실행하기  (0) 2015.03.14
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함