mailing list of musl libc
 help / color / mirror / code / Atom feed
* links to some info/sources (Heirloom, pcc, ncurses)?
@ 2012-06-18 15:11 Jens Staal
  2012-06-18 16:06 ` John Spencer
  2012-06-18 16:31 ` Szabolcs Nagy
  0 siblings, 2 replies; 8+ messages in thread
From: Jens Staal @ 2012-06-18 15:11 UTC (permalink / raw)
  To: musl

Hi

I have been playing with putting up some AURs for stuff statically
linked against musl, like Heirloom
https://aur.archlinux.org/packages.php?ID=59806 (toolchest) (zlib
dependent packages built, ncurses ones still on TODO)
https://aur.archlinux.org/packages.php?ID=59908 (jsh) (had to disable
ACCT but seems to be working ok anyway)

I have seen some messages pass about someone setting up a
musl-compiled pcc (and pcc-compiled musl) that was able to build
Heirloom and I just wonder if there is a source for the pcc wrapper
script used (similar to the musl-gcc one). I am interested in trying
something similar in AUR (and put it in as an optional compilation
alternative for the Heirloom packages), but my googling failed to find
a good source.

The second question was regarding ncurses. Some utilities in Heirloom
require curses but I fail to build it for musl - but it seems to be in
Sabotage. Are there any good patches/tricks around to get it to build?


Ps. has anyone tried replacing busybox with Heirloom in Sabotage? Ds.


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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-18 15:11 links to some info/sources (Heirloom, pcc, ncurses)? Jens Staal
@ 2012-06-18 16:06 ` John Spencer
  2012-06-18 16:31 ` Szabolcs Nagy
  1 sibling, 0 replies; 8+ messages in thread
From: John Spencer @ 2012-06-18 16:06 UTC (permalink / raw)
  To: musl; +Cc: Jens Staal

On 06/18/2012 05:11 PM, Jens Staal wrote:
> The second question was regarding ncurses. Some utilities in Heirloom
> require curses but I fail to build it for musl - but it seems to be in
> Sabotage. Are there any good patches/tricks around to get it to build?
yes it is in sabotage. 
https://github.com/rofl0r/sabotage/blob/master/pkg/ncurses
take a look at the build script.
in case you want a more specific answer, provide more specifics (such as 
a buildlog).

btw, a much nicer terminal library than ncurses is available here:
https://github.com/nsf/termbox
this one is straightforward to use, supports UTF8 natively and adds only 
about 20KB to a static binary.
might be an option for heirloom.
> Ps. has anyone tried replacing busybox with Heirloom in Sabotage? Ds.
no, after recent bughunt activities, busybox is now in a really good 
shape (builds entire sabotage with stock utils).
i see no reason to switch to something else.


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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-18 15:11 links to some info/sources (Heirloom, pcc, ncurses)? Jens Staal
  2012-06-18 16:06 ` John Spencer
@ 2012-06-18 16:31 ` Szabolcs Nagy
  2012-06-18 16:41   ` Rich Felker
  1 sibling, 1 reply; 8+ messages in thread
From: Szabolcs Nagy @ 2012-06-18 16:31 UTC (permalink / raw)
  To: musl

* Jens Staal <staal1978@gmail.com> [2012-06-18 17:11:02 +0200]:
> I have seen some messages pass about someone setting up a
> musl-compiled pcc (and pcc-compiled musl) that was able to build
> Heirloom and I just wonder if there is a source for the pcc wrapper
> script used (similar to the musl-gcc one). I am interested in trying
> something similar in AUR (and put it in as an optional compilation
> alternative for the Heirloom packages), but my googling failed to find
> a good source.
> 

building with pcc+musl:

http://www.openwall.com/lists/musl/2012/05/16/4
http://www.openwall.com/lists/musl/2012/05/17/4

i built heirloom with pcc+musl but i think the modifications
i used are mostly the same as the heirloom patches in sabotage

but i can dig up my scripts if you want

> The second question was regarding ncurses. Some utilities in Heirloom
> require curses but I fail to build it for musl - but it seems to be in
> Sabotage. Are there any good patches/tricks around to get it to build?
> 

i managed to build ncurses with musl+pcc using -D_GNU_SOURCE etc

for heirloom i needed minor hacks like

echo '#include <ncurses/curses.h>' >include/curses.h
echo '#include <ncurses/term.h>' >include/term.h



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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-18 16:31 ` Szabolcs Nagy
@ 2012-06-18 16:41   ` Rich Felker
  2012-06-19  1:00     ` Isaac Dunham
  0 siblings, 1 reply; 8+ messages in thread
