Error: unknown architecture `armv7-a' while kernel compilation for beagleboard

Asked by Sandeep Tingare

Hi all,
I am cross compiling the linux kernel for beagleboard xM. I found following error while compilation

Assembler messages:
Error: unknown architecture `armv7-a'
Error: unrecognized option -march=armv7-a
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2

Beagleboard xM has cortex A-8 ARM processor. I am not able to fix this error. Please help me to fix this.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ubfan (ubfan1) said :
#1

That's a valid switch for an ARM cross compiler, so you're probably not running a cross compiler. The error messages don't even look like the standard gcc compiler for i386 output for that architecture, those would look like:
error: bad value (armv7-a) for -march= switch
Check which compiler is getting invoked. You may need to set up some environment variables to control this. The arm vendors usually point to a gnu toolchain for a cross compiler which should work.

Revision history for this message
RemyR (oxak4) said :
#2

Hi,

I don t really understand how fix this problem, can you give me more details. I'm working on apf51 board and I try to port android on it. I am cross compiling the linux kernel and I have the same error :

etudiant@etucar117:/media/ProjetRI/android-kernel/common$ make ARCH=arm CROSS_COMPILE=$ANDROID_SOURCE/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- uImage
  CHK include/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: « include/generated/mach-types.h » est à jour.
  CALL scripts/checksyscalls.sh
  CC scripts/mod/empty.o
Messages de l'assembleur:
ERREUR: architecture inconnue « armv7-a »

ERREUR: option non reconnue -march=armv7-a
make[2]: *** [scripts/mod/empty.o] Erreur 1
make[1]: *** [scripts/mod] Erreur 2
make: *** [scripts] Erreur 2

Thanks for your help.

Revision history for this message
Ubfan (ubfan1) said :
#3

I'm no expert, but here's what I did for a cross compiled arm web server:
1)Unpacked the supplied tookchain in my local directory.
2)It looks like I added short-named links to the actual executables in ...toolchain
e.g. gcc -> arm-none-linux-gnueabi-gcc
This makes the subsequent defines shorter.
3)I did NOT try to "install" any executables in any system directories.
4)I made a file of definitions for things like CC pointing to the ...toolchain/gcc
(see below example -- I didn't even bother to define everything, only what I needed.)
5)I made a script to run the ./configure with necessary selections to generate the makefiles
Probably put all the defines in my envorinment before running it, don't remember.
6)Before running the make, I put the defined names in my environment, and everything worked for me.

The defines:
MY_ARM_BASE=${HOME}/dev/toolchain/arm-2008q3
C_INCLUDE_PATH=${MY_ARM_BASE}/lib/gcc/arm-none-linux-gnueabi/4.3.2/include:${MY_ARM_BASE}/lib/gcc/arm-none-linux-gnueabi/4.3.2/include-fixed
LIBRARY_PATH=${MY_ARM_BASE}/arm-none-linux-gnueabi/libc/lib:${MY_ARM_BASE}/arm-none-linux-gnueabi/libc/usr/lib
CPLUS_INCLUDE_PATH=${MY_ARM_BASE}/arm-none-linux-gnueabi/include/c++/4.3.2
#OBJC_INCLUDE_PATH
COMPILER_PATH=${MY_ARM_BASE}/bin
#LD_RUN_PATH
#GPROF_PATH
#######
CC=${COMPILER_PATH}/gcc
CXX=${COMPILER_PATH}/g++
RANLIB=${COMPILER_PATH}/ranlib
STRIP=${COMPILER_PATH}/strip
export C_INCLUDE_PATH LIBRARY_PATH CPLUS_INCLUDE_PATH COMPILER_PATH
export CC CXX RANLIB STRIP

The ./configure script
GCC=${COMPILER_PATH}/gcc RANLIB=${COMPILER_PATH}/ranlib \
STRIP=${COMPILER_PATH}/strip ./configure --build=arm-linux \
--disable-static --enable-shared --prefix=/mnt/usb/lighty

Hope this helps.

Can you help with this problem?

Provide an answer of your own, or ask Sandeep Tingare for more information if necessary.

To post a message you must log in.