Bug 209883 - iio: light: build error due to unmet dependency for IIO_TRIGGERED_BUFFER by VCNL4035
Summary: iio: light: build error due to unmet dependency for IIO_TRIGGERED_BUFFER by V...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: IIO (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Virtual Assignee for Drivers/IIO
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-26 20:51 UTC by Necip Fazil Yildiran
Modified: 2021-01-21 19:58 UTC (History)
4 users (show)

See Also:
Kernel Version: 5.9-rc10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
reproduce.tar.gz (99.81 KB, application/gzip)
2020-10-26 20:51 UTC, Necip Fazil Yildiran
Details

Description Necip Fazil Yildiran 2020-10-26 20:51:11 UTC
Created attachment 293229 [details]
reproduce.tar.gz

Attachment (reproduce.tar.gz) content:
 - sample.config: Config file to reproduce the bug.
 - build_out.txt: Output of Kbuild including the error messages.

When IIO_TRIGGERED_BUFFER is enabled and IIO_BUFFER is disabled, it results
in the following Kbuild warning:

WARNING: unmet direct dependencies detected for IIO_TRIGGERED_BUFFER
  Depends on [n]: IIO [=y] && IIO_BUFFER [=n]
  Selected by [y]:
  - VCNL4035 [=y] && IIO [=y] && I2C [=y]

Building the kernel fails due to this unmet direct dependency issue as follows:

[...]
  LD      .tmp_vmlinux1
drivers/iio/buffer/industrialio-triggered-buffer.o: In function `iio_triggered_buffer_cleanup':
/home/necip/linux/clean-linux-5.4.4/drivers/iio/buffer/industrialio-triggered-buffer.c:94: undefined reference to `iio_kfifo_free'
drivers/iio/buffer/industrialio-triggered-buffer.o: In function `iio_triggered_buffer_setup':
/home/necip/linux/clean-linux-5.4.4/drivers/iio/buffer/industrialio-triggered-buffer.c:49: undefined reference to `iio_kfifo_allocate'
/home/necip/linux/clean-linux-5.4.4/drivers/iio/buffer/industrialio-triggered-buffer.c:55: undefined reference to `iio_device_attach_buffer'
/home/necip/linux/clean-linux-5.4.4/drivers/iio/buffer/industrialio-triggered-buffer.c:81: undefined reference to `iio_kfifo_free'
drivers/iio/buffer/industrialio-triggered-buffer.o: In function `iio_triggered_buffer_cleanup':
/home/necip/linux/clean-linux-5.4.4/drivers/iio/buffer/industrialio-triggered-buffer.c:94: undefined reference to `iio_kfifo_free'
drivers/iio/light/vcnl4035.o: In function `iio_push_to_buffers_with_timestamp':
/home/necip/linux/clean-linux-5.4.4/./include/linux/iio/buffer.h:41: undefined reference to `iio_push_to_buffers'
drivers/iio/light/vcnl4035.o:(.rodata+0x4e0): undefined reference to `iio_validate_scan_mask_onehot'
Makefile:1077: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Steps to reproduce the bug for v5.4.4:
  1. wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
  2. chmod +x ~/bin/make.cross
  3. tar -xvf reproduce.tar.gz # sample.config and build_out.txt
  4. cp sample.config path/to/linux-source-v5.4.4/.config
  5. cd path/to/linux-source-v5.4.4/
  6. ~/bin/make.cross ARCH=x86_64 clean
  7. ~/bin/make.cross ARCH=x86_64 olddefconfig # unmet direct dependency warning
  8. ~/bin/make.cross ARCH=x86_64 # should have a build error

The output for the steps [6-8] can be found in build_out.txt.

The bug is reproducible for v5.10-rc1 as well with the same steps.

Kernel successfully builds when the unmet direct dependencies are resolved
by enabling them in the configuration. Depending on instead of selecting
the symbols, or selecting the dependencies of the selected symbols as well
should fix the bug.

Thanks,
Necip

Note You need to log in before you can comment on or make changes to this bug.