From: Rich Felker @ 2012-06-18 16:41 UTC (permalink / raw)
  To: musl

On Mon, Jun 18, 2012 at 06:31:35PM +0200, Szabolcs Nagy wrote:
> > The second question was regarding ncurses. Some utilities in Heirloom
> > require curses but I fail to build it for musl - but it seems to be in
> > Sabotage. Are there any good patches/tricks around to get it to build?
> > 
> 
> i managed to build ncurses with musl+pcc using -D_GNU_SOURCE etc

Indeed, it's worked for a long time, but you need to disable the C++
interfaces if you don't have a working C++ toolchain. I don't think
the configure script does this by default. Actually ncurses has A LOT
of broken options by default which you need to fix when running
configure; for instance, it does not support UTF-8 unless you use
--enable-wide or something like that.

> for heirloom i needed minor hacks like
> 
> echo '#include <ncurses/curses.h>' >include/curses.h
> echo '#include <ncurses/term.h>' >include/term.h

This is another issue: the installation paths and filenames. I don't
know the right option to make ncurses install itself as the default
curses library...

Rich


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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-18 16:41   ` Rich Felker
@ 2012-06-19  1:00     ` Isaac Dunham
  2012-06-19  1:08       ` Rich Felker
  0 siblings, 1 reply; 8+ messages in thread
From: Isaac Dunham @ 2012-06-19  1:00 UTC (permalink / raw)
  To: musl

On Mon, 18 Jun 2012 12:41:36 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Mon, Jun 18, 2012 at 06:31:35PM +0200, Szabolcs Nagy wrote:
> > > The second question was regarding ncurses. Some utilities in
> > > Heirloom require curses but I fail to build it for musl - but it
> > > seems to be in Sabotage. Are there any good patches/tricks around
> > > to get it to build?
I used this patch (not sure if still needed):
===
diff -ur ncurses-5.9/ncurses/SigAction.h
ncurses-5.9-d/ncurses/SigAction.h ---
ncurses-5.9/ncurses/SigAction.h	2005-08-06 13:05:32.000000000
-0700 +++ ncurses-5.9-d/ncurses/SigAction.h	2012-04-03
16:32:56.841630774 -0700 @@ -49,6 +49,8 @@ #define HAVE_SIGVEC 0
 #endif
 
+#include <signal.h>
+
 #if HAVE_SIGACTION
 
 #if !HAVE_TYPE_SIGACTION
===
and these configure options:
CC=musl-gcc CFLAGS="-fno-stack-protector -Os -D_GNU_SOURCE" ./configure
--prefix=${PREFIX} --without-cxx --with-fallbacks=xterm
#forgot to add --enable-widec 
(see github.com/idunham/src-musl if you'd like to see my full build
scripts...really, it ended up looking a lot like a pkgbuild, but
somewhat more awkward)
> Indeed, it's worked for a long time, but you need to disable the C++
> interfaces if you don't have a working C++ toolchain. I don't think
> the configure script does this by default. Actually ncurses has A LOT
> of broken options by default which you need to fix when running
> configure; for instance, it does not support UTF-8 unless you use
> --enable-wide or something like that.
I've always used CXX=false for stuff like this...
The --enable-wide is because for some reason, using wchar_t instead of
char breaks the ABI.  

> > for heirloom i needed minor hacks like
> > 
> > echo '#include <ncurses/curses.h>' >include/curses.h
> > echo '#include <ncurses/term.h>' >include/term.h
AKA: 
CPPFLAGS += -I${sysincdir}/ncurses
CFLAGS   += ${CPPFLAGS} # if the makefile ignores CPPFLAGS

> This is another issue: the installation paths and filenames. I don't
> know the right option to make ncurses install itself as the default
> curses library...
It doesn't seem to allow installing $sysincdir/curses.h

FYI: pdcurses may also be an option.

Isaac Dunham



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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-19  1:00     ` Isaac Dunham
@ 2012-06-19  1:08       ` Rich Felker
  2012-06-19  1:47         ` Isaac Dunham
  2012-06-19  5:58         ` Jens Staal
  0 siblings, 2 replies; 8+ messages in thread
From: Rich Felker @ 2012-06-19  1:08 UTC (permalink / raw)
  To: musl

On Mon, Jun 18, 2012 at 06:00:27PM -0700, Isaac Dunham wrote:
> On Mon, 18 Jun 2012 12:41:36 -0400
> Rich Felker <dalias@aerifal.cx> wrote:
> 
> > On Mon, Jun 18, 2012 at 06:31:35PM +0200, Szabolcs Nagy wrote:
> > > > The second question was regarding ncurses. Some utilities in
> > > > Heirloom require curses but I fail to build it for musl - but it
> > > > seems to be in Sabotage. Are there any good patches/tricks around
> > > > to get it to build?
> I used this patch (not sure if still needed):
> ===
> diff -ur ncurses-5.9/ncurses/SigAction.h
> ncurses-5.9-d/ncurses/SigAction.h ---
> ncurses-5.9/ncurses/SigAction.h	2005-08-06 13:05:32.000000000
> -0700 +++ ncurses-5.9-d/ncurses/SigAction.h	2012-04-03
> 16:32:56.841630774 -0700 @@ -49,6 +49,8 @@ #define HAVE_SIGVEC 0
>  #endif
>  
> +#include <signal.h>
> +

I never had problems here..

>  #if HAVE_SIGACTION
>  
>  #if !HAVE_TYPE_SIGACTION
> ===
> and these configure options:
> CC=musl-gcc CFLAGS="-fno-stack-protector -Os -D_GNU_SOURCE" ./configure
> --prefix=${PREFIX} --without-cxx --with-fallbacks=xterm
> #forgot to add --enable-widec 
> (see github.com/idunham/src-musl if you'd like to see my full build
> scripts...really, it ended up looking a lot like a pkgbuild, but
> somewhat more awkward)
> > Indeed, it's worked for a long time, but you need to disable the C++
> > interfaces if you don't have a working C++ toolchain. I don't think
> > the configure script does this by default. Actually ncurses has A LOT
> > of broken options by default which you need to fix when running
> > configure; for instance, it does not support UTF-8 unless you use
> > --enable-wide or something like that.
> I've always used CXX=false for stuff like this...

Nice trick. Does it get ncurses to auto-disable the C++ stuff?

> The --enable-wide is because for some reason, using wchar_t instead of
> char breaks the ABI.  

Yes, but has anybody wanted a non-UTF-8 enabled ncurses in the past 10
years?? It seems like the default should be to build the one people
actually want. With the current default, there's a major risk of
accidentally building the wrong one and building your whole system on
it, then realizing your system is broken, has the wrong ABI, and needs
to be rebuilt from scratch...

> > This is another issue: the installation paths and filenames. I don't
> > know the right option to make ncurses install itself as the default
> > curses library...
> It doesn't seem to allow installing $sysincdir/curses.h

Bleh; what do mainstream distros do then?

> FYI: pdcurses may also be an option.

I suspect it does not support UTF-8...

Rich


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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-19  1:08       ` Rich Felker
@ 2012-06-19  1:47         ` Isaac Dunham
  2012-06-19  5:58         ` Jens Staal
  1 sibling, 0 replies; 8+ messages in thread
