Puppy In-House Development
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
When I did microsaurus, one of the things that really helped to simplify things was making every executable path a symlink to /bin and every library path a symlink to /lib (and similar things with other common areas: modules, images, xdgdirs...) The kernel with builtin initramfs (static Xvesa, jwm, rxvt and busybox) was less than 1Mb. This worked better than I could have expected for speeding up start times when the prime purpose was size reduction. It turns out that a lot of the time goes to looking in directories for executables and libraries, and even kernel module loads were nearly instant with everything in /lib/modules/<version> rather than in subdirs (though certain programs need to be patched to remove those hardcoded paths - ndiswrapper.c is one example)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- Iguleder
- Posts: 2026
- Joined: Tue 11 Aug 2009, 09:36
- Location: Israel, somewhere in the beautiful desert
- Contact:
Currently, the file system is very simple - only /bin and /lib, only static libraries.
Since things fail to build against tinyxlib, I'm currently improving it so it gets installed as libX11.a, while other libraries are links to it. This solves unresolved symbol problems which arise when applications assume they need to link only against a single library, without its dependencies.
EDIT: it's awesome! JWM recognizes all available extensions and X libraries now.
EDIT 2: other applications are still messed up because of static linking. Now I understand why pupngo has shared libraries
Since things fail to build against tinyxlib, I'm currently improving it so it gets installed as libX11.a, while other libraries are links to it. This solves unresolved symbol problems which arise when applications assume they need to link only against a single library, without its dependencies.
EDIT: it's awesome! JWM recognizes all available extensions and X libraries now.
EDIT 2: other applications are still messed up because of static linking. Now I understand why pupngo has shared libraries
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
How are they "messed up by static linking"? I've never had that problem. Is it possible that hardcoded compiled builtin paths need to be fixed? If you build with a standard Puppy, then it will try to put stuff in /usr/... due to $PREFIX env var and many others... for autotools, you need to specify --prefix=, --bindir=, --sysconfdir=, --localstatedir=, etc... and rox requires some xdg dirs to be set.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- Iguleder
- Posts: 2026
- Joined: Tue 11 Aug 2009, 09:36
- Location: Israel, somewhere in the beautiful desert
- Contact:
When an application wants to link against libXt, it assumes libXt is linked against its own dependencies. That's true for shared objects, but not for static libraries - when something links against it statically, you get hundreds of undefined functions.technosaurus wrote:How are they "messed up by static linking"?
EDIT: using pkg-config and passing "--static" through a wrapper in $PATH seems to solve all X11 linking problems.
EDIT 2: lookin' good! Still fighting glib and GTK1, but I got JWM to build with Xft support.
Code: Select all
#!/bin/sh
for i in linux_headers musl lazy_utils loksh tinyxlib xinit zlib tinyxserver font_cursor_misc font_misc_misc font_alias freetype expat fontconfig libxft jwm ttf_bitstream_vera; do sh build.sh $i; done
. ./config
cd $SYSROOT/usr/share/fonts/misc
mkfontscale
mkfontdir
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
You might want to use attached patches.Iguleder wrote:...EDIT 2: lookin' good! Still fighting glib and GTK1, but I got JWM to build with Xft support.
- Attachments
-
- gtk+-1.2.10.diff.gz
- (3.62 KiB) Downloaded 208 times
-
- glib-1.2.10-gstrfuncs.diff.gz
- (2.32 KiB) Downloaded 212 times
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I had that issue once when building gtk1 with musl, but it fixed itself after rerunning configure with a couple of -D*** CFLAGS (I don't recall if it was POSIX, GNU or some other _SOURCE option) ...for musl make sure you enable large file support. Both gtk and glib 1 need a LOT of code cleanup. I started on some of it, but only got about half way through glib (if you can simply ignore the bloat, it would probably only take an hour or so)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Ah yes. musl always has large file support (no 32-bit off_t), so some things do get rather picky...I would not be surprised if that was the issue.
_ALL_SOURCE is supposedly default now, but I'm inclined to pass -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
(just because of some of the GNU braindamage). With musl, -D_XOPEN_SOURCE=700 gives you POSIX2008/POSIX2013, but -D_XOPEN_SOURCE=<number less than 700> gives you that plus the functions that were removed before then.
-D_LARGEFILE64_SOURCE makes musl look like glibc exposing off64_t and related ABI.
_ALL_SOURCE is supposedly default now, but I'm inclined to pass -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
(just because of some of the GNU braindamage). With musl, -D_XOPEN_SOURCE=700 gives you POSIX2008/POSIX2013, but -D_XOPEN_SOURCE=<number less than 700> gives you that plus the functions that were removed before then.
-D_LARGEFILE64_SOURCE makes musl look like glibc exposing off64_t and related ABI.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Here is a useful script helper for sorting:
it could be extended to use strcasecmp, strverscmp
Code: Select all
#include <stdlib.h>
#include <string.h>
static inline int cmp(const void *a, const void *b){
return strcmp(*(const char **)a, *(const char **)b);
}
int main(int argc, char *argv[]){
qsort(++argv, --argc, sizeof(char *), cmp);
while (argc){
write(1,argv[0],strlen(argv[0]));
write(1,(--argc && argv++)?"\t":"\n",1);
}
}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- Iguleder
- Posts: 2026
- Joined: Tue 11 Aug 2009, 09:36
- Location: Israel, somewhere in the beautiful desert
- Contact:
On my way home, I'll try to rebuild glib. I hope it's going to work, since I have only two days to work on it.
Next week I'll be busy with my new apartment, so I won't have much time to mess with this project.
EDIT: I found out that g_malloc() receives a gulong (which is 32-bit), while stat() returns a 64-bit off_t, which gets truncated to ULONG_MAX. I'm currently trying to rebuild GLib and GTK1 with gulong as unsigned int, to see whether the problem is gone.
EDIT 2: the problem persists. I ran GDB and I think the problem is here:
GLib allocates this size, but musl's sysconf() returns -1, (signed) which is put in a gulong (unsigned). I'm rebuilding GLib with a fixed buffer size I took from glibc's headers - this looks more promising
EDIT 3: yay!
Next week I'll be busy with my new apartment, so I won't have much time to mess with this project.
EDIT: I found out that g_malloc() receives a gulong (which is 32-bit), while stat() returns a 64-bit off_t, which gets truncated to ULONG_MAX. I'm currently trying to rebuild GLib and GTK1 with gulong as unsigned int, to see whether the problem is gone.
EDIT 2: the problem persists. I ran GDB and I think the problem is here:
Code: Select all
guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
EDIT 3: yay!
- Attachments
-
- emelfm.png
- (6.62 KiB) Downloaded 430 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
- Iguleder
- Posts: 2026
- Joined: Tue 11 Aug 2009, 09:36
- Location: Israel, somewhere in the beautiful desert
- Contact:
More good news - I got emelFM and Beaver to cross-compile cleanly, without any modifications, using wrappers for glib-config and gtk-config.
Any recommendations for more GTK1 applications? Currently, ROX-Filer and mtPaint are the TODO list.
Any recommendations for more GTK1 applications? Currently, ROX-Filer and mtPaint are the TODO list.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]
In GTK+2 that part was done properly:Iguleder wrote:the problem persists. I ran GDB and I think the problem is here:GLib allocates this size, but musl's sysconf() returns -1, (signed) which is put in a gulong (unsigned). I'm rebuilding GLib with a fixed buffer size I took from glibc's headers - this looks more promisingCode: Select all
guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
Code: Select all
glong bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
if (bufsize < 0) bufsize = 64;
Last I knew mhwaveedit still supported GTK1...greengeek wrote:Maybe a basic audio recording program? (Is there a GTK1 version of something like mhwaveedit??). And a basic audio player.
Yup,
Code: Select all
--disable-gtk2 Don't use GTK+ 2, use 1.2 instead
For an audio player I recommend the old standby: xmms (1.2.11).
OTOH, it may be hard to get it working statically--haven't tried, but I know it relies on plugins.
Other programs:
gato (gtk1 "at" interface)
geg (graphing calculator)
manedit (a gui for writing manpages)
gtkpool (gtk1 billiards game)
gps (gtk1 "ps" interface/odd task manager, not a GPS program)
paul, danpei, gtksee (image viewers)
gpppon
That's what I can remember, but...I know there were a lot more.
Ah yes, gtkboard, and wallp.