nios2 fails to link spcache01
Hesham Moustafa
heshamelmatary at gmail.com
Wed Sep 3 15:05:49 UTC 2014
I came across this problem (as I currently implementing cache
manager). First I tried to add my new cache.c implementation at this
libcpu/or1k/Makefile.am line:
"## shared/cache
include_libcpu_HEADERS = ../shared/include/cache.h
noinst_PROGRAMS += shared/cache.rel
shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
../shared/src/cache_aligned_malloc.c \
../shared/src/cache_manager.c"
But I got the same undefined reference to all RTEMS cache functions.
So I just redirected or1ksim BSP Makefile.am to include cache.c and
cache_manager.c from libcpu directory (raspberry pi does so). And it
worked with the following lines at or1ksim/Makefile.am (I think the
same can apply to nios2_iss BSP since it's the only BSP for nios2)
"# Cache
libbsp_a_SOURCES += ../../../libcpu/or1k/shared/cache/cache.c
libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
libbsp_a_SOURCES += ../shared/include/cache_.h
libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/include"
On Wed, Sep 3, 2014 at 4:44 PM, Joel Sherrill <joel.sherrill at oarcorp.com> wrote:
> Hi
>
> Any suggestions on how to address this?
>
> nios2-rtems4.11-gcc -B../../../../../nios2_iss/lib/ -specs bsp_specs
> -qrtems -DHAVE_CONFIG_H -I.
> -I../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01
> -I..
> -I../../../../../../../rtems/c/src/../../testsuites/sptests/../support/include
> -mno-hw-mul -mno-hw-div -O0 -g -Wall -Wmissing-prototypes
> -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT
> init.o -MD -MP -MF .deps/init.Tpo -c -o init.o
> ../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c
> mv -f .deps/init.Tpo .deps/init.Po
> nios2-rtems4.11-gcc -B../../../../../nios2_iss/lib/ -specs bsp_specs
> -qrtems -mno-hw-mul -mno-hw-div -O0 -g -Wall -Wmissing-prototypes
> -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs
> -mno-hw-mul -mno-hw-div -o spcache01.exe init.o
> init.o: In function `test_data_flush_and_invalidate':
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:46:
> undefined reference to `rtems_cache_get_data_line_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:64:
> undefined reference to `rtems_cache_flush_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:74:
> undefined reference to `rtems_cache_invalidate_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:91:
> undefined reference to `rtems_cache_flush_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:92:
> undefined reference to `rtems_cache_invalidate_multiple_data_lines'
> init.o: In function `test_timing':
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:179:
> undefined reference to `rtems_cache_get_data_line_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:179:
> undefined reference to `rtems_cache_get_data_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:187:
> undefined reference to `rtems_cache_get_data_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:195:
> undefined reference to `rtems_cache_get_data_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:202:
> undefined reference to `rtems_cache_flush_entire_data'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:222:
> undefined reference to `rtems_cache_flush_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:242:
> undefined reference to `rtems_cache_invalidate_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:262:
> undefined reference to `rtems_cache_flush_entire_data'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:282:
> undefined reference to `rtems_cache_flush_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:302:
> undefined reference to `rtems_cache_invalidate_multiple_data_lines'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:318:
> undefined reference to `rtems_cache_get_instruction_line_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:318:
> undefined reference to `rtems_cache_get_instruction_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:326:
> undefined reference to `rtems_cache_get_instruction_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:334:
> undefined reference to `rtems_cache_get_instruction_cache_size'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:341:
> undefined reference to `rtems_cache_invalidate_entire_instruction'
> /users/joel/rtems-4.11-work/rtems-testing/rtems/build-nios2-nios2_iss-rtems/nios2-rtems4.11/c/nios2_iss/testsuites/sptests/spcache01/../../../../../../../rtems/c/src/../../testsuites/sptests/spcache01/init.c:360:
> undefined reference to `rtems_cache_invalidate_multiple_instruction_lines'
> collect2: error: ld returned 1 exit status
> gmake[6]: *** [spcache01.exe] Error 1
>
> --
> Joel Sherrill, Ph.D. Director of Research & Development
> joel.sherrill at OARcorp.com On-Line Applications Research
> Ask me about RTEMS: a free RTOS Huntsville AL 35805
> Support Available (256) 722-9985
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list