From: Isaac Dunham @ 2012-06-19  1:47 UTC (permalink / raw)
  To: musl

On Mon, 18 Jun 2012 21:08:37 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Mon, Jun 18, 2012 at 06:00:27PM -0700, Isaac Dunham wrote:
> > On Mon, 18 Jun 2012 12:41:36 -0400
> > Rich Felker <dalias@aerifal.cx> wrote:
> > 
> > > On Mon, Jun 18, 2012 at 06:31:35PM +0200, Szabolcs Nagy wrote:
> > > > > The second question was regarding ncurses. Some utilities in
> > > > > Heirloom require curses but I fail to build it for musl - but
> > > > > it seems to be in Sabotage. Are there any good patches/tricks
> > > > > around to get it to build?
> > I used this patch (not sure if still needed):

> >  
> > +#include <signal.h>
> > +
> 
> I never had problems here..
> 
I may have tried building w/o _GNU_SOURCE, gotten it further that way,
then switched _GNU_SOURCE on. I don't remember, though--I did that a
long time ago.
> > and these configure options:
> > CC=musl-gcc CFLAGS="-fno-stack-protector -Os
> > -D_GNU_SOURCE" ./configure --prefix=${PREFIX} --without-cxx
> > --with-fallbacks=xterm #forgot to add --enable-widec 
> > (see github.com/idunham/src-musl if you'd like to see my full build
> > scripts...really, it ended up looking a lot like a pkgbuild, but
> > somewhat more awkward)
> > > Indeed, it's worked for a long time, but you need to disable the
> > > C++ interfaces if you don't have a working C++ toolchain. I don't
> > > think the configure script does this by default. Actually ncurses
> > > has A LOT of broken options by default which you need to fix when
> > > running configure; for instance, it does not support UTF-8 unless
> > > you use --enable-wide or something like that.
> > I've always used CXX=false for stuff like this...
> Nice trick. Does it get ncurses to auto-disable the C++ stuff?
I guess not:

