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

Compiling for ubuntu22.04 Linux 6.5.0-35 #43

Open
AITleo opened this issue Jun 26, 2024 · 0 comments
Open

Compiling for ubuntu22.04 Linux 6.5.0-35 #43

AITleo opened this issue Jun 26, 2024 · 0 comments

Comments

@AITleo
Copy link

AITleo commented Jun 26, 2024

When compiling for ubuntu22.04 Linux 6.5.0-35 I received a gcc warning about mismatched compilers and an error about an unknown option like so:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  You are using:           gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  CC [M]  /home/ubuntu/Diamorphine/diamorphine.o
gcc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’

Setting the standard gcc version to 12 solves it.

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --config gcc
(select gcc-12 here)

It works.

But I am confused since the error message states that we are already using gcc-12 and we would need to use x86_64-linux-gnu-gcc-12.
On my system it exists under /usr/bin/x86_64-linux-gnu-gcc-12 thus setting this as the standard gcc should be the solution.
This is weird.

Anyway maybe the hint that such an error may be resolved by playing around with update-alternatives is good information.

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

1 participant