Summary: | sys-boot/lilo-24.2: edit.c:195:31: error: initializer element is not a compile-time constant | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Agostino Sarubbo <ago> |
Component: | Current packages | Assignee: | Joshua Kinard <kumba> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | base-system, peter |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 792567 | ||
Attachments: |
build.log
Patch to move the pointer calculation to runtime |
Description
Agostino Sarubbo
2020-09-12 18:40:38 UTC
Created attachment 659817 [details]
build.log
build log and emerge --info
Created attachment 713217 [details, diff]
Patch to move the pointer calculation to runtime
I am not convinced that the attached patch fully resolves the issue. The patch makes the runtime calculation only happen in function `bmp_file_open', but the 'lh' pointer is also accessed in `bmp_file_close' and `main'. Some quick research suggests two possible solutions: - Remove the 'static' initializer from the 'lh' definition, per this StackOverflow answer: https://stackoverflow.com/a/34450315/ and this commit in someone's personal repo: https://git.sr.ht/~kqz/repo/commit/b8808d8 - Change the assignment to the following code, sourced from a Reddit comment on making lilo build with clang and musl: (void*)((char*)&tm + (offsetof(MENUTABLE, row) - offsetof(BITMAPLILOHEADER, row))) Source: https://www.reddit.com/r/Gentoo/comments/nmq5o1/help_with_installing_a_bootloader_on_a_clangmusl/ I don't have a working clang compiler installation, so I cannot reliably test either of these solutions (gcc-11 seems content with either of them). Thoughts? |