Merge branch 'feature/libstd++-use-posix-pthread' into 'master'

tools: enable libstd++ to use idf posix-semaphores

Closes GCC-305 and IDFGH-9209

See merge request espressif/esp-idf!23588
This commit is contained in:
Alexey Lapshin
2023-05-10 20:06:16 +08:00
2 changed files with 5 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ int sem_post(sem_t *sem);
* * It is possible, though unlikely, that the task is preempted directly after the timeout calculation, * * It is possible, though unlikely, that the task is preempted directly after the timeout calculation,
* delaying timeout of the following blocking operating system call by the duration of the preemption. * delaying timeout of the following blocking operating system call by the duration of the preemption.
*/ */
int sem_timedwait(sem_t * restrict semaphore, const struct timespec *restrict abstime); int sem_timedwait(sem_t *semaphore, const struct timespec *abstime);
/** /**
* This is a POSIX function, please refer to the POSIX specification for a detailed description. * This is a POSIX function, please refer to the POSIX specification for a detailed description.
@@ -66,7 +66,7 @@ int sem_wait(sem_t *sem);
/** /**
* This is a POSIX function, please refer to the POSIX specification for a detailed description. * This is a POSIX function, please refer to the POSIX specification for a detailed description.
*/ */
int sem_getvalue(sem_t *restrict sem, int *restrict sval); int sem_getvalue(sem_t *sem, int *sval);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -93,7 +93,9 @@ function(__build_set_default_build_specifications)
unset(c_compile_options) unset(c_compile_options)
unset(cxx_compile_options) unset(cxx_compile_options)
list(APPEND compile_definitions "_GNU_SOURCE") list(APPEND compile_definitions "_GLIBCXX_USE_POSIX_SEMAPHORE" # These two lines enable libstd++ to use
"_GLIBCXX_HAVE_POSIX_SEMAPHORE" # posix-semaphores from components/pthread
"_GNU_SOURCE")
list(APPEND compile_options "-ffunction-sections" list(APPEND compile_options "-ffunction-sections"
"-fdata-sections" "-fdata-sections"