mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Add `intl` to EMPTY_LIB_NAMES.
@ 2016-03-08  5:50 OGINO Masanori
  2016-03-11  4:58 ` Rich Felker
  0 siblings, 1 reply; 9+ messages in thread
From: OGINO Masanori @ 2016-03-08  5:50 UTC (permalink / raw)
  To: musl; +Cc: OGINO Masanori

It makes programs that depend on libintl work with musl.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ec54880..394b32f 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
 INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
 ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
 
-EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
+EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl intl
 EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
 CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
 STATIC_LIBS = lib/libc.a
-- 
2.4.10



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-08  5:50 [PATCH] Add `intl` to EMPTY_LIB_NAMES OGINO Masanori
@ 2016-03-11  4:58 ` Rich Felker
  2016-03-11  7:13   ` Masanori Ogino
  0 siblings, 1 reply; 9+ messages in thread
From: Rich Felker @ 2016-03-11  4:58 UTC (permalink / raw)
  To: musl

On Tue, Mar 08, 2016 at 02:50:51PM +0900, OGINO Masanori wrote:
> It makes programs that depend on libintl work with musl.
> 
> Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index ec54880..394b32f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -60,7 +60,7 @@ GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
>  INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
>  ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
>  
> -EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
> +EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl intl
>  EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
>  CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
>  STATIC_LIBS = lib/libc.a

Sorry for not responding to this sooner. I think we need more
information to know if this is a good idea. The other libs in
EMPTY_LIBS are standard names specified by POSIX, whereas libintl is a
GNU thing, and I think some distros are using GNU libintl alongside
musl (mainly for legacy reasons). Adding this might break things for
them. From what I remember, the core problem here is that the autoconf
tests for gettext wrongly detect that musl does not have a suitable
gettext (because they probe for glibc-internal symbols) and these
packages are trying to use an external GNU libintl instead. Perhaps
someone who's followed the issue closely could link to the old threads
on it, or bugtracker items?

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-11  4:58 ` Rich Felker
@ 2016-03-11  7:13   ` Masanori Ogino
  2016-03-11  7:21     ` Masanori Ogino
  2016-03-12 15:30     ` Rich Felker
  0 siblings, 2 replies; 9+ messages in thread
From: Masanori Ogino @ 2016-03-11  7:13 UTC (permalink / raw)
  To: musl

2016-03-11 13:58 GMT+09:00 Rich Felker <dalias@libc.org>:
> On Tue, Mar 08, 2016 at 02:50:51PM +0900, OGINO Masanori wrote:
>> It makes programs that depend on libintl work with musl.
>>
>> Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
>> ---
>>  Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index ec54880..394b32f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -60,7 +60,7 @@ GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
>>  INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
>>  ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
>>
>> -EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
>> +EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl intl
>>  EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
>>  CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
>>  STATIC_LIBS = lib/libc.a
>
> Sorry for not responding to this sooner.

No problem. Thank you for the reply.

> I think we need more information to know if this is a good idea. The other libs in
> EMPTY_LIBS are standard names specified by POSIX, whereas libintl is a
> GNU thing, and I think some distros are using GNU libintl alongside
> musl (mainly for legacy reasons). Adding this might break things for
> them.

OK, I understood. I use Gentoo Linux (its musl userland uses musl's
libintl) and found that a package failed to link to libintl with musl,
so I sent the patch. The failure was actually a bug of the distro,
though.

> From what I remember, the core problem here is that the autoconf
> tests for gettext wrongly detect that musl does not have a suitable
> gettext (because they probe for glibc-internal symbols) and these
> packages are trying to use an external GNU libintl instead. Perhaps
> someone who's followed the issue closely could link to the old threads
> on it, or bugtracker items?
>
> Rich

Now I got them thanks to Google:

http://www.openwall.com/lists/musl/2015/04/16/1
http://www.openwall.com/lists/musl/2015/04/16/2
http://www.openwall.com/lists/musl/2015/04/16/3
http://www.openwall.com/lists/musl/2015/04/16/4
http://savannah.gnu.org/bugs/?46436
http://lists.gnu.org/archive/html/bug-gettext/2015-11/msg00015.html

From the last link:
> According to the post linked from the above, the check seems to be there
> to exclude incompatible implementations of gettext(), like Solaris 7 and
> NetBSD:
> https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
>
> If musl's gettext implementation is compatible with GNU gettext, I guess
> we could adjust the check to accept it.  However, I have no idea which
> symbols or macros can be used for the check.  It would be helpful if
> musl people could chime in and give us a hint.

-- 
Masanori Ogino


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-11  7:13   ` Masanori Ogino
@ 2016-03-11  7:21     ` Masanori Ogino
  2016-03-12 12:09       ` Felix Janda
  2016-03-12 15:30     ` Rich Felker
  1 sibling, 1 reply; 9+ messages in thread
From: Masanori Ogino @ 2016-03-11  7:21 UTC (permalink / raw)
  To: musl

2016-03-11 16:13 GMT+09:00 Masanori Ogino <masanori.ogino@gmail.com>:
> From the last link:
>> According to the post linked from the above, the check seems to be there
>> to exclude incompatible implementations of gettext(), like Solaris 7 and
>> NetBSD:
>> https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
>>
>> If musl's gettext implementation is compatible with GNU gettext, I guess
>> we could adjust the check to accept it.  However, I have no idea which
>> symbols or macros can be used for the check.  It would be helpful if
>> musl people could chime in and give us a hint.

Well, is `__USE_GNU_GETTEXT` suitable for that?

-- 
Masanori Ogino


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-11  7:21     ` Masanori Ogino
@ 2016-03-12 12:09       ` Felix Janda
  2016-03-12 15:32         ` Rich Felker
  2016-03-12 22:25         ` Masanori Ogino
  0 siblings, 2 replies; 9+ messages in thread
From: Felix Janda @ 2016-03-12 12:09 UTC (permalink / raw)
  To: musl

Masanori Ogino wrote:
> 2016-03-11 16:13 GMT+09:00 Masanori Ogino <masanori.ogino@gmail.com>:
> > From the last link:
> >> According to the post linked from the above, the check seems to be there
> >> to exclude incompatible implementations of gettext(), like Solaris 7 and
> >> NetBSD:
> >> https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
> >>
> >> If musl's gettext implementation is compatible with GNU gettext, I guess
> >> we could adjust the check to accept it.  However, I have no idea which
> >> symbols or macros can be used for the check.  It would be helpful if
> >> musl people could chime in and give us a hint.
> 
> Well, is `__USE_GNU_GETTEXT` suitable for that?

That depends on whether the incompatible implementations do not also
define this macro. The NetBSD libintl.h header does not seem to do so.
However I'm not sure about Solaris. According to the man page its
libintl.h does define GNU_GETTEXT_SUPPORTED_REVISION but it's not clear
whether or not __USE_GNU_GETTEXT is also defined.

It can't hurt to ask on the gettext list.

Felix


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-11  7:13   ` Masanori Ogino
  2016-03-11  7:21     ` Masanori Ogino
@ 2016-03-12 15:30     ` Rich Felker
  2016-03-12 22:28       ` Masanori Ogino
  1 sibling, 1 reply; 9+ messages in thread
From: Rich Felker @ 2016-03-12 15:30 UTC (permalink / raw)
  To: musl

On Fri, Mar 11, 2016 at 04:13:31PM +0900, Masanori Ogino wrote:
> Now I got them thanks to Google:
> 
> http://www.openwall.com/lists/musl/2015/04/16/1
> http://www.openwall.com/lists/musl/2015/04/16/2
> http://www.openwall.com/lists/musl/2015/04/16/3
> http://www.openwall.com/lists/musl/2015/04/16/4
> http://savannah.gnu.org/bugs/?46436
> http://lists.gnu.org/archive/html/bug-gettext/2015-11/msg00015.html
> 
> >From the last link:
> > According to the post linked from the above, the check seems to be there
> > to exclude incompatible implementations of gettext(), like Solaris 7 and
> > NetBSD:
> > https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
> >
> > If musl's gettext implementation is compatible with GNU gettext, I guess
> > we could adjust the check to accept it.  However, I have no idea which
> > symbols or macros can be used for the check.  It would be helpful if
> > musl people could chime in and give us a hint.

The right fix is to change the logic from

	"If we find glibc-internal symbols"

to:

	"If the public API symbols are there and this isn't Solaris or
	whatever other system has a broken gettext"

I don't know if they are willing to make such a change.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-12 12:09       ` Felix Janda
@ 2016-03-12 15:32         ` Rich Felker
  2016-03-12 22:25         ` Masanori Ogino
  1 sibling, 0 replies; 9+ messages in thread
