Closed ThibFrgsGmz closed 1 year ago
Issue in the linking phase:
[100%] Building CXX object CMakeFiles/App.dir/Main.cpp.obj
[100%] Linking CXX executable bin/leon3-rtems5/App
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(QueuedComponentBase.cpp.obj): in function `_ZN2Fw19QueuedComponentBaseC2EPKc':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/QueuedComponentBase.cpp:10: undefined reference to `_ZN2Os5QueueC1Ev'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(QueuedComponentBase.cpp.obj): in function `_ZN2Fw19QueuedComponentBaseD2Ev':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/QueuedComponentBase.cpp:14: undefined reference to `_ZN2Os5QueueD1Ev'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(ActiveComponentBase.cpp.obj): in function `_ZN2Fw19ActiveComponentBaseC2EPKc':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/ActiveComponentBase.cpp:33: undefined reference to `_ZN2Os4TaskC1Ev'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(ActiveComponentBase.cpp.obj): in function `_ZN2Fw19ActiveComponentBaseD2Ev':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/ActiveComponentBase.cpp:37: undefined reference to `_ZN2Os4TaskD1Ev'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(ActiveComponentBase.cpp.obj): in function `_ZN2Fw19ActiveComponentBase5startEjjjj':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/ActiveComponentBase.cpp:77: undefined reference to `_ZN2Os4Task5startERKN2Fw10StringBaseEPFvPvES5_jjjj'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libFw_CompQueued.a(ActiveComponentBase.cpp.obj): in function `_ZN2Fw19ActiveComponentBase4joinEPPv':
/home/musubi/codelab/fprime-rtems-poc/fprime/Fw/Comp/ActiveComponentBase.cpp:91: undefined reference to `_ZN2Os4Task4joinEPPv'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: /home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: DWARF error: could not find variable specification at offset 66d
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: DWARF error: could not find variable specification at offset 67a
lib/leon3-rtems5/libOs.a(QueueCommon.cpp.obj): in function `_ZN2Os5Queue4sendERKN2Fw19SerializeBufferBaseEiNS0_13QueueBlockingE':
/home/musubi/codelab/fprime-rtems-poc/fprime/Os/QueueCommon.cpp:18: undefined reference to `_ZN2Os5Queue4sendEPKhiiNS0_13QueueBlockingE'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libOs.a(QueueCommon.cpp.obj): in function `_ZN2Os5Queue7receiveERN2Fw19SerializeBufferBaseERiNS0_13QueueBlockingE':
/home/musubi/codelab/fprime-rtems-poc/fprime/Os/QueueCommon.cpp:28: undefined reference to `_ZN2Os5Queue7receiveEPhiRiS2_NS0_13QueueBlockingE'
/home/musubi/rcc-1.3.0-gcc/bin/../lib/gcc/sparc-gaisler-rtems5/10.2.0/../../../../sparc-gaisler-rtems5/bin/ld: lib/leon3-rtems5/libOs.a(QueueCommon.cpp.obj): in function `_ZN2Os5Queue6createERKN2Fw10StringBaseEii':
/home/musubi/codelab/fprime-rtems-poc/fprime/Os/QueueCommon.cpp:44: undefined reference to `_ZN2Os5Queue14createInternalERKN2Fw10StringBaseEii'
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/App.dir/build.make:112: bin/leon3-rtems5/App] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:1860: CMakeFiles/App.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1867: CMakeFiles/App.dir/rule] Error 2
gmake: *** [Makefile:196: App] Error 2
[ERROR] CMake erred with return code 2
Test:
Run:
renode-run
And copy-paste this Renode config:
using sysbus
$name?="Leon3"
mach create $name
machine LoadPlatformDescription @platforms/boards/leon3.repl
path add $ORIGIN
:$prom?="/home/musubi/codelab/fprime-rtems-poc/swil/grlib-gpl-2021.2-b4267/software/leon3/prom.bin"
:$bin?="/home/musubi/codelab/fprime-rtems-poc/App/build-artifacts/leon3-rtems5/bin/App"
showAnalyzer sysbus.uart
macro reset
"""
sysbus LoadBinary $prom 0x0
sysbus LoadELF $bin
cpu PC 0
"""
runMacro $reset
start
Expected output:
(Leon3) runMacro $reset
00:32:02.7957 [INFO] sysbus: Loading segment of 276672 bytes length at 0x40000000.
00:32:02.8025 [INFO] sysbus: Loading segment of 27696 bytes length at 0x400438C0.
00:32:02.8731 [INFO] cpu: Setting PC value to 0x40000000.
00:32:02.8751 [INFO] cpu: Using PC value as Entry Point value : 0x40000000
(Leon3) start
Starting emulation...
00:32:04.9030 [INFO] Leon3: Machine started.
00:32:05.0022 [WARNING] mic: Unhandled read from offset 0x20.
(Leon3) 00:32:05.0342 [INFO] uart: [host: 3.86s (+3.86s)|virt: 1.2ms (+1.2ms)] Hello World
00:32:05.0495 [INFO] uart: [host: 3.88s (+17.12ms)|virt: 1.3ms (+0.1ms)] Hello world Component A | input= 3.000000
00:32:05.0506 [INFO] uart: [host: 3.88s (+1.11ms)|virt: 1.5ms (+0.2ms)] Hello world Component B | input= 3.000000
00:32:05.0511 [INFO] uart: [host: 3.88s (+0.58ms)|virt: 1.6ms (+0.1ms)] Sync Hello world Component C | input= 3.000000
Fix #4