Skip to main content
Associate III
November 21, 2025
Question

locking support with picolib

  • November 21, 2025
  • 2 replies
  • 181 views

I am using the starm-clang with cmake.

I need to use multithreading lock. I understand that in standard PICOLIBC the locking functions are included but just as stubs and "weak" defined and you need to override the functions and define new implementations to use them.

I tried to do this but I get all kinds of "duplicate symbols" errors when I link.

Are you doing something special with the STARM_PICOLIBC library?

Is the locking functions already implemented and functional in you version of PICOLIBC? 

2 replies

dvescoviAuthor
Associate III
December 8, 2025

still waiting on response

Associate II
August 9, 2026

I think this happens when you miss to implement one of the functions in picolibc’s own dummy lock.c

The dummy functions in this file are not defined as weak, so you have to implement all of them to replace.

It’s probably easiest to copy the complete file (libc/misc/lock.c) from picolibc and stuff it with your implementation.