You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words, with optimizations enabled (but not CONFIG_FS_LITTLEFS_BLK_DEV), the compiler is able drop the call to disk_access_init(). When optimizations are disabled, the build fails unless CONFIG_DISK_ACCESS=y.
Some other sections of code in the same file are behind
#ifdef CONFIG_FS_LITTLEFS_BLK_DEV
checks.
The code could be refactored to include these checks for all code that uses disk_access_x() but I guess there could be other less obvious fixes. What do you think?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the littlefs subsystem build fails if NO_OPTIMIZATIONS is set but DISK_ACCESS is not.
[102/106] Linking C executable zephyr/zephyr_pre0.elf FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/johannes/zephyr/build_fs_sample/zephyr/zephyr_pre0.map : && ccache /usr/bin/gcc -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/posix/core/offsets/offsets.c.obj -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/home/johannes/zephyr/build_fs_sample/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/arch/posix/core/libarch__posix__core.a zephyr/soc/posix/inf_clock/libsoc__posix__inf_clock.a zephyr/boards/boards/posix/native_posix_64/libboards__posix__native_posix.a zephyr/subsys/fs/libsubsys__fs.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/timer/libdrivers__timer.a modules/nimbus-global-id-list/libnimbusglobalidlist.a modules/littlefs/libmodules__littlefs.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L/home/johannes/zephyr/build_fs_sample/zephyr -no-pie -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -m64 -ldl -pthread -lm && cd /home/johannes/zephyr/build_fs_sample/zephyr && /usr/bin/cmake -E echo /usr/bin/ld: zephyr/subsys/fs/libsubsys__fs.a(littlefs_fs.c.obj): in function
littlefs_init_backend':/home/johannes/zephyr/zephyr/subsys/fs/littlefs_fs.c:656: undefined reference to
disk_access_init' /usr/bin/ld: zephyr/subsys/fs/libsubsys__fs.a(littlefs_fs.c.obj): in function
littlefs_init_cfg':/home/johannes/zephyr/zephyr/subsys/fs/littlefs_fs.c:703: undefined reference to
disk_access_ioctl' /usr/bin/ld: /home/johannes/zephyr/zephyr/subsys/fs/littlefs_fs.c:746: undefined reference to
disk_access_ioctl'collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.`
This clearly because of code like (in littlefs_fs.c):
where the littlefs_on_blkdev() definition is:
static inline bool littlefs_on_blkdev(int flags) { return IS_ENABLED(CONFIG_FS_LITTLEFS_BLK_DEV) && flags & FS_MOUNT_FLAG_USE_DISK_ACCESS; }
In other words, with optimizations enabled (but not CONFIG_FS_LITTLEFS_BLK_DEV), the compiler is able drop the call to disk_access_init(). When optimizations are disabled, the build fails unless CONFIG_DISK_ACCESS=y.
Some other sections of code in the same file are behind
#ifdef CONFIG_FS_LITTLEFS_BLK_DEV
checks.
The code could be refactored to include these checks for all code that uses disk_access_x() but I guess there could be other less obvious fixes. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions