크로스 컴파일시 발생하는 big-endian, little-endian error 해결 방법에 대한 질문
크로스 컴파일시 발생하는 big-endian, little-endian error 해결 방법에 대해서 알고 싶습니다.
타켓 플랫폼이 Xscal의 리눅스 환경입니다.
타켓 플랫폼이 big-endian을 사용하기 때문에 호스트에서 컴파일시
크로스 컴파일러에 –mbig-endian이라는 옵션을 주어 컴파일 했습니다.
그런데 아래와 같은 에러 메시지가 나옵니다.
============================
/usr/local/Tynux/arm-linux/bin/ld: ../../build/linux-sarm-dtv/obj/gen_semispace.o: compiled for a big endian system and target
is little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/gen_semispace.o
/usr/local/Tynux/arm-linux/bin/ld: ../../build/linux-sarm-dtv/obj/gen_markcompact.o: compiled for a big endian system and targ
et is little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/gen_markcompact.o
/usr/local/Tynux/arm-linux/bin/ld: ../../build/linux-sarm-dtv/obj/gc_common.o: compiled for a big endian system and target is
little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/gc_common.o
/usr/local/Tynux/arm-linux/bin/ld: ../../build/linux-sarm-dtv/obj/gc_impl.o: compiled for a big endian system and target is li
ttle endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/gc_impl.o
…
…
…
…
/usr/local/Tynux/arm-linux/bin/ld: k_tan.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/fdlibm.a(k_tan.o)
/usr/local/Tynux/arm-linux/bin/ld: s_scalbn.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/fdlibm.a(s_scalbn.o)
/usr/local/Tynux/arm-linux/bin/ld: s_copysign.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file ../../build/linux-sarm-dtv/obj/fdlibm.a(s_copysign.o)
collect2: ld returned 1 exit status
make: *** [../../build/linux-sarm-dtv/bin/cvm] 오류 1
==============================
크로스 컴파일러에 아래와 같이 helloworld 에러를 –mbig-endian 옵션을 주고 테스트해보면 타켓 플랫폼에서 잘 돌아 갑니다.
그런데 왜 위와 같은 에러가 발생할까요?
고수님들의 많은 조언 부탁드리겠습니다.
자세한 내용이 없어 정확하게는 모르겠고..아마 툴체인 생성이 잘못된
자세한 내용이 없어 정확하게는 모르겠고..
아마 툴체인 생성이 잘못된 듯 하군요...
체크해 보세요..
그럼 즐프 하세요...
에러 메시지 상으로는 target 시스템이 little endian 인데
에러 메시지 상으로는 target 시스템이 little endian 인데 big endian옵션을 사용했다는 메시지 아닌가요?
타겟 플레폼이 확실히 big endian을 사용하는지 확인하시거나
타겟 플레폼에 맞게 옵션을 사용하셨는지 확인하셔야할듯 합니다.
'아래와 같이 helloworld 에러를' 이라고 하셨는데 어느 코드를 말씀하시는건지 잘 모르겠네요...??
일하는 사람들의 희망 민주노동당 : http://www.kdlp.org
반공 교육의 성과로, 민주주의의 반대가 공산주의(또는 사회주의)라고 생각하는 사람이 많다.
hello world간단한 프로그램으로 테스트 했습니다.
간단히 hello world가 출력되는 프로그램을 작성해서
그냥 arm-linux-gcc -o hello hello.c 라고 컴파일해서 타겟에 올리면 실행할수 없는 파일이라고 나오고요.
arm-linux-gcc -mbig-endian -o hello hello.c
라고 컴파일 해서 올리면 실행이 됩니다.
그러면 툴체인이 문제 없이 big-endian에서 사용가능하다는 건가요..?
댓글 달기