<div dir="ltr">I was testing I2C test case for BBB. When I hit compile I have got following linking error. Any clue what may be error ?<div><br></div><div><div>arm-rtems4.12-gcc -B../../../../../beagleboneblack/lib/ -specs bsp_specs -qrtems -mcpu=cortex-a8 -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs  -Wl,--gc-sections  -mcpu=cortex-a8   -o i2c0.exe init.o </div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `_Thread_Get_executing':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../cpukit/../../../beagleboneblack/lib/include/rtems/score/percpu.h:704: multiple definition of `__getreent'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../beagleboneblack/lib/include/rtems/score/percpu.h:704: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Linker_set__Sysinit__RTEMS_tasks_Initialize_user_tasks_body'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `Configuration'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_minimum_stack_size'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `Configuration_POSIX_API'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `Configuration_RTEMS_API'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Thread_Control_add_on_count'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Thread_Control_add_ons'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Thread_Control_size'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Linker_set__Sysinit__User_extensions_Handler_initialization'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_IO_Number_of_drivers'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_IO_Driver_address_table'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>/root/development/rtems/4.12/lib/gcc/arm-rtems4.12/6.1.1/../../../../arm-rtems4.12/bin/ld: Warning: size of symbol `_IO_Driver_address_table' changed from 24 in init.o to 384 in ../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o)</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `Initialization_tasks'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_malloc_dirty_helper'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_malloc_extend_handler'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `RTEMS_Malloc_Heap'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `_Scheduler_Table'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_filesystem_root_configuration'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_filesystem_table'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_telnetd_maximum_ptys'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o): In function `Init':</div><div>/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/cpukit/libmisc/../../../../../../../../NEW/c/src/../../cpukit/libmisc/dummy/default-configuration.c:23: multiple definition of `rtems_libio_number_iops'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):(.rtemsroset._Sysinit.content.0.0x00040180+0x0): multiple definition of `_Linker_set__Sysinit_rtems_filesystem_initialize'</div><div>init.o:/root/development/rtems/b-NEW/arm-rtems4.12/c/beagleboneblack/testsuites/samples/i2c0/../../../../../../../../../NEW/c/src/../../testsuites/samples/i2c0/init.c:34: first defined here</div><div>collect2: error: ld returned 1 exit status</div></div><div><br></div><div><br></div><div>Here is my test case </div><div><br></div><div><div>#ifdef HAVE_CONFIG_H</div><div>#include "config.h"</div><div>#endif</div><div>#include <fcntl.h></div><div>#include <unistd.h></div><div>#include <rtems/printer.h></div><div>#include <rtems/test.h></div><div><br></div><div>#include <bsp.h> /* for device driver prototypes */</div><div><br></div><div>#include <stdio.h></div><div>#include <stdlib.h></div><div>#include <bsp/i2c.h></div><div>#include <dev/i2c/i2c.h></div><div><br></div><div>/* forward declarations to avoid warnings */</div><div>rtems_task Init(rtems_task_argument argument);</div><div><br></div><div>const char rtems_test_name[] = "GSOC 2016 I2C TESTING";</div><div>rtems_printer rtems_test_printer;</div><div><br></div><div>rtems_task Init(</div><div>  rtems_task_argument ignored</div><div>)</div><div>{</div><div>  rtems_print_printer_printf(&rtems_test_printer);</div><div>  rtems_test_begin();</div><div>  int fd,r;</div><div><br></div><div>  r = bbb_register_i2c_0();</div><div>  fd = open(BBB_I2C_0_BUS_PATH,O_RDWR);</div><div>  printf("value of fd is %d \n",fd);</div><div>  close(fd);</div><div>  rtems_test_end();</div><div>  exit( 0 );</div><div>}</div></div><div><br></div><div><div>/* NOTICE: the clock driver is explicitly disabled */</div><div>#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER</div><div>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</div><div><br></div><div>#define CONFIGURE_MAXIMUM_TASKS            1</div><div>#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM</div><div><br></div><div>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE</div><div><br></div><div>#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION</div><div><br></div><div>#define CONFIGURE_INIT</div><div>#include <rtems/confdefs.h></div></div><div><br></div><div><br></div><div>Thanks, </div><div>Punit Vara</div></div>