This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH 2/2, newlib] Allow locking routine to be retargeted
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Mon, 30 Jan 2017 19:53:14 +0100
- Subject: Re: [PATCH 2/2, newlib] Allow locking routine to be retargeted
- Authentication-results: sourceware.org; auth=none
- References: <53697464-af87-8917-c5ec-b1a0d06cca00@foss.arm.com>
OK, more strangeness...
The idea that a linking error will be produced when you provide an
incomplete retarteging implementation generally works correctly, with
exception of two locks. If I remove the storage for most of the locks,
linking indeed fails with "multiple definitions" error. But this does
not apply to the lock for at_quick_exit() ("__atexit_mutex" or
"__at_quick_exit_mutex") and telldir() ("__dd_hash_lock" or
"__dd_hash_mutex").
1. Why is the lock used by at_quick_exit() not required - I have no
idea. The linking error (when I do not provide storage for this lock)
about multiple definitions is visible only when I actually use the
at_quick_exit() function.
2. It seems that the lock for dd_hash from posix/telldir.c is not
really needed, at least with the newlib configuration which I'm using.
Whole posix/ folder is not compiled at all, so no file from this path
is included in libc.a. Sorry for the earlier confusion.
Regards,
FCh