cache: fix no previous prototype for ‘grub_arch_sync_dma_caches’ in loonarch64

log :
gcc -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=LOONGARCH64_EFI -nostdinc -isystem /usr/lib/gcc/loongarch64-linux-gnu/12/include -I../include -I../include -DGRUB_FILE=\"kern/loongarch64/cache.c\" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/   -DGRUB_KERNEL=1  -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -freg-struct-return -mno-explicit-relocs -fno-plt -Wa,-mla-global-with-abs -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=large -fno-stack-protector -Wtrampolines -Werror   -ffreestanding -fshort-wchar   -MT kern/loongarch64/kernel_exec-cache.o -MD -MP -MF kern/loongarch64/.deps-core/kernel_exec-cache.Tpo -c -o kern/loongarch64/kernel_exec-cache.o `test -f 'kern/loongarch64/cache.c' || echo './'`kern/loongarch64/cache.c
kern/loongarch64/cache.c:35:1: error: no previous prototype for ‘grub_arch_sync_dma_caches’ [-Werror=missing-prototypes]
   35 | grub_arch_sync_dma_caches (volatile void *address __attribute__((unused)),
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
mv -f kern/loongarch64/.deps-core/kernel_exec-cache_flush.Tpo kern/loongarch64/.deps-core/kernel_exec-cache_flush.Po
gcc -E -DGRUB_LST_GENERATOR -Dgrub_fs_register=FS_LIST_MARKER -Dgrub_video_register=VIDEO_LIST_MARKER -Dgrub_parttool_register=PARTTOOL_LIST_MARKER -Dgrub_partition_map_register=PARTMAP_LIST_MARKER '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_fdtbus_register(...)=FDT_DRIVER_LIST_MARKER(__VA_ARGS__)' -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=LOONGARCH64_EFI -nostdinc -isystem /usr/lib/gcc/loongarch64-linux-gnu/12/include -I../include -I../include -DGRUB_FILE=\"lib/efi/halt.c\" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/    -D_FILE_OFFSET_BITS=64 lib/efi/halt.c commands/halt.c > halt.marker.new || (rm -f halt.marker; exit 1)
cc1: all warnings being treated as errors
make[3]: *** [Makefile:40251:kern/loongarch64/kernel_exec-cache.o] 错误 1

Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
This commit is contained in:
Wentao Guan 2024-08-25 19:28:08 +08:00
parent 1fc47c7f90
commit 066a25975f

View File

@ -45,6 +45,8 @@ grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)),
}
#elif defined(__mips__) && (_MIPS_SIM != _ABI64)
void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, grub_size_t len);
#else
void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, grub_size_t len);
#endif
#endif