Time & date & other - libc/dietlibc/uclibc/musl difference

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#16 Post by goingnuts »

yeah - and also why dietlibc works (_SC_GETPW_R_SIZE_MAX is not defined) and also uclibc might be excused - from uclibc changelog.full:
PatchSet 3412 (...)Cleanup a few of the more egregiously broken sysconf values to
actually match reality. In particular, _SC_GETPW_R_SIZE_MAX and
_SC_GETGR_R_SIZE_MAX were causing us problems with programs such
as libglib, since they were always returning -1, which is a bit
smaller than the actual passwd and group max buffer sizes.
and from uclibc sysconf.c
/* If you change these, also change libc/pwd_grp/pwd_grp.c to match */
#define PWD_BUFFER_SIZE 256
#define GRP_BUFFER_SIZE 256
case _SC_GETGR_R_SIZE_MAX:
return GRP_BUFFER_SIZE;

case _SC_GETPW_R_SIZE_MAX:
return PWD_BUFFER_SIZE;
I will just patch the glib to set buffer to 1024.
Further progress: Got me a chroot-musl-toolchain to secure nothing sneaks in...now gtk-1.2.10 is almost there. The missing labels are caused in "gdk_set_locale" but I haven't spotted the true cause yet. Bypassing that gives working applications. Fileselect works now but I still have segfaults in textwidget - but that might actually point to the cause for apps like beaver which crash at copy from app2app...

Eventually I hope to get back to deal with time & date differences - kind of got off track lately :)

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#17 Post by Ibidem »

goingnuts wrote: I will just patch the glib to set buffer to 1024.
Further progress: Got me a chroot-musl-toolchain to secure nothing sneaks in...now gtk-1.2.10 is almost there. The missing labels are caused in "gdk_set_locale" but I haven't spotted the true cause yet. Bypassing that gives working applications. Fileselect works now but I still have segfaults in textwidget - but that might actually point to the cause for apps like beaver which crash at copy from app2app...

Eventually I hope to get back to deal with time & date differences - kind of got off track lately :)
http://www.etalabs.net/compare_libcs.html says:
POSIX localedef: no
ie, it's probably a stub you encountered...Ah, src/locale/setlocale.c says this:

Code: Select all

char *setlocale(int category, const char *locale)
{
	/* Note: plain "C" would be better, but puts some broken
	 * software into legacy 8-bit-codepage mode, ignoring
	 * the standard library's multibyte encoding */
	return "C.UTF-8";
}
So what do you do to "bypass" gdk_set_locale...I presume comment out references or make it a NOP?

The main issue for times is that TZ is all musl uses; /etc/zoneinfo is what glibc uses. The plan is to change this--sometime.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#18 Post by goingnuts »

Thx! The return of "C.UTF-8" no matter what I did was puzzling...
To bypass I added:

Code: Select all

if (! strcmp (setlocale (LC_ALL, NULL), "C.UTF-8")) {return; } //musl fix
in start of gdk_set_locale in gdkim.c
The copy/paste can be "solved" by changing line in gdkselection.c/gdk_string_to_compound_text

Code: Select all

#if 0	//musl fix or tinyxlib fixme...
  g_assert (property.encoding == gdk_atom_intern ("COMPOUND_TEXT", FALSE) && property.format == 8);
#endif
...but that might be a general fix as for the first time a copy/paste from one beaver to another beaver - WORKS!

Post Reply