diff --git a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java index 91da4d43c8..e88f8ae38a 100644 --- a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java +++ b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java @@ -312,7 +312,7 @@ CodeBuilder generateCMakeCode( cMakeCode.pr(" target_link_libraries(${LF_MAIN_TARGET} PUBLIC ${MATH_LIBRARY})"); cMakeCode.pr("endif()"); - cMakeCode.pr("target_link_libraries(${LF_MAIN_TARGET} PRIVATE core)"); + cMakeCode.pr("target_link_libraries(${LF_MAIN_TARGET} PRIVATE reactor-c)"); cMakeCode.pr("target_include_directories(${LF_MAIN_TARGET} PUBLIC .)"); cMakeCode.pr("target_include_directories(${LF_MAIN_TARGET} PUBLIC include/)"); @@ -472,10 +472,6 @@ private static String setUpMainTargetZephyr( boolean hasMain, String executableName, Stream cSources) { var code = new CodeBuilder(); code.pr("add_subdirectory(core)"); - code.pr("target_link_libraries(core PUBLIC zephyr_interface)"); - // FIXME: Linking the reactor-c corelib with the zephyr kernel lib - // resolves linker issues but I am not yet sure if it is safe - code.pr("target_link_libraries(core PRIVATE kernel)"); code.newLine(); if (hasMain) { diff --git a/core/src/main/resources/lib/c/reactor-c b/core/src/main/resources/lib/c/reactor-c index b1c87ebeb1..e27698bb71 160000 --- a/core/src/main/resources/lib/c/reactor-c +++ b/core/src/main/resources/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit b1c87ebeb1838600b4635886ec4ea66ca7393feb +Subproject commit e27698bb710ac6b0ae0f8d5e9480c89821574ca7 diff --git a/test/C/src/zephyr/unthreaded/picolib/Picolib.lf b/test/C/src/zephyr/unthreaded/picolib/Picolib.lf new file mode 100644 index 0000000000..c7eab069d4 --- /dev/null +++ b/test/C/src/zephyr/unthreaded/picolib/Picolib.lf @@ -0,0 +1,15 @@ +// A smoke test verifying that we can compile and run using picolibc also. +target C { + platform: "Zephyr", + timeout: 10 sec, + fast: true, + files: "prj.conf" +} + +main reactor { + timer t(0, 1 sec) + + reaction(t) {= + printf("Hello\n"); + =} +} diff --git a/test/C/src/zephyr/unthreaded/picolib/prj.conf b/test/C/src/zephyr/unthreaded/picolib/prj.conf new file mode 100644 index 0000000000..6acb8a7ea1 --- /dev/null +++ b/test/C/src/zephyr/unthreaded/picolib/prj.conf @@ -0,0 +1,2 @@ +CONFIG_NEWLIB_LIBC=n +CONFIG_PICOLIBC=y \ No newline at end of file