From: Rich Felker @ 2016-03-12 15:32 UTC (permalink / raw)
  To: musl

On Sat, Mar 12, 2016 at 01:09:54PM +0100, Felix Janda wrote:
> Masanori Ogino wrote:
> > 2016-03-11 16:13 GMT+09:00 Masanori Ogino <masanori.ogino@gmail.com>:
> > > From the last link:
> > >> According to the post linked from the above, the check seems to be there
> > >> to exclude incompatible implementations of gettext(), like Solaris 7 and
> > >> NetBSD:
> > >> https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
> > >>
> > >> If musl's gettext implementation is compatible with GNU gettext, I guess
> > >> we could adjust the check to accept it.  However, I have no idea which
> > >> symbols or macros can be used for the check.  It would be helpful if
> > >> musl people could chime in and give us a hint.
> > 
> > Well, is `__USE_GNU_GETTEXT` suitable for that?
> 
> That depends on whether the incompatible implementations do not also
> define this macro. The NetBSD libintl.h header does not seem to do so.
> However I'm not sure about Solaris. According to the man page its
> libintl.h does define GNU_GETTEXT_SUPPORTED_REVISION but it's not clear
> whether or not __USE_GNU_GETTEXT is also defined.
> 
> It can't hurt to ask on the gettext list.

