Discussion:
[ast-developers] Attempting to build ksh on musl libc
Isaac
2013-07-01 02:54:59 UTC
Permalink
Hello,
I'm attempting to build ast-base for the sake of ksh93 on a new Linux libc,
musl[1]; I am using musl 0.9.11.
The attempt was made on a minimal system with musl as the native libc,
but it's quite simple to install it in parallel with libc6 and use
the musl-gcc wrapper as CC (see option 1 in [2] for details).

I grabbed the latest releases today from the main download page
for INIT and ast-base.

After extracting in ~/ast/, I typed this:
bin/package make CFLAGS="-D_ALL_SOURCE -Os" 2>&1 |tee ast-pkg-make.log

The attempt to compile appears to stop pretty quick; I'm attaching the
build log (bz2 compressed since it's nearly 19 megabytes, for some reason.)

I notice that a great number of iffe tests are giving false negatives;
I don't know why this is.
musl implements C99 and most of SUS4/POSIX2008 (-D_XOPEN_SOURCE=700),
as well as many GNU extensions (available with -D_GNU_SOURCE) and several BSD
extensions (-D_BSD_SOURCE); -D_ALL_SOURCE makes all of them available.
However, it does have much less of the nested header inclusions than
libc6.
Defining __USE_GNU is not going to do anything for musl; musl uses the
documented feature test macros exclusively.

Any ideas what's wrong?

Thanks,
Isaac Dunham

[1] http://www.musl-libc.org/
[2] http://git.musl-libc.org/cgit/musl/tree/INSTALL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ast-pkg-make.log.bz2
Type: application/octet-stream
Size: 239595 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130630/cc9def20/attachment-0001.obj>
Irek Szczesniak
2013-07-01 07:48:43 UTC
Permalink
Post by Isaac
Hello,
I'm attempting to build ast-base for the sake of ksh93 on a new Linux libc,
musl[1]; I am using musl 0.9.11.
The attempt was made on a minimal system with musl as the native libc,
but it's quite simple to install it in parallel with libc6 and use
the musl-gcc wrapper as CC (see option 1 in [2] for details).
I grabbed the latest releases today from the main download page
for INIT and ast-base.
bin/package make CFLAGS="-D_ALL_SOURCE -Os" 2>&1 |tee ast-pkg-make.log
The attempt to compile appears to stop pretty quick; I'm attaching the
build log (bz2 compressed since it's nearly 19 megabytes, for some reason.)
I notice that a great number of iffe tests are giving false negatives;
I don't know why this is.
musl implements C99 and most of SUS4/POSIX2008 (-D_XOPEN_SOURCE=700),
as well as many GNU extensions (available with -D_GNU_SOURCE) and several BSD
extensions (-D_BSD_SOURCE); -D_ALL_SOURCE makes all of them available.
However, it does have much less of the nested header inclusions than
libc6.
Defining __USE_GNU is not going to do anything for musl; musl uses the
documented feature test macros exclusively.
Any ideas what's wrong?
I'm looking, but you'll have more luck with our resident standard
experts Glenn Fowler, David Korn or Roland Mainz. Glenn (who owns
libast and iffe) is unfortunately on vacation for the next two weeks,
maybe David or Roland can have a look.

Which compiler do you use - gcc or clang?

Irek
Isaac
2013-07-01 14:28:59 UTC
Permalink
Post by Irek Szczesniak
Post by Isaac
Hello,
I'm attempting to build ast-base for the sake of ksh93 on a new Linux libc,
musl[1]; I am using musl 0.9.11.
The attempt was made on a minimal system with musl as the native libc,
but it's quite simple to install it in parallel with libc6 and use
the musl-gcc wrapper as CC (see option 1 in [2] for details).
I grabbed the latest releases today from the main download page
for INIT and ast-base.
bin/package make CFLAGS="-D_ALL_SOURCE -Os" 2>&1 |tee ast-pkg-make.log
The attempt to compile appears to stop pretty quick; I'm attaching the
build log (bz2 compressed since it's nearly 19 megabytes, for some reason.)
I notice that a great number of iffe tests are giving false negatives;
I don't know why this is.
<snip>
Post by Irek Szczesniak
Post by Isaac
Any ideas what's wrong?
I'm looking, but you'll have more luck with our resident standard
experts Glenn Fowler, David Korn or Roland Mainz. Glenn (who owns
libast and iffe) is unfortunately on vacation for the next two weeks,
maybe David or Roland can have a look.
Which compiler do you use - gcc or clang?
GCC 3.4.6 in this case (for compilation speed and lower ram use),
with 4.1 to 4.4 available.

Thanks,
Isaac Dunham
Roland Mainz
2013-07-07 00:59:52 UTC
Permalink
Post by Isaac
Post by Irek Szczesniak
Post by Isaac
Hello,
I'm attempting to build ast-base for the sake of ksh93 on a new Linux libc,
musl[1]; I am using musl 0.9.11.
The attempt was made on a minimal system with musl as the native libc,
but it's quite simple to install it in parallel with libc6 and use
the musl-gcc wrapper as CC (see option 1 in [2] for details).
I grabbed the latest releases today from the main download page
for INIT and ast-base.
bin/package make CFLAGS="-D_ALL_SOURCE -Os" 2>&1 |tee ast-pkg-make.log
The attempt to compile appears to stop pretty quick; I'm attaching the
build log (bz2 compressed since it's nearly 19 megabytes, for some reason.)
I notice that a great number of iffe tests are giving false negatives;
I don't know why this is.
<snip>
Post by Irek Szczesniak
Post by Isaac
Any ideas what's wrong?
I'm looking, but you'll have more luck with our resident standard
experts Glenn Fowler, David Korn or Roland Mainz. Glenn (who owns
libast and iffe) is unfortunately on vacation for the next two weeks,
maybe David or Roland can have a look.
Which compiler do you use - gcc or clang?
GCC 3.4.6 in this case (for compilation speed and lower ram use),
Erm... do you force any C language mode like $ gcc -std=c99 ... # ?
Does using something like $ gcc -std=gnu99 ... # fix some issues
("gnu99" means "c99" with GNU extensions... otherwise gcc may be too
strict in many real-world cases) ? One possible (as seen with "clang"
on some platforms) issue may be that "iffe"'s way to find a function
without using the whole prototype is more or less doomed when
compilers apply strict C99 or C1X rules (this basically means we have
to "fix" the whole build system sooner or later to work with ISO C++
compilers to ensure we weeded-out all typing issues) ...
Post by Isaac
with 4.1 to 4.4 available.
Does gcc 4.4 behave the same way ?

----

Bye,
Roland

P.S.: Is there any test machine available in which Glenn or I could
log-in and test it ourselves ?
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Isaac
2013-07-07 03:10:20 UTC
Permalink
Post by Roland Mainz
Post by Isaac
Post by Irek Szczesniak
Which compiler do you use - gcc or clang?
GCC 3.4.6 in this case (for compilation speed and lower ram use),
Erm... do you force any C language mode like $ gcc -std=c99 ... # ?
Not in the above case; I allowed package and iffe to use their default
mode with only -Os forced. (I assume this is no flags, meaning gnu89).
Post by Roland Mainz
Does using something like $ gcc -std=gnu99 ... # fix some issues
("gnu99" means "c99" with GNU extensions... otherwise gcc may be too
strict in many real-world cases) ? One possible (as seen with "clang"
on some platforms) issue may be that "iffe"'s way to find a function
without using the whole prototype is more or less doomed when
compilers apply strict C99 or C1X rules (this basically means we have
to "fix" the whole build system sooner or later to work with ISO C++
compilers to ensure we weeded-out all typing issues) ...
Post by Isaac
with 4.1 to 4.4 available.
Does gcc 4.4 behave the same way ?
I'm expecting so because the last test I did was similar, but will try again.

OK, it's running into another problem--I run this:
export CC=/opt/musl/bin/musl-gcc
bin/package make CC=/opt/musl/bin/musl-gcc
and it says:
..
CC=cc
..
Post by Roland Mainz
P.S.: Is there any test machine available in which Glenn or I could
log-in and test it ourselves ?
Not yet, but I'll try to configure a chroot with ssh.
The docs say that mam needs a shell and compiler; I've been using busybox,
gcc, binutils, and gmake for the main environment.
That also provides a very minimal vi and wget/ftpget.
Would any other software be desired?

Thanks,
Isaac Dunham

Loading...