Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 30 Jul 2014, 11:27
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Compiling with musl (an alternate libc)
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 5 [71 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sat 04 Aug 2012, 21:19    Post subject:  

Currently 0.9.3 has been released; there are several bugfixes for ARM as well as general bugfixes, a static MIPS32 (o32 abi) port, getaddrinfo, ioperm, and iopl have been added (so it's a lot closer to building X), along with a number of syscalls and a few things that improve glibc compatability.

libc.so is the musl loader (ld-musl-$ARCH.so.1). It can now (since 0.9.2, I think) directly execute binaries. If you go
ln -s $syslibdir/libc.so ldd
it acts as ldd (with one exception:
libc.so is not reported, AFAICT)

Rich is testing ASM replacements for some string functions (memcpy is the current project; the version he has is ~2x as fast as the C version).
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sun 12 Aug 2012, 22:36    Post subject:  

FYI, 0.9.4 may be approaching.
MIPS and ARM bugfixes, several optimisations, blowfish crypt, and a few BSD extensions such as fgetln are among the changes.
Rich is asking whether any other features are desired for the release.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4284

PostPosted: Wed 29 Aug 2012, 09:26    Post subject:  

If anyone is following the musl mail list, one of the requests for help was sha1,md5
See:
https://github.com/libtom/libtomcrypt/tree/master/src/hashes
If you'd like to help, or at least inform them ... It seems to be more robust than the proposed alternative and unencumbered with license restrictions

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sat 08 Sep 2012, 15:39    Post subject:  

technosaurus wrote:
If anyone is following the musl mail list, one of the requests for help was sha1,md5
See:
https://github.com/libtom/libtomcrypt/tree/master/src/hashes
If you'd like to help, or at least inform them ... It seems to be more robust than the proposed alternative and unencumbered with license restrictions


Thanks for the info!

By the way, there's a change that just landed that you may be interested in: musl just went from straight ISO C99 by default to _XOPEN_SOURCE=700 _BSD_SOURCE by default. This means that as long as you don't pass -std=c{89,99,11}, a large portion of the functionality will be available OOB.
Also, musl is getting pretty close to C11 support (not threads yet, and there are a few remaining issues, but a large part of it is implemented).
Gregor has ~half of pkgsrc (including Xfce, Xorg, and Mesa) building, so it's fairly compatible now. A large part of the remainder is just dependency waits.
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Thu 20 Sep 2012, 21:50    Post subject:  

musl 0.9.6 has been released.

There have been a number of ~trivial bugfixes and optimizations; -O3 is no longer forced (it had been the default for shared libraries because it actually resulted in smaller binaries);
arm (and mips

technosaurus wrote:
If anyone is following the musl mail list, one of the requests for help was sha1,md5
See:
https://github.com/libtom/libtomcrypt/tree/master/src/hashes
If you'd like to help, or at least inform them ... It seems to be more robust than the proposed alternative and unencumbered with license restrictions

md5 has been implemented, based on freebsd's implementation, which is based on libtomcrypt.
sha1 is not planned (as far as I can tell, no libc supports sha1 crypt).
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Mon 24 Sep 2012, 19:11    Post subject:  

Thanks, want to inform that i was able to build the Puppy guess_fstype with these parameters in the Makefile :
Code:
CC = /usr/local/musl/bin/musl-gcc
CFLAGS = -W -Wall -Os -I/usr/include
LDFLAGS = -static
EXE = guess_fstype

default: $(EXE) tidy

$(EXE):
   @echo "Single compile for guess_fstype ..."
   @$(CC) -o $@ guess_fstype.c main.c $(CFLAGS) $(LDFLAGS) -s
   @ls -sl $@

tidy:
   @rm -f *.o *~ *.bak

clean: tidy
   @rm -f $(EXE)

that works with kernel that have CONFIG_DEBUG_BLOCK_EXT_DEVT=y , which diet was not able using the -nostdinc flag
statically with a size of ls -s 24 while simple gcc LDFLAGS=-static builded too with a bin of ls -s 388 .
Back to top
View user's profile Send private message Visit poster's website 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Wed 05 Dec 2012, 00:19    Post subject:  

musl 0.9.8 is out, and currently under discussion is the roadmap for 0.9.9 / 1.0 (as well as promotional materials and testing). If you've got any issues, it would be nice to hear about them soon.

0.9.8 features support for amd64, x86, arm (big and little endian), mips32 (hardfloat, big/little endian), powerpc (static only), and microblaze.
There are several bugfixes (math, asm, corner cases, ...). 0.9.7 had more bugfixes, though. Also, C11 CMPLX macros are now supported, and a few new features have come in.

Rob Landley is starting to switch Aboriginal over to musl, and OpenWRT has just added musl support recently.
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Mon 31 Dec 2012, 03:35    Post subject:  

jamesbond wrote:
Impressive Very Happy

This is my attempt at building dnsmasq as 32-bit executable under 64-bit environment.

....
4. Went smoothly until it tried to compile log.c, then failed - cannot find _PATH_LOG. This is defined in bits/syslog-path.h, but /opt/musl/include/bits doesn't have this. I just add _PATH_LOG to dnsmasq's config.h and compilation continued and finished.
5. But it failed at link step - saying that it skipped libc.a when searching -lc. This would not happened if I compiled for 64-bits, so I added LDFLAGS=-m32 to the make file, which now looks like this:
Code:
make CC=musl-gcc  CFLAGS"=-Os -static -fno-stack-protector -D_GNU_SOURCE -m32 -I /mnt/sda2/tmp/linux-3.2.2/usr/include/" LDFLAGS=-m32

6. All went well - except that ld cannot find capset/capget.
Code:
dnsmasq.c:(.text+0x1172): undefined reference to `capget'
dnsmasq.c:(.text+0x14d4): undefined reference to `capset'
dnsmasq.c:(.text+0x156a): undefined reference to `capset'

....
Questions:
1. I'm sure the above is not the only one, so the general question is: as I understand it musl strives to be POSIX-compliant (not Linux compliant), however it also strives to be a glibc replacement. musl already implements _GNU_SOURCE, what about compatibilities at this level? Unfortunately, compatibility support == bloat Confused

2. Assuming:
- not trying to cross-compile (not as above)
- not trying to migrate the whole system
- building a static binary
How does libs compiled with musl co-operate with libs compiled with glibc? Let's say I already have a libxxxx compiled with glibc (let say openssl's libssl). Will this work with musl - i.e. if I use musl-gcc and include does -lssl (pointing to the appropriate -L) - will this work? Probably not, I suppose.
If not, then I need to compile openssl again and install it on, say, /opt/musl/openssl, and make sure that all my compiles use that version of libgtk+, no?


Well, I revisited this, and dnsmasq now compiles OOB (make PKG_CONFIG=true CC=musl-gcc) Smile

and _if_ a library does not import glibc-only symbols, it should work with musl.
For those who are curious how compatible musl is, it's currently building:
-Wine
-Over 60% of pkgsrc
-SDL, Qt 4, Xfce and GIMP (with patches)
-FLTK and dillo (no/minimal patches)
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sat 09 Mar 2013, 02:03    Post subject:  

musl 0.9.9 is out, with numerous bugfixes, and much-improved compatability.

Also, for reference--dnsmasq: ~180k static/stripped here.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 779

PostPosted: Sat 09 Mar 2013, 07:23    Post subject:  

atm I have compiled the below packages static with success using musl 0.9.9
snap0001.png
 Description   
 Filesize   39.37 KB
 Viewed   313 Time(s)

snap0001.png


Last edited by goingnuts on Tue 12 Mar 2013, 13:18; edited 7 times in total
Back to top
View user's profile Send private message Visit poster's website 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sat 09 Mar 2013, 21:42    Post subject:  

goingnuts wrote:
atm I have compiled the below packages with success using musl 0.9.9
Quote:
e2fsprogs-1.40.2
elspci-1.0
fileutils-4.1
findutils-4.1.20
freetype-2.4.10
fuse-2.6.0
gdk-pixbuf-0.21.0
giflib-4.1.4
glib-1.2.10
gtk+-1.2.10
guess_fstype_withext4_test1
icewm-1.2.37
imlib-1.9.15
jpeg-6b
jwm-686
libpng-1.2.46
ntfs-3g-2009.3.8
tiff-3.7.0
tinyxlib-0.01
util-linux-2.13-pre7
zlib-1.2.5

Looks like a good start. FYI, though, the branch I pointed you at earlier in the other thread has some changes you may want for building tinyX. The main issue is getting vm86 integrated into the build system properly.
However, I can probably just use Technosaurus's approach and drop that dependency.

You may want to use libpng 1.2.50 for security reasons (there's a bad bug that's fixed in 1.2.49, and a trivial issue fixed in 1.2.50).

Busybox works, but don't enable regexes in busybox vi.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 779

PostPosted: Sun 10 Mar 2013, 06:58    Post subject:  

I will update the list in my previous post as new things come up (if its ok for you...). I have worked further on tinyXlib, slowly working towards X11R-6.7.0 source files. I will upgrade to libpng 1.2.50 - thx.
Back to top
View user's profile Send private message Visit poster's website 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Tue 12 Mar 2013, 18:56    Post subject:  

goingnuts wrote:
I will update the list in my previous post as new things come up (if its ok for you...). I have worked further on tinyXlib, slowly working towards X11R-6.7.0 source files. I will upgrade to libpng 1.2.50 - thx.

That's fine, nice to see progress.

Is this going to go in pupngo? It looks like it should be enough.

I'm contemplating mentioning puplets that use musl to some extent on the musl wiki's list of distros; currently, I think that means Fatdog64.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 779

PostPosted: Wed 13 Mar 2013, 02:52    Post subject:  

Ibidem wrote:
Is this going to go in pupngo? It looks like it should be enough.
A musl-dog that would be Smile
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 779

PostPosted: Sun 17 Mar 2013, 09:43    Post subject:  

I am having problems getting util-linux to build (tried 2.13-pre7 & util-linux-2.22) both with their own problems. I have also tried to search for util-linux-musl-patches but not found something usable...Any hints?
I only need 4 of the aps from it (rev/mount/umount/losetup) but they are quite important as they go in initrd...
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 4 of 5 [71 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0955s ][ Queries: 13 (0.0105s) ][ GZIP on ]