gcc 옵션 중 -print-search-dirs 옵션은 디렉토리 검색 경로를 표시합니다.

아래와 같이 사용하면 됩니다.

# arm-none-linux-gnueabi-gcc  -print-search-dirs

install: /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/
programs: =/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../libexec/gcc/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../libexec/gcc/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/
libraries: =/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/lib/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/lib/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../arm-fsl-linux-gnueabi/multi-libs/lib/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../arm-fsl-linux-gnueabi/multi-libs/lib/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../arm-fsl-linux-gnueabi/multi-libs/usr/lib/arm-fsl-linux-gnueabi/4.4.4/:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../arm-fsl-linux-gnueabi/multi-libs/usr/lib/


특정 옵션에 대하여 디렉토리 검색 경로를 표시한다.

# arm-none-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=softfp -print-search-dirs

install: /usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/
programs: =/usr/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../libexec/gcc/:/usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/
libraries: =/usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../lib/gcc/:/usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/:/usr/bin/../arm-none-linux-gnueabi/libc/lib/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../arm-none-linux-gnueabi/libc/lib/:/usr/bin/../arm-none-linux-gnueabi/libc/usr/lib/arm-none-linux-gnueabi/4.3.2/:/usr/bin/../arm-none-linux-gnueabi/libc/usr/lib/


이 옵션으로 관련 라이브러리의 탐색 경로를 확인 할 수 있으며, 라이브러리 참조 에러시 이 옵션으로 관련 라이브러리 검색한 후 해당 디렉토리를 포함시켜서 컴파일을 하면 됩니다.


------
-dumpspecs 옵션은 gcc의 기본 스펙 문자열을 표시합니다.

# arm-none-linux-gnueabi-gcc -dumpspecs 


------
-print-multi-lib 옵션은 명령 행 옵션과 다수의 라이브러리 디렉토리 사이의 관계를 표시

# arm-none-linux-gnueabi-gcc -print-multi-lib
.;
armv5te;@march=armv5te
armv6;@march=armv6
armv7-a;@march=armv7-a
armv6/vfp;@march=armv6@mfpu=vfp
armv7-a/vfpv3;@march=armv7-a@mfpu=vfpv3
armv7-a/neon;@march=armv7-a@mfpu=neon
armv7-a/thumb;@march=armv7-a@mthumb


------
-print-multi-directory 옵션은 libgcc 모든 버전의 루트 디렉토리를 표시합니다.

아래와 같이 찾고자하는 옵션을 적어주면 해당 옵션이 포함된 libgcc의 디렉토리를 표시해 줍니다.

# ./arm-none-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=softfp -print-multi-directory
armv7-a/neon