#2 Verify cc is GCC

Closed
opened 2 years ago by Ghost · 6 comments
Ghost commented 2 years ago

Apologies if this issue stems from upstream coreboot.

When the host cc (/usr/bin/cc, /bin/cc) is linked to a compiler other than gcc (e.g., clang), the build fails.

There is no explicit error to detail that gcc is required - though I didn't believe otherwise.

In Debian, the Alternatives system is responsible for this link, and can be fixed accordingly:

sudo update-alternatives --set cc /usr/bin/gcc

This is an edge case, but may trip up anyone who has been using alternative compilers.

Apologies if this issue stems from upstream coreboot. When the host `cc` (`/usr/bin/cc`, `/bin/cc`) is linked to a compiler other than `gcc` (e.g., `clang`), the build fails. There is no explicit error to detail that `gcc` is required - though I didn't believe otherwise. In Debian, the Alternatives system is responsible for this link, and can be fixed accordingly: `sudo update-alternatives --set cc /usr/bin/gcc` This is an edge case, but may trip up anyone who has been using alternative compilers.
Leah Rowe commented 2 years ago
Owner

Well, coreboot is very cursed when built with Clang.

In general I would recommend GCC. I'm not sure how I would reliable detect what compiler the user has on their distro, because I normally just use GCC.

What do you recommend?

That Debian command you mentioned is nice, but it's debian-specific. I'd like to be distro-agnostic here.

Well, coreboot is very cursed when built with Clang. In general I would recommend GCC. I'm not sure how I would reliable detect what compiler the user has on their distro, because I normally just use GCC. What do you recommend? That Debian command you mentioned is nice, but it's debian-specific. I'd like to be distro-agnostic here.
Ghost commented 2 years ago
Poster

I'd forgotten I'd changed cc as above, I didn't expect coreboot - or any monolithic software - to build against clang.

I mention it in the interest of preventing repeat occurrences and troubleshooting if cc != gcc.

I don't see anything obvious in the coreboot sources, but I'm not familiar with the toolchain - make can be arcane.

I would suggest patching the source to explicitly define gcc, or wrap build to print a message when $? != 0, but neither of these are elegant.

I'd forgotten I'd changed `cc` as above, I didn't expect `coreboot` - or any monolithic software - to build against `clang`. I mention it in the interest of preventing repeat occurrences and troubleshooting if `cc != gcc`. I don't see anything obvious in the `coreboot` sources, but I'm not familiar with the toolchain - `make` can be arcane. I would suggest patching the source to explicitly define `gcc`, or wrap `build` to print a message when `$? != 0`, but neither of these are elegant.
Leah Rowe commented 2 years ago
Owner

Can you try it? Try modifying the Libreboot build system, accordingly and test it. Then issue a pull request and I'll test your change myself.

Can you try it? Try modifying the Libreboot build system, accordingly and test it. Then issue a pull request and I'll test your change myself.
Leah Rowe commented 2 years ago
Owner

i've decided to regard this as a non-bug

GCC is required, and supporting other compilers is not worth the effort

i've decided to regard this as a non-bug GCC is required, and supporting other compilers is not worth the effort
Leah Rowe commented 2 years ago
Owner

re-opening. i've decided recently i do want to work on making the build system more portable. including removing bashisms etc from bash scripts. plus, coreboot has some llvm support

it's worth looking into other compilers besides gnu ones

re-opening. i've decided recently i do want to work on making the build system more portable. including removing bashisms etc from bash scripts. plus, coreboot has some llvm support it's worth looking into other compilers besides gnu ones
Leah Rowe commented 1 year ago
Owner

redundant now, coreboot's clang support improved

redundant now, coreboot's clang support improved
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.