Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Rapberry Pi 3B+ : unrecognized command line option ‘-mgeneral-regs-only’ #2682

Closed
kevinjjames opened this issue Sep 13, 2018 · 13 comments

Comments

@kevinjjames
Copy link

Hi,

I am trying to compile the latest rpi-4.14.y branch using defconfig file : arch/arm64/configs/bcmrpi3_defconfig.

The issue is same as #1974. Compilation is failing with the error in subject line.

Using the gcc compiler : tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/

The console output is as follows:

kevinjjames@iris ~/raspberrypi/raspian-linux $ make ARCH=arm64 CROSS_COMPILE=${CCPREFIX} bcmrpi3_defconfig

configuration written to .config

kevinjjames@iris ~/raspberrypi/raspian-linux $ make ARCH=arm64 CROSS_COMPILE=${CCPREFIX} -j4
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-linux-gnueabihf-gcc: error: unrecognized command line option '-mgeneral-regs-only'
scripts/Makefile.build:328: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 1
scripts/Makefile.build:587: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
Makefile:568: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....

Any pointers?

Thanks,
Kevin

@kevinjjames kevinjjames changed the title Error : Rapberry Pi 3 : unrecognized command line option ‘-mgeneral-regs-only’ Error : Rapberry Pi 3B+ : unrecognized command line option ‘-mgeneral-regs-only’ Sep 13, 2018
@popcornmix
Copy link
Collaborator

Are you using the newer compiler suggested in linked issue?

@kevinjjames
Copy link
Author

kevinjjames commented Sep 13, 2018 via email

@popcornmix
Copy link
Collaborator

popcornmix commented Sep 13, 2018

I think CROSS_COMPILE needs to point to a 64 bit cross compiler.

See: https://www.raspberrypi.org/forums/viewtopic.php?t=158127

@kevinjjames
Copy link
Author

kevinjjames commented Sep 13, 2018 via email

@popcornmix
Copy link
Collaborator

No, you need a cross-compiler for 64-bit arm. e.g.
CROSS_COMPILE=aarch64-linux-gnu
If you are running on Ubuntu,
sudo apt-get install gcc-aarch64-linux-gnu
will likely get it.

@kevinjjames
Copy link
Author

kevinjjames commented Sep 13, 2018 via email

@popcornmix
Copy link
Collaborator

The gcc we have in our repo is just for convenience. You can use any arm32 or arm64 cross compiler from wherever you want.

@kevinjjames
Copy link
Author

Yup. Using CROSS_COMPILE=aarch64-linux-gnu worked.
Also found a page which contains instructions on how to boot the 64bit Image created.
http://www.tal.org/tutorials/booting-64-bit-kernel-raspberry-pi-3

Also read that arm64 doesn't have decompressing capacity; hence "make zImage" won't work. Had to do "make Image".

@Nodi-Rubrum
Copy link

Any solution? I am having the same issue.

@popcornmix
Copy link
Collaborator

It might help if you explained what your specific problem is.
Assuming you are trying to cross-compile an arm64 kernel then the documentation is being updated in pull request here

You can see the current state here

@Nodi-Rubrum
Copy link

I was following the directions posted. But even trying the additional steps for buster 10, I still got the given error. The additional steps were supposed to avoid the error, per the documentation. Not sure if the documentation is wrong or maybe a missing step? or something has changed as buster 10 has matured?

@lurch
Copy link
Contributor

lurch commented Sep 16, 2020

@Nodi-Rubrum Can you provide more details please? "having the same issue" is a bit vague, especially as the original problem was reported 2 years ago.

Which OS are you running? On which platform? Which kernel are you trying to compile? Which steps / instructions have you followed? Which step gives you the error? Please copy'n'paste the error message if possible.

@kevinjjames
Copy link
Author

kevinjjames commented Sep 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants