lk2nd 0.15 fails to build
lk2nd fails to build on master and v24.06:
$ pmbootstrap build lk2nd --force
Build errors:
compiling platform/msm_shared/crc32.c
In file included from target/msm8916/include/target/display.h:35,
from platform/msm8916/platform.c:41:
./dev/gcdb/display/include/display_resource.h:72:1: warning: useless storage class specifier in empty declaration
72 | };
| ^
./dev/gcdb/display/include/display_resource.h:86:1: warning: useless storage class specifier in empty declaration
86 | };
| ^
In file included from platform/msm8916/gpio.c:30:
platform/msm8916/gpio.c: In function 'gpio_set_value':
platform/msm8916/gpio.c:59:37: error: implicit declaration of function 'GPIO_OUT_SET_ADDR'; did you mean 'GPIO_IN_OUT_ADDR'? [-Wimplicit-function-declaration]
59 | (uint32_t *)GPIO_OUT_SET_ADDR(gpio));
| ^~~~~~~~~~~~~~~~~
include/reg.h:30:44: note: in definition of macro 'REG32'
30 | #define REG32(addr) ((volatile uint32_t *)(addr))
| ^~~~
platform/msm8916/gpio.c:58:17: note: in expansion of macro 'writel'
58 | writel(GPIO_OUT_VAL(gpio),
| ^~~~~~
platform/msm8916/gpio.c:58:24: error: implicit declaration of function 'GPIO_OUT_VAL'; did you mean 'GPIO_OUTPUT'? [-Wimplicit-function-declaration]
58 | writel(GPIO_OUT_VAL(gpio),
| ^~~~~~~~~~~~
include/reg.h:39:36: note: in definition of macro 'writel'
39 | #define writel(v, a) (*REG32(a) = (v))
| ^
platform/msm8916/gpio.c:62:37: error: implicit declaration of function 'GPIO_OUT_CLR_ADDR' [-Wimplicit-function-declaration]
62 | (uint32_t *)GPIO_OUT_CLR_ADDR(gpio));
| ^~~~~~~~~~~~~~~~~
include/reg.h:30:44: note: in definition of macro 'REG32'
30 | #define REG32(addr) ((volatile uint32_t *)(addr))
| ^~~~
platform/msm8916/gpio.c:61:17: note: in expansion of macro 'writel'
61 | writel(GPIO_OUT_VAL(gpio),
| ^~~~~~
platform/msm_shared/smem.c: In function 'smem_get_alloc_entry':
platform/msm_shared/smem.c:139:24: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
139 | return 1;
| ^
platform/msm_shared/smem.c:143:24: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
143 | return 1;
| ^
platform/msm8916/platform.c: In function 'platform_early_init':
platform/msm8916/gpio.c:66:37: error: implicit declaration of function 'GPIO_OUT_OE_SET_ADDR'; did you mean 'GPIO_IN_OUT_ADDR'? [-Wimplicit-function-declaration]
66 | (uint32_t *)GPIO_OUT_OE_SET_ADDR(gpio));
| ^~~~~~~~~~~~~~~~~~~~
include/reg.h:30:44: note: in definition of macro 'REG32'
30 | #define REG32(addr) ((volatile uint32_t *)(addr))
| ^~~~
platform/msm8916/gpio.c:65:9: note: in expansion of macro 'writel'
65 | writel(GPIO_OUT_OE_VAL(gpio),
| ^~~~~~
platform/msm8916/platform.c:89:9: error: implicit declaration of function 'platform_clock_init'; did you mean 'platform_early_init'? [-Wimplicit-function-declaration]
89 | platform_clock_init();
| ^~~~~~~~~~~~~~~~~~~
| platform_early_init
platform/msm_shared/smem.c:151:21: error: assignment to 'void *' from 'uint32_t' {aka 'unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
151 | ret = base_ext + offset;
| ^
platform/msm8916/gpio.c:65:16: error: implicit declaration of function 'GPIO_OUT_OE_VAL' [-Wimplicit-function-declaration]
65 | writel(GPIO_OUT_OE_VAL(gpio),
| ^~~~~~~~~~~~~~~
include/reg.h:39:36: note: in definition of macro 'writel'
39 | #define writel(v, a) (*REG32(a) = (v))
| ^
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm8916/platform.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm_shared/smem.o] Error 1
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm8916/gpio.o] Error 1
platform/msm8916/acpuclock.c: In function 'mdp_clock_enable':
platform/msm8916/acpuclock.c:208:13: error: implicit declaration of function 'platform_is_msm8939' [-Wimplicit-function-declaration]
208 | if (platform_is_msm8939() || platform_is_msm8929())
| ^~~~~~~~~~~~~~~~~~~
In file included from platform/msm_shared/hsusb.c:36:
platform/msm_shared/hsusb.c: In function 'udc_request_queue':
platform/msm_shared/hsusb.c:324:54: error: passing argument 1 of 'platform_get_virt_to_phys_mapping' makes integer from pointer without a cast [-Wint-conversion]
324 | curr_item->next = PA(item);
| ^~~~
| |
| struct ept_queue_item *
include/platform.h:30:49: note: in definition of macro 'PA'
30 | #define PA(x) platform_get_virt_to_phys_mapping(x)
| ^
include/platform.h:46:49: note: expected 'addr_t' {aka 'long unsigned int'} but argument is of type 'struct ept_queue_item *'
46 | addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr);
| ~~~~~~~^~~~~~~~~
platform/msm_shared/hsusb.c:329:30: error: assignment to 'struct ept_queue_item *' from 'addr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
329 | item = VA(curr_item->next);
| ^
platform/msm_shared/hsusb.c:348:33: error: passing argument 1 of 'platform_get_virt_to_phys_mapping' makes integer from pointer without a cast [-Wint-conversion]
348 | ept->head->next = PA(req->item);
| ~~~^~~~~~
| |
| struct ept_queue_item *
include/platform.h:30:49: note: in definition of macro 'PA'
30 | #define PA(x) platform_get_virt_to_phys_mapping(x)
| ^
include/platform.h:46:49: note: expected 'addr_t' {aka 'long unsigned int'} but argument is of type 'struct ept_queue_item *'
46 | addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr);
| ~~~~~~~^~~~~~~~~
platform/msm8916/acpuclock.c:208:38: error: implicit declaration of function 'platform_is_msm8929' [-Wimplicit-function-declaration]
208 | if (platform_is_msm8939() || platform_is_msm8929())
| ^~~~~~~~~~~~~~~~~~~
platform/msm_shared/hsusb.c:357:63: error: passing argument 1 of 'platform_get_phys_to_virt_mapping' makes integer from pointer without a cast [-Wint-conversion]
357 | arch_clean_invalidate_cache_range((addr_t) VA(req->req.buf),
| ~~~~~~~~^~~~
| |
| void *
include/platform.h:31:49: note: in definition of macro 'VA'
31 | #define VA(x) platform_get_phys_to_virt_mapping(x)
| ^
In file included from ./platform/msm_shared/include/secapp_loader.h:32,
from target/msm8916/init.c:52:
include/km_main.h:41:9: warning: "UINT32_MAX" redefined
41 | #define UINT32_MAX (0xffffffff)
| ^~~~~~~~~~
include/platform.h:47:49: note: expected 'addr_t' {aka 'long unsigned int'} but argument is of type 'void *'
47 | addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr);
| ~~~~~~~^~~~~~~~~
In file included from include/sys/types.h:29,
from include/platform/debug.h:26,
from include/debug.h:31,
from target/msm8916/init.c:29:
include/stdint.h:47:9: note: this is the location of the previous definition
47 | #define UINT32_MAX UINT_MAX
| ^~~~~~~~~~
platform/msm_shared/hsusb.c:367:30: error: assignment to 'struct ept_queue_item *' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
367 | item = curr_item->next;
| ^
platform/msm_shared/hsusb.c: In function 'handle_ept_complete':
platform/msm_shared/hsusb.c:394:29: error: passing argument 1 of 'platform_get_phys_to_virt_mapping' makes integer from pointer without a cast [-Wint-conversion]
394 | req = VA(ept->req);
| ~~~^~~~~
| |
| struct usb_request *
include/platform.h:31:49: note: in definition of macro 'VA'
31 | #define VA(x) platform_get_phys_to_virt_mapping(x)
| ^
include/platform.h:47:49: note: expected 'addr_t' {aka 'long unsigned int'} but argument is of type 'struct usb_request *'
47 | addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr);
| ~~~~~~~^~~~~~~~~
platform/msm_shared/hsusb.c:394:21: error: assignment to 'struct usb_request *' from 'addr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
394 | req = VA(ept->req);
| ^
platform/msm_shared/hsusb.c:400:30: error: passing argument 1 of 'platform_get_phys_to_virt_mapping' makes integer from pointer without a cast [-Wint-conversion]
400 | item = VA(req->item);
| ~~~^~~~~~
| |
| struct ept_queue_item *
include/platform.h:31:49: note: in definition of macro 'VA'
31 | #define VA(x) platform_get_phys_to_virt_mapping(x)
| ^
include/platform.h:47:49: note: expected 'addr_t' {aka 'long unsigned int'} but argument is of type 'struct ept_queue_item *'
47 | addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr);
| ~~~~~~~^~~~~~~~~
platform/msm_shared/hsusb.c:400:22: error: assignment to 'struct ept_queue_item *' from 'addr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
400 | item = VA(req->item);
| ^
platform/msm_shared/hsusb.c:448:38: error: assignment to 'struct ept_queue_item *' from 'addr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
448 | item = VA(item->next);
| ^
platform/msm_shared/boot_stats.c: In function 'bs_set_timestamp':
platform/msm_shared/boot_stats.c:37:26: error: implicit declaration of function 'get_bs_info_addr' [-Wimplicit-function-declaration]
37 | addr_t bs_imem = get_bs_info_addr();
| ^~~~~~~~~~~~~~~~
In file included from platform/msm8916/msm8916-clock.c:35:
platform/msm8916/include/platform/clock.h:37:41: error: initialization of 'uint32_t *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
37 | #define REG_MM(off) (CLK_CTL_BASE + (off))
| ^
platform/msm8916/include/platform/clock.h:47:41: note: in expansion of macro 'REG_MM'
47 | #define MDSS_VSYNC_CBCR REG_MM(0x4D090)
| ^~~~~~
platform/msm8916/msm8916-clock.c:509:24: note: in expansion of macro 'MDSS_VSYNC_CBCR'
509 | .cbcr_reg = MDSS_VSYNC_CBCR,
| ^~~~~~~~~~~~~~~
platform/msm8916/include/platform/clock.h:37:41: note: (near initialization for 'mdss_vsync_clk.cbcr_reg')
37 | #define REG_MM(off) (CLK_CTL_BASE + (off))
| ^
platform/msm8916/include/platform/clock.h:47:41: note: in expansion of macro 'REG_MM'
47 | #define MDSS_VSYNC_CBCR REG_MM(0x4D090)
| ^~~~~~
platform/msm8916/msm8916-clock.c:509:24: note: in expansion of macro 'MDSS_VSYNC_CBCR'
509 | .cbcr_reg = MDSS_VSYNC_CBCR,
| ^~~~~~~~~~~~~~~
platform/msm_shared/boot_stats.c:47:45: error: implicit declaration of function 'platform_get_sclk_count' [-Wimplicit-function-declaration]
47 | kernel_load_start = platform_get_sclk_count();
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from platform/msm8916/msm8916-clock.c:36:
platform/msm8916/include/platform/iomap.h:116:37: error: initialization of 'uint32_t *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
116 | #define GCC_BLSP1_QUP2_APPS_CBCR (CLK_CTL_BASE + 0x3010)
| ^
platform/msm8916/msm8916-clock.c:609:21: note: in expansion of macro 'GCC_BLSP1_QUP2_APPS_CBCR'
609 | .cbcr_reg = GCC_BLSP1_QUP2_APPS_CBCR,
| ^~~~~~~~~~~~~~~~~~~~~~~~
platform/msm8916/include/platform/iomap.h:116:37: note: (near initialization for 'gcc_blsp1_qup2_i2c_apps_clk.cbcr_reg')
116 | #define GCC_BLSP1_QUP2_APPS_CBCR (CLK_CTL_BASE + 0x3010)
| ^
platform/msm8916/msm8916-clock.c:609:21: note: in expansion of macro 'GCC_BLSP1_QUP2_APPS_CBCR'
609 | .cbcr_reg = GCC_BLSP1_QUP2_APPS_CBCR,
| ^~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm_shared/boot_stats.o] Error 1
target/msm8916/init.c: In function 'target_volume_up_old':
target/msm8916/init.c:187:13: error: implicit declaration of function 'udelay' [-Wimplicit-function-declaration]
187 | udelay(10000);
| ^~~~~~
target/msm8916/init.c: In function 'target_init':
target/msm8916/init.c:234:9: error: implicit declaration of function 'spmi_init'; did you mean 'rpmb_init'? [-Wimplicit-function-declaration]
234 | spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);
| ^~~~~~~~~
| rpmb_init
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm8916/acpuclock.o] Error 1
platform/msm8916/msm8916-clock.c: In function 'msm8939_clock_c0_init':
platform/msm8916/msm8916-clock.c:801:17: error: implicit declaration of function 'udelay' [-Wimplicit-function-declaration]
801 | udelay(1);
| ^~~~~~
platform/msm_shared/partition_parser.c: In function 'patch_gpt':
platform/msm_shared/partition_parser.c:687:37: error: assignment to 'unsigned int' from 'unsigned char *' makes integer from pointer without a cast [-Wint-conversion]
687 | partition_entry_array_start = primary_gpt_header + block_size;
| ^
platform/msm_shared/partition_parser.c:688:37: error: passing argument 1 of 'calculate_crc32' makes pointer from integer without a cast [-Wint-conversion]
688 | crc_value = calculate_crc32(partition_entry_array_start,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned int
platform/msm_shared/partition_parser.c:575:45: note: expected 'unsigned char *' but argument is of type 'unsigned int'
575 | unsigned int calculate_crc32(unsigned char *buffer, int len)
| ~~~~~~~~~~~~~~~^~~~~~
platform/msm_shared/partition_parser.c:692:65: error: passing argument 1 of 'calculate_crc32' makes pointer from integer without a cast [-Wint-conversion]
692 | crc_value = calculate_crc32(partition_entry_array_start + array_size,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
| |
| unsigned int
platform/msm_shared/partition_parser.c:575:45: note: expected 'unsigned char *' but argument is of type 'unsigned int'
575 | unsigned int calculate_crc32(unsigned char *buffer, int len)
| ~~~~~~~~~~~~~~~^~~~~~
platform/msm8916/msm8916-clock.c: In function 'platform_clock_init':
platform/msm8916/msm8916-clock.c:812:13: error: implicit declaration of function 'platform_is_msm8939' [-Wimplicit-function-declaration]
812 | if (platform_is_msm8939() || platform_is_msm8929()) {
| ^~~~~~~~~~~~~~~~~~~
platform/msm_shared/partition_parser.c: In function 'write_gpt':
platform/msm8916/msm8916-clock.c:812:38: error: implicit declaration of function 'platform_is_msm8929' [-Wimplicit-function-declaration]
812 | if (platform_is_msm8939() || platform_is_msm8929()) {
| ^~~~~~~~~~~~~~~~~~~
platform/msm_shared/partition_parser.c:799:37: error: assignment to 'unsigned int' from 'unsigned char *' makes integer from pointer without a cast [-Wint-conversion]
799 | partition_entry_array_start = primary_gpt_header + block_size;
| ^
platform/msm_shared/partition_parser.c:810:37: error: assignment to 'unsigned int' from 'unsigned char *' makes integer from pointer without a cast [-Wint-conversion]
810 | partition_entry_array_start = primary_gpt_header + block_size +
| ^
target/msm8916/init.c: In function 'target_uninit':
target/msm8916/init.c:521:17: error: implicit declaration of function 'sdhci_mode_disable' [-Wimplicit-function-declaration]
521 | sdhci_mode_disable(&emmc_dev->host);
| ^~~~~~~~~~~~~~~~~~
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm8916/msm8916-clock.o] Error 1
target/msm8916/init.c:530:17: error: implicit declaration of function 'crypto_eng_cleanup'; did you mean 'crypto5_cleanup'? [-Wimplicit-function-declaration]
530 | crypto_eng_cleanup();
| ^~~~~~~~~~~~~~~~~~
| crypto5_cleanup
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm_shared/hsusb.o] Error 1
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/target/msm8916/init.o] Error 1
platform/msm_shared/partition_parser.c: In function 'mbr_fill_name':
platform/msm_shared/partition_parser.c:880:37: warning: statement will never be executed [-Wswitch-unreachable]
880 | memset(partition_ent->name, 0, MAX_GPT_NAME_SIZE);
| ~~~~~~~~~~~~~^~~~~~
make[1]: *** [arch/arm/compile.mk:3: build-lk2nd-msm8916/platform/msm_shared/partition_parser.o] Error 1
make[1]: Leaving directory '/home/pmos/build/src/lk2nd-0.15.0'
make: *** [makefile:20: make-make] Error 2
I see at https://github.com/msm8916-mainline/lk2nd/releases that there are two new releases, 0.16 and 0.17.
0.16 fails with the same errors it seems, and 0.17 has a note:
Due to the significant changes this version should be considered "beta".
So this doesn't seem suitable for the stable release yet. I guess the easiest is making a patch against 0.15 that fixes the build errors.
I'll remove lk2nd from the v24.06 branch until this is fixed, so bpo can start building images. (I guess as workaround, people could use pre-built binaries of lk2nd from edge.)
@minlexx: you are listed as mantainer of the package, could you please take a look at this? If you have a patch, make a merge request to master and then we backport it to v24.06 (backport-to-v24.06 label). Thanks!