linux
Module `i2c-designware-core' gets linked twice causing a linker error
Both I2C_DESIGNWARE_PLATFORM and I2C_DESIGNWARE_PCI will add `i2c-designware-core.o' to the list of object files to be linked against the respective module. When these features are compiled built-in in the kernel, both modules are part of a `built-in.o' object. The linker fails because both `i2c-designware-platform.o' and `i2c-designware-pci.o' contain duplicate definitions coming from `i2c-designware-core'.
Bug fixed by commit e68bb91baa0
Type | MultipleDefinitions |
Config | "I2C_DESIGNWARE_PLATFORM && I2C_DESIGNWARE_PCI" (2nd degree) |
Fix-in | model, mapping, code |
Location | drivers/ |
#ifdef CONFIG_I2C_DESIGNWARE_PLATFORM int i2c_dw_init() { return 0; } #endif #ifdef CONFIG_I2C_DESIGNWARE_PCI int i2c_dw_init() // ERROR { return 0; } #endif int main(void) { #if defined(CONFIG_I2C_DESIGNWARE_PLATFORM) || defined(CONFIG_I2C_DESIGNWARE_PCI) i2c_dw_init(); #endif return 0; }