__USE_* is glibc-features.h-internal machinery to communicate between
the glibc headers (and possibly, by abuse, other GNU projects'
headers) and should never be used publicly.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-12 12:09       ` Felix Janda
  2016-03-12 15:32         ` Rich Felker
@ 2016-03-12 22:25         ` Masanori Ogino
  1 sibling, 0 replies; 9+ messages in thread
From: Masanori Ogino @ 2016-03-12 22:25 UTC (permalink / raw)
  To: musl

2016-03-12 21:09 GMT+09:00 Felix Janda <felix.janda@posteo.de>:
> Masanori Ogino wrote:
>> Well, is `__USE_GNU_GETTEXT` suitable for that?
>
> That depends on whether the incompatible implementations do not also
> define this macro. The NetBSD libintl.h header does not seem to do so.
> However I'm not sure about Solaris. According to the man page its
> libintl.h does define GNU_GETTEXT_SUPPORTED_REVISION but it's not clear
> whether or not __USE_GNU_GETTEXT is also defined.

I guess Solaris 7 doesn't define __USE_GNU_GETTEXT too since the
illumos doesn't. I don't have Solaris 7 so I can't confirm, though.

> It can't hurt to ask on the gettext list.

OK. I'll do so.

-- 
Masanori Ogino


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `intl` to EMPTY_LIB_NAMES.
  2016-03-12 15:30     ` Rich Felker
@ 2016-03-12 22:28       ` Masanori Ogino
  0 siblings, 0 replies; 9+ messages in thread
From: Masanori Ogino @ 2016-03-12 22:28 UTC (permalink / raw)
  To: musl

2016-03-13 0:30 GMT+09:00 Rich Felker <dalias@libc.org>:
> The right fix is to change the logic from
>
>         "If we find glibc-internal symbols"
>
> to:
>
>         "If the public API symbols are there and this isn't Solaris or
>         whatever other system has a broken gettext"

Agreed. I will ask them.

-- 
Masanori Ogino


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-03-12 22:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-08  5:50 [PATCH] Add `intl` to EMPTY_LIB_NAMES OGINO Masanori
2016-03-11  4:58 ` Rich Felker
2016-03-11  7:13   ` Masanori Ogino
2016-03-11  7:21     ` Masanori Ogino
2016-03-12 12:09       ` Felix Janda
2016-03-12 15:32         ` Rich Felker
2016-03-12 22:25         ` Masanori Ogino
2016-03-12 15:30     ` Rich Felker
2016-03-12 22:28       ` Masanori Ogino

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).