cd ../objects;  false -I../c++ -I../include -I. -DHAVE_CONFIG_H
-DNDEBUG -I. -I../include -I/home/ibid/test/ncurses/include
-c ../c++/cursesf.cc 
make[1]: *** [../objects/cursesf.o] Error 1
make[1]: Leaving directory `/home/ibid/misc/src/musl/ncurses-5.9/c++'
make: *** [all] Error 2

There are many other packages that do need that.
(BTW, I think that trick was courtesy of Landley).

> > The --enable-wide is because for some reason, using wchar_t instead
> > of char breaks the ABI.  
> 
> Yes, but has anybody wanted a non-UTF-8 enabled ncurses in the past 10
> years?? It seems like the default should be to build the one people
> actually want. With the current default, there's a major risk of
> accidentally building the wrong one and building your whole system on
> it, then realizing your system is broken, has the wrong ABI, and needs
> to be rebuilt from scratch...
The solution they had was give it a different library name
(libncursesw)...which does mean that that scenario isn't likely.
> > > This is another issue: the installation paths and filenames. I
> > > don't know the right option to make ncurses install itself as the
> > > default curses library...
> > It doesn't seem to allow installing $sysincdir/curses.h
> Bleh; what do mainstream distros do then?
OK, configure --help lies about its behavior.
Use --includedir=$prefix/include

Anyhow...
re: pcc:
Probably the best thing if you want to link programs with a shared musl
using pcc is to patch & recompile. It hard-codes the dynamic
linker; -dynamic may work. You must rm -r musl/src/complex/ to build
musl with pcc.



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

* Re: links to some info/sources (Heirloom, pcc, ncurses)?
  2012-06-19  1:08       ` Rich Felker
  2012-06-19  1:47         ` Isaac Dunham
@ 2012-06-19  5:58         ` Jens Staal
  1 sibling, 0 replies; 8+ messages in thread
From: Jens Staal @ 2012-06-19  5:58 UTC (permalink / raw)
  To: musl

2012/6/19 Rich Felker <dalias@aerifal.cx>:
> On Mon, Jun 18, 2012 at 06:00:27PM -0700, Isaac Dunham wrote:
>> On Mon, 18 Jun 2012 12:41:36 -0400
>> Rich Felker <dalias@aerifal.cx> wrote:

>
>> FYI: pdcurses may also be an option.
>
> I suspect it does not support UTF-8...
>
> Rich

pdcurses apparently need X11 headers and stuff. I looked briefly at it.
At the moment I am looking at the termbox which looks interesting and
checking whether a "fake" curses.h and term.h to "translate" expected
ncurses functions to termbox could work... (if it will work it will
most likely only be for simple use cases)


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

end of thread, other threads:[~2012-06-19  5:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-18 15:11 links to some info/sources (Heirloom, pcc, ncurses)? Jens Staal
2012-06-18 16:06 ` John Spencer
2012-06-18 16:31 ` Szabolcs Nagy
2012-06-18 16:41   ` Rich Felker
2012-06-19  1:00     ` Isaac Dunham
2012-06-19  1:08       ` Rich Felker
2012-06-19  1:47         ` Isaac Dunham
2012-06-19  5:58         ` Jens Staal

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).