I2C testcase linking error
punit vara
punitvara at gmail.com
Fri Jul 22 12:26:32 UTC 2016
I was testing I2C test case for BBB. When I hit compile I have got
following linking error. Any clue what may be error ?
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `_Thread_Get_executing':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
/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)
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):
In function `Init':
/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'
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
../../../../../beagleboneblack/lib/librtemscpu.a(default-configuration.o):(.rtemsroset._Sysinit.content.0.0x00040180+0x0):
multiple definition of `_Linker_set__Sysinit_rtems_filesystem_initialize'
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
collect2: error: ld returned 1 exit status
Here is my test case
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h>
#include <unistd.h>
#include <rtems/printer.h>
#include <rtems/test.h>
#include <bsp.h> /* for device driver prototypes */
#include <stdio.h>
#include <stdlib.h>
#include <bsp/i2c.h>
#include <dev/i2c/i2c.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
const char rtems_test_name[] = "GSOC 2016 I2C TESTING";
rtems_printer rtems_test_printer;
rtems_task Init(
rtems_task_argument ignored
)
{
rtems_print_printer_printf(&rtems_test_printer);
rtems_test_begin();
int fd,r;
r = bbb_register_i2c_0();
fd = open(BBB_I2C_0_BUS_PATH,O_RDWR);
printf("value of fd is %d \n",fd);
close(fd);
rtems_test_end();
exit( 0 );
}
/* NOTICE: the clock driver is explicitly disabled */
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
Thanks,
Punit Vara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160722/38941feb/attachment-0001.html>
More information about the devel
mailing list