libgcov: Call __builtin_fork instead of fork
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
Some targets do not provide a prototype for fork, and compilation now
fails with an implicit-function-declaration error.
libgcc/
* libgcov-interface.c (__gcov_fork):
Generated code is the same on x86_64-linux-gnu. Okay for trunk?
Thanks,
Florian
---
libgcc/libgcov-interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: 193ef02a7f4f3e5349ad9cf8d3d4df466a99b677
Comments
On Sat, Dec 02, 2023 at 01:43:22PM +0100, Florian Weimer wrote:
> Some targets do not provide a prototype for fork, and compilation now
> fails with an implicit-function-declaration error.
>
> libgcc/
>
> * libgcov-interface.c (__gcov_fork):
Description missing (Use __builtin_fork instead of fork.).
Ok with that change.
>
> Generated code is the same on x86_64-linux-gnu. Okay for trunk?
>
> Thanks,
> Florian
> ---
> libgcc/libgcov-interface.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c
> index b2ee9308641..d166e98510d 100644
> --- a/libgcc/libgcov-interface.c
> +++ b/libgcc/libgcov-interface.c
> @@ -182,7 +182,7 @@ pid_t
> __gcov_fork (void)
> {
> pid_t pid;
> - pid = fork ();
> + pid = __builtin_fork ();
> if (pid == 0)
> {
> __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_mx);
>
> base-commit: 193ef02a7f4f3e5349ad9cf8d3d4df466a99b677
Jakub
* Jakub Jelinek:
> On Sat, Dec 02, 2023 at 01:43:22PM +0100, Florian Weimer wrote:
>> Some targets do not provide a prototype for fork, and compilation now
>> fails with an implicit-function-declaration error.
>>
>> libgcc/
>>
>> * libgcov-interface.c (__gcov_fork):
>
> Description missing (Use __builtin_fork instead of fork.).
>
> Ok with that change.
Fixed & pushed, thanks.
Florian
@@ -182,7 +182,7 @@ pid_t
__gcov_fork (void)
{
pid_t pid;
- pid = fork ();
+ pid = __builtin_fork ();
if (pid == 0)
{
__GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_mx);