Skip to content

[CLANGDWARF] fix llvm toolchain build issues - #289

Open
peppergrayxyz wants to merge 10 commits into
edk2-porting:masterfrom
peppergrayxyz:clangdwarf
Open

peppergrayxyz wants to merge 10 commits into
edk2-porting:masterfrom
peppergrayxyz:clangdwarf

Conversation

@peppergrayxyz

@peppergrayxyz peppergrayxyz commented Sep 18, 2026 •

Copy link
Copy Markdown

The CLANGDWARF image is compiling and booting after fixing this linker issue: tianocore/edk2#13156

--

1. rk806: fix fix constant-out-of-range-compare

building using clang fails with error constant-out-of-range-compare due
to info->vsel_reg == NA comparing unsigned with -1 is always false.

set NA consisently to 0xff

2. rk3588_voltd: fix SCMI_VCCIO_SD_S0 string len

scmi_vccio_sd_s0 needs 17 chars including \0, but
SCMI_VOLTAGE_DOMAIN_NAME_LENGTH_MAX is 16.

changed name to vccio_sd_s0 to fit into buffer

3. rk806: fix pldo_set_enable default ret val

ret is uninitialized , when no branch matches
return RETURN_INVALID_PARAMETER in else branch

4. cru

cru: use 64-bit clock rates for RK3588 PLLs

  • widen frequency handling for rates above 4.29GHZ (UINT32_MAX)
  • update gdc handling to avoid long iterations (UINT64_MAX)

cru: update SetPllV1Freq for RK3588

5. rk3588cru: remove unused pll vars

6. osid: provide error message for static assert

7. i2c: fix pointer assignment in I2cEnableConf

8. rockchiop/ochi: fix DriverBindingStart error path

Pages and Buf are freed without being initialized. OhciFreeDev
internally calls FreePool. After the fall through, Ohc is used
and accessed and then freed again.

  • replace separate cleanup labels with a single error path
  • track controller open/install/init state
  • unmap memory before freeing it
  • set return status for non-efi errors

9. rockchip/edid: fix label followed by a declaration

placing a label directly before a declaration is officially supported in C23,
but triggers an error on clang when compiling with older C standards

--
Closes: #283

building using clang fails with error `constant-out-of-range-compare` due
to `info->vsel_reg == NA` comparing unsigned with `-1` is always false.

set `NA` consisently to 0xff

Bug: edk2-porting#238
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
`scmi_vccio_sd_s0` needs 17 chars including `\0`, but
`SCMI_VOLTAGE_DOMAIN_NAME_LENGTH_MAX` is 16.

changed name to `vccio_sd_s0` to fit into  buffer

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
`ret` is uninitialized , when no branch matches

return `RETURN_INVALID_PARAMETER` in else branch

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
- widen frequency handling for rates above 4.29GHZ (UINT32_MAX)
- update gdc handling to avoid long iterations (UINT64_MAX)

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
always write PLLCON2_K_MASK in line with mainline kernel
https://github.com/torvalds/linux/blob/238650ef6c7c7cca08e032527329424c9fbd70e5/drivers/clk/rockchip/clk-pll.c#L975

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
`Pages` and `Buf` are freed without being initialized. `OhciFreeDev`
internally calls `FreePool`. After the fall through, `Ohc` is used
and accessed and then freed again.

- replace separate cleanup labels with a single error path
- track controller open/install/init state
- unmap memory before freeing it
- set return status for non-efi erros

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
placing a label directly before a declaration is officially supported in C23,
but triggers an error on clang when compiling with older C standards

Bug: edk2-porting#283
Signed-off-by: Pepper Gray <hello@peppergray.xyz>
@peppergrayxyz

Copy link
Copy Markdown
Author

Serial debug log: tianocore/edk2#13157 (comment)

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

Successfully merging this pull request may close these issues.

[CLANGDWARF] llvm toolchain build issues

1 participant