is adding new private symbols to libc frowned upon?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

is adding new private symbols to libc frowned upon?

yuripv
Essentially, I need the __collate_equiv_value symbol to be visible to
libregex for the changes in https://reviews.freebsd.org/D18531.  Is the
following change OK (it works, at least), or should try to avoid that?

--- a/lib/libc/locale/Symbol.map
+++ b/lib/libc/locale/Symbol.map
@@ -212,6 +212,7 @@ FBSD_1.3 {
 FBSDprivate_1.0 {
        _PathLocale;
        __detect_path_locale;
+       __collate_equiv_value;
        __collate_load_error;
        __collate_range_cmp;
 };


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: is adding new private symbols to libc frowned upon?

Konstantin Belousov
On Sat, Dec 22, 2018 at 04:38:52AM +0300, Yuri Pankov wrote:

> Essentially, I need the __collate_equiv_value symbol to be visible to
> libregex for the changes in https://reviews.freebsd.org/D18531.  Is the
> following change OK (it works, at least), or should try to avoid that?
>
> --- a/lib/libc/locale/Symbol.map
> +++ b/lib/libc/locale/Symbol.map
> @@ -212,6 +212,7 @@ FBSD_1.3 {
>  FBSDprivate_1.0 {
>         _PathLocale;
>         __detect_path_locale;
> +       __collate_equiv_value;
>         __collate_load_error;
>         __collate_range_cmp;
>  };
>
Then libregex must always match the installed libc.

I looked at the the libregex/Makefile and my question is, what is the
difference between exports from libc/regex vs. libregex.  Can libregex
become ELF filter for libc ?


_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: is adding new private symbols to libc frowned upon?

Kyle Evans-3
On Sat, Dec 22, 2018 at 12:42 AM Konstantin Belousov
<[hidden email]> wrote:

>
> On Sat, Dec 22, 2018 at 04:38:52AM +0300, Yuri Pankov wrote:
> > Essentially, I need the __collate_equiv_value symbol to be visible to
> > libregex for the changes in https://reviews.freebsd.org/D18531.  Is the
> > following change OK (it works, at least), or should try to avoid that?
> >
> > --- a/lib/libc/locale/Symbol.map
> > +++ b/lib/libc/locale/Symbol.map
> > @@ -212,6 +212,7 @@ FBSD_1.3 {
> >  FBSDprivate_1.0 {
> >         _PathLocale;
> >         __detect_path_locale;
> > +       __collate_equiv_value;
> >         __collate_load_error;
> >         __collate_range_cmp;
> >  };
> >
> Then libregex must always match the installed libc.
>
> I looked at the the libregex/Makefile and my question is, what is the
> difference between exports from libc/regex vs. libregex.  Can libregex
> become ELF filter for libc ?
>

libregex is going to be getting more complicated [1] after a couple
more exp-runs. I can possibly re-work it to make a filter work
(perhaps?), but I'm not sure how badly that will impact the
performance of libc regex.

[1] https://reviews.freebsd.org/D12935
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: is adding new private symbols to libc frowned upon?

yuripv
Kyle Evans wrote:

> On Sat, Dec 22, 2018 at 12:42 AM Konstantin Belousov
> <[hidden email]> wrote:
>>
>> On Sat, Dec 22, 2018 at 04:38:52AM +0300, Yuri Pankov wrote:
>>> Essentially, I need the __collate_equiv_value symbol to be visible to
>>> libregex for the changes in https://reviews.freebsd.org/D18531.  Is the
>>> following change OK (it works, at least), or should try to avoid that?
>>>
>>> --- a/lib/libc/locale/Symbol.map
>>> +++ b/lib/libc/locale/Symbol.map
>>> @@ -212,6 +212,7 @@ FBSD_1.3 {
>>>  FBSDprivate_1.0 {
>>>         _PathLocale;
>>>         __detect_path_locale;
>>> +       __collate_equiv_value;
>>>         __collate_load_error;
>>>         __collate_range_cmp;
>>>  };
>>>
>> Then libregex must always match the installed libc.
>>
>> I looked at the the libregex/Makefile and my question is, what is the
>> difference between exports from libc/regex vs. libregex.  Can libregex
>> become ELF filter for libc ?
>>
>
> libregex is going to be getting more complicated [1] after a couple
> more exp-runs. I can possibly re-work it to make a filter work
> (perhaps?), but I'm not sure how badly that will impact the
> performance of libc regex.
>
> [1] https://reviews.freebsd.org/D12935
I don't think making libregex a filter for libc will work here as you
intend it to have different functionality, even if compiling the same
source files.

OTOH, the function isn't easily decoupled from libc (if at all) as it
needs to know internal implementation details, hence my original question.


signature.asc (499 bytes) Download Attachment