Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we also have Heirloom NG as an alternative to GNU Coreutils in the future? #80

Open
takusuman opened this issue Jan 19, 2023 · 64 comments
Assignees
Labels

Comments

@takusuman
Copy link
Contributor

I was taking a look at https://github.com/dslm4515/CMLFS/tree/bsd-userland and thought that it would be interesting to also have Heirloom NG as an alternative to GNU Coreutils.
These tools were derived from UNIX v7, 4BSD and OpenSolaris, while the majority were rewritten from scratch based on the payloads defined for original UNIX tools. I've been maintaining them in the last two years, and also added a new chroot implementation based on the Solaris 2.5 one. It's the main toolset at Copacabana Linux, so it was also patched to build on musl without any problems.
I know we have many problems to solve before, but I just wanted to show it as an alternative.

@dslm4515
Copy link
Owner

Yeah, I was dropping coreutils in favor for bsdutils. I'll check out Heirloom NG as well.

I just need a small set of tools to get a chroot running.

Chimera Linux is VERY interesting. Their patches for LLVM is geared towards musl+libc++, unlike Alpine & Void!

@dslm4515 dslm4515 self-assigned this Jan 20, 2023
@dslm4515 dslm4515 added the To-Do label Jan 20, 2023
@takusuman
Copy link
Contributor Author

I just need a small set of tools to get a chroot running.

Heirloom NG can do the job well, I hope it can help as an alternative. 😄

@dslm4515
Copy link
Owner

dslm4515 commented Jan 21, 2023

Looks like Chimera Linux dropped bsdutils and developed chimerautils.

Chimerautils requires:

  • clang or gcc
  • meson + ninja
  • flex [or another lex]
  • byacc or bison
  • libxo
  • libfts [likely musl-fts]
  • librpmathc [likely musl-rpmatch]

With optional deps:

  • Ncurses [or netbsd-curses]
  • libedit
  • libcrypto [from libreSSL or OpenSSL]

Looks like Heirloom NG has less dependencies ... and chimerautils lacks a chroot binary. It provides a chroot. I just didnt see it in sbin

@dslm4515
Copy link
Owner

Having trouble building heirloom-ng for llvmtools:

clang -z muldefs cpio.o unshrink.o explode.o expand.o inflate.o crc32.o blast.o flags.o nonpax.o version.o -Wl,-Bstatic -lz -Wl,-Bstatic -lbz2 -L../lib
common -lcommon   -o cpio                                                                                                                              
ld.lld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC                                                       
>>> defined in /llvmtools/lib/libz.a(deflate.o)                                                                                                        
>>> referenced by deflate.c                                                                                                                            
>>>               deflate.o:(deflateReset) in archive /llvmtools/lib/libz.a

This is the mk.config I used:

SHELL = /llvmtools/bin/sh
POSIX_SHELL = /llvmtools/bin/sh
ROOT ?=
DEFBIN = /llvmtools/bin
SV3BIN = /llvmtools/bin
S42BIN = /llvmtools/bin
SUSBIN = /llvmtools/bin
UCBBIN = //llvmtools/ucbbin
CCSBIN = /llvmtools/ccs/bin
DEFLIB = /llvmtools/lib
DEFSBIN = /llvmtools/bin
MANDIR = /llvmtools/share/man/5man
DFLDIR = /llvmtools/etc/default
SPELLHIST = /dev/null
SULOG = /llvmtools/var/log/sulog
MAGIC = $(DEFLIB)/magic
TTYGRP = -g utmp
LIBPATH = -L/llvmtools/lib -L/llvmtools/ccs/lib
LCURS = -lcurses
LIBZ = -Wl,-Bstatic -lz
USE_ZLIB = 1
LIBBZ2 = -Wl,-Bstatic -lbz2
USE_BZLIB = 1
CC ?= clang
HOSTCC = clang
WARN=
LD = clang
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -O -fomit-frame-pointer $(WARN)
CFLAGS2 = -O2 -fomit-frame-pointer $(WARN)
CFLAGSS = -Os -fomit-frame-pointer $(WARN)
CFLAGSU = -O2 -fomit-frame-pointer -funroll-loops $(WARN)
STRIP = llvm-strip -s -R .comment -R .note
LARGEF = -D_FILE_OFFSET_BITS=64L
LNS = ln -s
YACC = yacc
LEX = flex
LCRYPT=-lcrypt
RANLIB=(hash ranlib) >/dev/null 2>&1 || exit 0; ranlib
UCBINST = $(ROOT)$(UCBBIN)/install

ICOMMON = -I../libcommon
LCOMMON = -L../libcommon -lcommon

IUXRE = -I../libuxre -DUXRE
LUXRE = -L../libuxre -luxre

MANINST = $(SHELL) ../build/maninst

@dslm4515
Copy link
Owner

If it matters, i rebuilt bzip2 with CFLAGS="-fPIC' ... no change.

@takusuman
Copy link
Contributor Author

If it matters, i rebuilt bzip2 with CFLAGS="-fPIC' ... no change.

In any case, you can disable bzip2 with USE_BZLIB=0, or make them build dynamically by commenting the current definition and enabling the other (as the file instructs).

@takusuman
Copy link
Contributor Author

takusuman commented Jan 21, 2023

Looks like Heirloom NG has less dependencies

In fact, way less. You would just need yacc, lex and curses to build it, just disable support for zlib and bzip2.
... And it also provides some utilities that, in GNU Coreutils, would be provided as individual packages, such as cpio and tar.

@takusuman
Copy link
Contributor Author

If it matters, i rebuilt bzip2 with CFLAGS="-fPIC' ... no change.

In any case, you can disable bzip2 with USE_BZLIB=0, or make them build dynamically by commenting the current definition and enabling the other (as the file instructs).

It's strange to me seeing this error, since it can build fine on Copacabana with musl and GCC... Maybe libbz2 static files aren't installed? @dslm4515

@dslm4515
Copy link
Owner

I am using zlib-ng instead of zlib

But still, even when i disable both, similar error:

make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/cpio'                                                                      [70/1871]
clang -z muldefs cpio.o unshrink.o explode.o expand.o inflate.o crc32.o blast.o flags.o nonpax.o version.o -Wl,-static -lz -Wl,-static -lbz2 -L../libco
mmon -lcommon   -o cpio                                                                                                                                
ld.lld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC                                                       
>>> defined in /llvmtools/lib/libc.a(sysconf.o)                                                                                                        
>>> referenced by sysconf.c                                                                                                                            
>>>               sysconf.o:(sysconf) in archive /llvmtools/lib/libc.a                                                                                 
                                                                                                                                                       
ld.lld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC                                                       
>>> defined in /llvmtools/lib/libc.a(sysconf.o)                                                                                                        
>>> referenced by sysconf.c                                                                                                                            
>>>               sysconf.o:(sysconf) in archive /llvmtools/lib/libc.a                                                                                 
                                                                                                                                                       
ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC                                                        
>>> defined in /llvmtools/lib/libc.a(sysconf.o)                                                                                                        
>>> referenced by sysconf.c                                                                                                                            
>>>               sysconf.o:(.rodata.sysconf+0x0) in archive /llvmtools/lib/libc.a                                                                     
                                                                                                                                                       
ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC                                                        
>>> defined in /llvmtools/lib/libc.a(sysconf.o)                                                                                                        
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x8) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x10) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x18) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x20) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x28) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x30) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x38) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x40) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x48) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(sysconf.o)
>>> referenced by sysconf.c
>>>               sysconf.o:(.rodata.sysconf+0x50) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(__libc_start_main.o)
>>> referenced by __libc_start_main.c 
>>>               __libc_start_main.o:(__init_libc) in archive /llvmtools/lib/libc.a
ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(__libc_start_main.o)
>>> referenced by __libc_start_main.c 
>>>               __libc_start_main.o:(__init_libc) in archive /llvmtools/lib/libc.a

ld.lld: error: cannot preempt symbol: __init_array_start
>>> referenced by __libc_start_main.c 
>>>               __libc_start_main.o:(libc_start_init) in archive /llvmtools/lib/libc.a

ld.lld: error: cannot preempt symbol: __init_array_end
>>> referenced by __libc_start_main.c 
>>>               __libc_start_main.o:(libc_start_init) in archive /llvmtools/lib/libc.a

ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in /llvmtools/lib/libc.a(__libc_start_main.o)
>>> referenced by __libc_start_main.c 
>>>               __libc_start_main.o:(__libc_start_main) in archive /llvmtools/lib/libc.a

ld.lld: error: cannot preempt symbol: __thread_list_lock
>>> defined in /llvmtools/lib/libc.a(__init_tls.o)
>>> referenced by __init_tls.c
>>>               __init_tls.o:(__init_tp) in archive /llvmtools/lib/libc.a 

ld.lld: error: cannot preempt symbol: __libc
>>> defined in /llvmtools/lib/libc.a(libc.o)
>>> referenced by __init_tls.c
>>>               __init_tls.o:(__init_tp) in archive /llvmtools/lib/libc.a 

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:60: cpio] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/cpio'
make: *** [makefile:23: all] Error 2

@takusuman
Copy link
Contributor Author

takusuman commented Jan 21, 2023

I am using zlib-ng instead of zlib

That seems to be ok. I'm building it on Copacabana with sortix-zlib and on Ubuntu with the default zlib (dynamically) and both work. I don't think the zlib implementation is a problem.

But still, even when i disable both, similar error

Did you ran make mrproper after disabling them? It's needed to apply the new configuration at build/mk.config.
In the worst case scenario, apparently (at least, for now), LLVM can't build Heirloom NG statically linked, so you will need to build it dynamically (just comment out LDFLAGS= -static).

@dslm4515
Copy link
Owner

stage1 clang static compiling works. I can build a static binary of libtree:

$ CC=clang make LDFLAGS="-static" 
clang -O2 -std=c99 -Wall -Wextra -Wshadow -pedantic -D_FILE_OFFSET_BITS=64 -c libtree.c
libtree.c:309:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static inline int host_is_little_endian() {
                                       ^
                                        void
1 warning generated.
clang -static -o libtree libtree.o
$

@dslm4515
Copy link
Owner

Did you ran make mrproper

Yes. I'll comment out LDFLAGS= -static next

@takusuman
Copy link
Contributor Author

takusuman commented Jan 21, 2023

Did you ran make mrproper after disabling them? It's needed to apply the new configuration at build/mk.config.

I think I need to cite it in the README some time soon...

In the worst case scenario, apparently (at least, for now), LLVM can't build Heirloom NG statically linked, so you will need to build it dynamically (just comment out LDFLAGS= -static).

stage1 clang static compiling works.

So maybe I can cross this out?

@takusuman
Copy link
Contributor Author

Did you ran make mrproper

Yes.

So maybe I can cross this out?

Eh, maybe not...

@dslm4515
Copy link
Owner

dslm4515 commented Jan 21, 2023

oops. my mk.config was missing LDFLAGS

cpio builds fine

@takusuman
Copy link
Contributor Author

oops. my mk.config was missing LDFLAGS

So maybe this is/was the problem. Try building it again like it was originally: both libbz2 and zlib-ng statically linked plus LDFLAGS= -static. If we can get it working, I can put LLVM in Heirloom NG's compatibility list.

@takusuman
Copy link
Contributor Author

oops. my mk.config was missing LDFLAGS

cpio builds fine

Dynamically? Great!

@dslm4515
Copy link
Owner

I went back to the default: static.

So cpio builds fine. Next roadblock: nawk:

make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.g.c
flex  -t awk.lx.l > awk.lx.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.lx.c
awk.lx.l:277:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                if (c = *lexprog & 0377)
                    ~~^~~~~~~~~~~~~~~~~
awk.lx.l:277:9: note: place parentheses around the assignment to silence this warning
                if (c = *lexprog & 0377)
                      ^
                    (                  )
awk.lx.l:277:9: note: use '==' to turn this assignment into an equality comparison
                if (c = *lexprog & 0377)
                      ^
                      ==
1 warning generated.
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c b.c
In file included from b.c:19:
./y.tab.h:105:2: error: unknown type name 'intptr_t'
        intptr_t        i;
        ^
1 error generated.
make[1]: *** [Makefile:109: b.o] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
make: *** [makefile:23: all] Error 2

@dslm4515
Copy link
Owner

btw, bmake doesnt work:

$ bmake
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 4: Unassociated shell command "banner basename bc bdiff bfs \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 5: Unassociated shell command "cal calendar cat chmod chown chroot \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 6: Unassociated shell command "cksum cmp col comm copy cp cpio csplit cut \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 7: Unassociated shell command "date dc dd deroff diff diff3 dircmp dirname df du \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 8: Unassociated shell command "echo ed env expand expr \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 9: Unassociated shell command "factor file find fmt fmtmsg fold \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 10: Unassociated shell command "getconf getopt grep groups hd head hostname id join \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 11: Unassociated shell command "kill line listusers ln logins logname ls \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 12: Unassociated shell command "mail man mesg mkdir mkfifo mknod more mvdir \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 13: Unassociated shell command "nawk news nice nl nohup oawk od \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 14: Unassociated shell command "paste pathchk pg pgrep pr printenv printf priocntl ps psri
"fo pwd \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 15: Unassociated shell command "random renice rm rmdir \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 16: Unassociated shell command "sdiff sed setpgrp shl sleep sort spell split stty su sum s
"nc \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 17: Unassociated shell command "tabs tail tapecntl tar tcopy tee test time touch tr true t
"ort tty \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 18: Unassociated shell command "ul uname uniq units users wc what who whoami whodo xargs yes"
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 81: Unassociated shell command "CFLAGS="-Os -fomit-frame-pointer" \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 82: Unassociated shell command "CFLAGSS="-Os -fomit-frame-pointer" \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 83: Unassociated shell command "CFLAGS2="-Os -fomit-frame-pointer" \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 84: Unassociated shell command "CFLAGSU="-Os -fomit-frame-pointer" \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 85: Unassociated shell command "LCRYPT= \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 86: Unassociated shell command "IWCHAR=-I../libwchar LWCHAR="-L../libwchar -lwchar" \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 87: Unassociated shell command "DEFBIN=/5bin SV3BIN=/5bin S42BIN=/5bin/s42 \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 88: Unassociated shell command "SUSBIN=/5bin/posix SU3BIN=/5bin/posix2001 UCBBIN=/5bin/ucb
"\
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 89: Unassociated shell command "CCSBIN=/5bin/ccs \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 90: Unassociated shell command "DEFLIB=/5bin/lib DEFSBIN=/5bin MANDIR=/tmp/__man__ \
"make: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 91: Unassociated shell command "DFLDIR=/etc/default SPELLHIST=/var/adm/spellhist \
bmake: "/mnt/cmlfs/sources/heirloom-ng-230120/makefile" line 92: Unassociated shell command "SULOG=/var/log/sulog MAGIC=/5bin/lib/magic"
bmake: Fatal errors encountered -- cannot continue
bmake: stopped in /mnt/cmlfs/sources/heirloom-ng-230120
$

@takusuman
Copy link
Contributor Author

I went back to the default: static.

So cpio builds fine. Next roadblock: nawk:

make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.g.c
flex  -t awk.lx.l > awk.lx.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.lx.c
awk.lx.l:277:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                if (c = *lexprog & 0377)
                    ~~^~~~~~~~~~~~~~~~~
awk.lx.l:277:9: note: place parentheses around the assignment to silence this warning
                if (c = *lexprog & 0377)
                      ^
                    (                  )
awk.lx.l:277:9: note: use '==' to turn this assignment into an equality comparison
                if (c = *lexprog & 0377)
                      ^
                      ==
1 warning generated.
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c b.c
In file included from b.c:19:
./y.tab.h:105:2: error: unknown type name 'intptr_t'
        intptr_t        i;
        ^
1 error generated.
make[1]: *** [Makefile:109: b.o] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
make: *** [makefile:23: all] Error 2

Which version of Heirloom NG are you using? I think this was fixed back in this commit: Projeto-Pindorama/heirloom-ng@6379300

@dslm4515
Copy link
Owner

i used:

https://github.com/Projeto-Pindorama/heirloom-ng/archive/refs/tags/230120.tar.gz

@takusuman
Copy link
Contributor Author

btw, bmake doesnt work:

I think this isn't exactly a bug, but a question of standards.
Heirloom build system was written almost 21 years ago using the "pure" POSIX make syntax, and, if I'm not mistaken, the POSIX syntax isn't compatible with BSD's (and vice-versa).

@takusuman
Copy link
Contributor Author

i used:

https://github.com/Projeto-Pindorama/heirloom-ng/archive/refs/tags/230120.tar.gz

It's the most recent, you're right.
Let me see from where the y.tab.h file is generated and then add the #include <stdint.h> directive to it.

@dslm4515
Copy link
Owner

I think this isn't exactly a bug, but a question of standards.

I was hoping to replace GNU's make with bmake to avoid building texinfo for llvmtools

@takusuman
Copy link
Contributor Author

takusuman commented Jan 21, 2023

For now, a quick-n-dirty fix would be to add #include <stdint.h> to y.tab.h (without running make clean or make mrproper) and then running make again.

@takusuman
Copy link
Contributor Author

I think this isn't exactly a bug, but a question of standards.

I was hoping to replace GNU's make with bmake to avoid building texinfo for llvmtools

Maybe you could use a POSIX make implementation, there's some out there. I don't think porting an entire build system would be possible right now.

@dslm4515
Copy link
Owner

Maybe you could use a POSIX make implementation, there's some out there. I don't think porting an entire build system would be possible right now.

Yeah. I don't want to use chimerautils...it requires musl-compat-headers, musl-fts, musl-rpmatch, libxo, and meson [which need python... not sure if i should just make python host requirement OR add to cgnutools]

@takusuman
Copy link
Contributor Author

By the way, isn't GNU's make needed for building the Linux kernel? I think it's a monster that all of us using Linux will need to have installed in our systems at some point.

@dslm4515
Copy link
Owner

Well, if it helps, there's this make implementation: https://frippery.org/make/

It wont build dash shell [ POSIX shell implementation i chose] :

 config.status: executing depfiles commands
cmlfs:/mnt/cmlfs/sources/dash-0.5.12
$ pdpmake 
pdpmake  all-recursive
Making all in src
  CC       builtins.def
clang-15: error: no input files
pdpmake: failed to build 'builtins.def'
pdpmake: nothing to be done for all-am

But GNU's make builds dash fine... perhaps, i'll try another POSIX make implementation or patch dash.
pdpmake was able to build flex and byacc fine

@dslm4515
Copy link
Owner

By the way, you would only need it in the host, since Heirloom will provide an ed implementation after being installed.

I'll just build ed for cgnutools in case a host does not have ed

@eli-schwartz
Copy link

Yeah. I don't want to use chimerautils...it requires musl-compat-headers, musl-fts, musl-rpmatch, libxo, and meson [which need python... not sure if i should just make python host requirement OR add to cgnutools]

It builds okay with https://sr.ht/~lattis/muon/ , the c99 reimplementation of Meson. No need for python, at least.

@takusuman
Copy link
Contributor Author

Yeah. I don't want to use chimerautils...it requires musl-compat-headers, musl-fts, musl-rpmatch, libxo, and meson [which need python... not sure if i should just make python host requirement OR add to cgnutools]

It builds okay with https://sr.ht/~lattis/muon/ , the c99 reimplementation of Meson. No need for python, at least.

Interesting, I'll take a look at this too.

@dslm4515
Copy link
Owner

No need for python, at least.

YES. muon is good...as in ... Muon for meson, samurai for ninja!

@takusuman
Copy link
Contributor Author

takusuman commented Jan 23, 2023

By the way, you would only need it in the host, since Heirloom will provide an ed implementation after being installed.

I'll just build ed for cgnutools in case a host does not have ed

Were you able to build it in the end?
If yes, which are the versions of the musl libc, Linux kernel and LLVM?

@dslm4515
Copy link
Owner

I'm currently testing chimerautils... definitely will not be the default "coreutils" for llvmtools as it lacks chroot... I rather not expect the host to provide a chroot binary.

When I test heirloom-ng, i'll post the versions

@dslm4515
Copy link
Owner

And I hit a snag with chimerautils: no install binary.

When compiling bmake under chroot, it uses install to install:

bmake: exec(install) failed (No such file or directory)
*** Error code 1

@takusuman, hopefully heirloom-ng has install ?

@eli-schwartz
Copy link

chimerautils does have install, not sure what you mean?

@dslm4515
Copy link
Owner

I configured chimerautils with this meson invocation:

CC=clang CXX=clang++ \
AR=llvm-ar \
AS=llvm-as \
RANLIB=llvm-ranlib \
LD=ld.lld \
STRIP=llvm-strip \
LDFLAGS="-lterminfo " \
meson --prefix=/llvmtools \
      --pkg-config-path /llvmtools/lib/pkgconfig \
      -Dstatic_fts=true \
      -Dstatic_rpmatch=true \
      -Dcolor_ls=true \
      -Dlibcrypto=disabled \
      -Dlibedit=disabled BUILD

Which gave this output:

The Meson build system
Version: 0.63.1
Source dir: /mnt/cmlfs/sources/chimerautils-f5e7bc7ba541b46ff6ff8fe73b3b27a599e898b1
Build dir: /mnt/cmlfs/sources/chimerautils-f5e7bc7ba541b46ff6ff8fe73b3b27a599e898b1/BUILD
Build type: native build
Project name: chimerautils
Project version: 1.0
C compiler for the host machine: clang (clang 3.0.0 "cgnutools 3.0.0 clang version 15.0.6")
C linker for the host machine: clang ld.lld 3.0.0
C++ compiler for the host machine: clang++ (clang 3.0.0 "cgnutools 3.0.0 clang version 15.0.6")
C++ linker for the host machine: clang++ ld.lld 3.0.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wstring-plus-int: YES 
Program flex found: YES (/llvmtools/bin/flex)
Program byacc found: YES (/llvmtools/bin/byacc)
Checking for function "strtoq" : NO 
Checking for function "strlcpy" : YES 
Checking for function "strlcat" : YES 
Checking for function "strtonum" : NO 
Library tinfo found: YES
Dependency libedit skipped: feature libedit disabled
Dependency libcrypto skipped: feature libcrypto disabled
Library m found: YES
Found pkg-config: /bin/pkg-config (1.9.3)
Run-time dependency libxo found: YES 1.6.0
Run-time dependency zlib found: YES 1.2.11.zlib-ng
Library bz2 found: YES
Run-time dependency liblzma found: YES 5.4.0
Checking for function "fts_open" : NO 
Library fts found: YES
Checking for function "rpmatch" : NO 
Library rpmatch found: YES
Run-time dependency threads found: YES
Compiler for C supports arguments -Wclobbered: NO
Program flex found: YES (/llvmtools/bin/flex)
Program byacc found: YES (/llvmtools/bin/byacc)
Checking for function "strtoq" : NO 
Checking for function "strlcpy" : YES 
Checking for function "strlcat" : YES 
Checking for function "strtonum" : NO 
Library tinfo found: YES
Dependency libedit skipped: feature libedit disabled
Dependency libcrypto skipped: feature libcrypto disabled
Library m found: YES
Found pkg-config: /bin/pkg-config (1.9.3)
Run-time dependency libxo found: YES 1.6.0
Run-time dependency zlib found: YES 1.2.11.zlib-ng
Library bz2 found: YES
Run-time dependency liblzma found: YES 5.4.0
Checking for function "fts_open" : NO 
Library fts found: YES
Checking for function "rpmatch" : NO 
Library rpmatch found: YES
Run-time dependency threads found: YES
Compiler for C supports arguments -Wclobbered: NO 
Configuring config.h using configuration
Build targets in project: 115

chimerautils 1.0

  User defined options
    pkg_config_path: /llvmtools/lib/pkgconfig
    prefix         : /llvmtools
    color_ls       : true
    libcrypto      : disabled
    libedit        : disabled
    static_fts     : true
    static_rpmatch : true

Found ninja-1.9.0 at /llvmtools/bin/ninja

Then i installed it to my toolchain in /llvmtools. Only these binaries were installed:

'['         cat      csplit    echo     fmt      head       look      mkfifo   pathchk    rgrep   stat      true       vdir     xzegrep   zgrep
 base32     chgrp    cut       ed       fold     hexdump    ls        mktemp   pr         rm      stdbuf    truncate   wall     xzfgrep   zless
 base64     chmod    date      egrep    getopt   hostid     lzcmp     mv       printenv   rmdir   stty      tsort      wc       xzgrep    zmore
 basename   cksum    dd        env      grep     hostname   lzdiff    nice     printf     sdiff   sum       tty        which    yes       znew
 basenc     cmp      df        expand   groups   id         lzegrep   nl       pwd        sed     tail      ul         who      zcat      zstdegrep
 bzcmp      col      diff      expr     gunzip   join       lzfgrep   nohup    readlink   seq     tee       uname      whoami   zcmp      zstdfgrep
 bzdiff     colrm    diff3     factor   gzcat    kill       lzgrep    nproc    realpath   sh      test      unexpand   write    zdiff     zstdgrep
 bzegrep    column   dir       false    gzexe    link       m4        od       red        sleep   timeout   uniq       xargs    zegrep
 bzfgrep    comm     dirname   fgrep    gzip     ln         mesg      paste    renice     sort    touch     unlink     xzcmp    zfgrep
 bzgrep     cp       du        find     hd       logname    mkdir     patch    rev        split   tr        users      xzdiff   zforce

@eli-schwartz
Copy link

-Dlibcrypto=disabled

There's your problem, chimerautils is based on FreeBSD and includes the -h <hash> -M <metalog> options for the install command -- this needs libcrypto, which you have chosen to disable.

@takusuman
Copy link
Contributor Author

takusuman commented Jan 24, 2023

And I hit a snag with chimerautils: no install binary.

When compiling bmake under chroot, it uses install to install:

bmake: exec(install) failed (No such file or directory)
*** Error code 1

@takusuman, hopefully heirloom-ng has install ?

G'day, Derrick. Sorry for the delay. I'm employed now and I was without time for checking my e-mails until now.
Yes, it have install. If you want a custom destination directory, use ROOT (eg.: ROOT=/tmp/heirloom gmake install)

@dslm4515
Copy link
Owner

Damn. I accidentally executed rm -rf /* instead of rm -rf ./* [while in chroot] and destroyed my CMLFS build.

I guess its good time to test heirloom-ng as the coreutils for chroot.

@dslm4515
Copy link
Owner

Rebuilt cgnutools and llvmtools far enough to reach heirloom-ng. I made sure to copy the build/mk.config and just removed the comments for easy editing. Build still fails at nawk:

make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
byacc -d awk.g.y
byacc: 46 shift/reduce conflicts, 178 reduce/reduce conflicts.
mv -f y.tab.c awk.g.c
(echo '1i'; echo '#include <inttypes.h>'; echo '.'; echo 'w';) | \
	ed -s y.tab.h
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.g.c
flex  -t awk.lx.l > awk.lx.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.lx.c
awk.lx.l:277:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                if (c = *lexprog & 0377)
                    ~~^~~~~~~~~~~~~~~~~
awk.lx.l:277:9: note: place parentheses around the assignment to silence this warning
                if (c = *lexprog & 0377)
                      ^
                    (                  )
awk.lx.l:277:9: note: use '==' to turn this assignment into an equality comparison
                if (c = *lexprog & 0377)
                      ^
                      ==
1 warning generated.
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c b.c -std=c99
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c lib.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c main.c
main.c:56:5: error: second parameter of 'main' (argument array) must be of type 'char **'
int main(int argc, unsigned char *argv[], unsigned char *envp[])
    ^
main.c:56:5: error: third parameter of 'main' (environment) must be of type 'char **'
2 errors generated.
make[1]: *** [Makefile:136: main.o] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
make: *** [makefile:23: all] Error 2

I'm not worried about the warning, but there is a problem with nawk/main.c ?

My build/mk.config:

SHELL = /llvmtools/bin/sh
POSIX_SHELL = /llvmtools/bin/sh
ROOT ?=
DEFBIN = /llvmtools/bin
SV3BIN = /llvmtools/bin
S42BIN = /llvmtools/bin
SUSBIN = /llvmtools/bin
SU3BIN = /llvmtools/sbin
UCBBIN = /llvmtools/ucbbin
CCSBIN = /llvmtools/ccs/bin
DEFLIB = /llvmtools/lib
DEFSBIN = /llvmtools/bin
MANDIR = /llvmtools/share/man/5man
DFLDIR = /llvmtools/etc/default
SPELLHIST = /dev/null
SULOG = /llvmtools/var/log/sulog
MAGIC = $(DEFLIB)/magic
TTYGRP = -g utmp
LIBPATH = -L/llvmtools/lib -L/llvmtools/ccs/lib
# Curses library. Change to -lncurses if necessary. Caution: Some gcc
# setups on Solaris are broken so that ncurses headers are used during
# compilation, but the system libcurses is used for linking. This will
# usually lead to segmentation violations. The easiest fix is to write
# something like -L/path/to/ncurses/lib/directory -lncurses here.
#
# The 4.4 BSD curses library, which is still supplied with NetBSD 2.0,
# does not supply our needs. Use -ltermcap instead and add -DUSE_TERMCAP
# to CPPFLAGS.
#
LCURS = -ltermcap

LIBZ = -Wl,-Bstatic -lz
USE_ZLIB = 1
LIBBZ2 = -Wl,-Bstatic -lbz2
USE_BZLIB = 1

CC ?= clang
HOSTCC = clang
WARN=

LD = clang
LDFLAGS = -static $(LIBPATH)
CPPFLAGS = -D_GNU_SOURCE -DUSE_TERMCAP
CFLAGS = -O -fomit-frame-pointer $(WARN)
CFLAGS2 = -O2 -fomit-frame-pointer $(WARN)
CFLAGSS = -Os -fomit-frame-pointer $(WARN)
CFLAGSU = -O2 -fomit-frame-pointer -funroll-loops $(WARN)
STRIP = llvm-strip -s -R .comment -R .note
LARGEF = -D_FILE_OFFSET_BITS=64L

LNS = ln -s
YACC = byacc
LEX = flex

LCRYPT=-lcrypt
RANLIB=(hash llvm-ranlib) >/dev/null 2>&1 || exit 0; ranlib

########################################################################

UCBINST = $(ROOT)$(UCBBIN)/install

ICOMMON = -I../libcommon
LCOMMON = -L../libcommon -lcommon

IUXRE = -I../libuxre -DUXRE
LUXRE = -L../libuxre -luxre

MANINST = $(SHELL) ../build/maninst

@dslm4515
Copy link
Owner

Perhaps change line 56 of nawk/main.c from:

int main(int argc, unsigned char *argv[], unsigned char *envp[])

to :

int main(int argc, char *argv[], char *envp[])

@dslm4515
Copy link
Owner

@takusuman

Were you able to build it in the end?

Yes, But when installing there is an error:

make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/setpgrp'
make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/shl'
u=`uname`; \
if test "$u" != FreeBSD && test "$u" != HP-UX && \
	test "$u" != AIX && test "$u" != NetBSD && \
	test "$u" != OpenBSD && test "$u" != DragonFly ; \
then \
	/tmp/BUILD/llvmtools/ucbbin/install -c -g utmp -m 2755 shl /tmp/BUILD/llvmtools/bin/shl &&\
	llvm-strip -s -R .comment -R .note /tmp/BUILD/llvmtools/bin/shl &&\
	/llvmtools/bin/sh ../build/maninst -c -m 644 shl.1 /tmp/BUILD/llvmtools/share/man/5man/man1/shl.1; \
else \
	exit 0; \
fi
install: chown: /tmp/BUILD/llvmtools/bin/shl: Operation not permitted
make[1]: *** [Makefile:93: install] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/shl'
make: *** [makefile:37: install] Error 2

If yes, which are the versions of the musl libc, Linux kernel and LLVM?

musl libc 1.2.3
Linux kernel 6.1.8
LLVM 15.0.6

@dslm4515
Copy link
Owner

using heirloom-ng as my core utils, i cannot configure M4:

checking whether make supports nested variables... yes
usage: rm [-fir] file ...
Oops!

Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present.  This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>

Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message.  This
can help us improve future automake versions.

Aborting the configuration process, to ensure you take notice of the issue.

You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.

If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.

configure: error: Your 'rm' program is bad, sorry.

@takusuman
Copy link
Contributor Author

Rebuilt cgnutools and llvmtools far enough to reach heirloom-ng. I made sure to copy the build/mk.config and just removed the comments for easy editing. Build still fails at nawk:

make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
byacc -d awk.g.y
byacc: 46 shift/reduce conflicts, 178 reduce/reduce conflicts.
mv -f y.tab.c awk.g.c
(echo '1i'; echo '#include <inttypes.h>'; echo '.'; echo 'w';) | \
	ed -s y.tab.h
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.g.c
flex  -t awk.lx.l > awk.lx.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c awk.lx.c
awk.lx.l:277:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                if (c = *lexprog & 0377)
                    ~~^~~~~~~~~~~~~~~~~
awk.lx.l:277:9: note: place parentheses around the assignment to silence this warning
                if (c = *lexprog & 0377)
                      ^
                    (                  )
awk.lx.l:277:9: note: use '==' to turn this assignment into an equality comparison
                if (c = *lexprog & 0377)
                      ^
                      ==
1 warning generated.
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c b.c -std=c99
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c lib.c
cc -Os -fomit-frame-pointer  -D_GNU_SOURCE -DUSE_TERMCAP  -D_FILE_OFFSET_BITS=64L  -I../libcommon -I../libuxre -DUXRE -c main.c
main.c:56:5: error: second parameter of 'main' (argument array) must be of type 'char **'
int main(int argc, unsigned char *argv[], unsigned char *envp[])
    ^
main.c:56:5: error: third parameter of 'main' (environment) must be of type 'char **'
2 errors generated.
make[1]: *** [Makefile:136: main.o] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/nawk'
make: *** [makefile:23: all] Error 2

I'm not worried about the warning, but there is a problem with nawk/main.c ?

That's weird, it didn't happened at GCC + musl. Maybe it's a standards thing? Try using -std=c99 or something in nawk's CFLAGS at build/mk.config.

@takusuman
Copy link
Contributor Author

@takusuman

Were you able to build it in the end?

Yes, But when installing there is an error:

make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/setpgrp'
make[1]: Entering directory '/mnt/cmlfs/sources/heirloom-ng-230120/shl'
u=`uname`; \
if test "$u" != FreeBSD && test "$u" != HP-UX && \
	test "$u" != AIX && test "$u" != NetBSD && \
	test "$u" != OpenBSD && test "$u" != DragonFly ; \
then \
	/tmp/BUILD/llvmtools/ucbbin/install -c -g utmp -m 2755 shl /tmp/BUILD/llvmtools/bin/shl &&\
	llvm-strip -s -R .comment -R .note /tmp/BUILD/llvmtools/bin/shl &&\
	/llvmtools/bin/sh ../build/maninst -c -m 644 shl.1 /tmp/BUILD/llvmtools/share/man/5man/man1/shl.1; \
else \
	exit 0; \
fi
install: chown: /tmp/BUILD/llvmtools/bin/shl: Operation not permitted
make[1]: *** [Makefile:93: install] Error 1
make[1]: Leaving directory '/mnt/cmlfs/sources/heirloom-ng-230120/shl'
make: *** [makefile:37: install] Error 2

Well, this isn't a build issue, thankfully. It's related to permissions. For some reason, for chown'ng these files, you need to be root. It's not anything really worrying to be honest, but I need to fix this later.

@takusuman
Copy link
Contributor Author

using heirloom-ng as my core utils, i cannot configure M4:

checking whether make supports nested variables... yes
usage: rm [-fir] file ...
Oops!

Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present.  This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>

Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message.  This
can help us improve future automake versions.

Aborting the configuration process, to ensure you take notice of the issue.

You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.

If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.

configure: error: Your 'rm' program is bad, sorry.

This was already patched in the code itself (see Projeto-Pindorama/heirloom-ng@4d93437 and Projeto-Pindorama/heirloom-ng@ef33ea2).
Ironically, the cause for we having this error in the toolchain is Heirloom NG's "correctness" about UNIX standards. Please, let me explain: the default rm(1) command is updated to match the new POSIX standard (at least, partially), but the SUS variant (defined via -DSUS) isn't.
To fix it, just disable the SUS variant install, by setting SUSBIN and SU3BIN as "dummy" directories.

@dslm4515
Copy link
Owner

Well, this isn't a build issue, thankfully. It's related to permissions.

Yeah, just like elftoolchainwith it's funky bmake build system. It won't let me install unless I am root... so it had to be built under chroot

@takusuman
Copy link
Contributor Author

takusuman commented Jan 28, 2023

Well, this isn't a build issue, thankfully. It's related to permissions.

Yeah, just like elftoolchainwith it's funky bmake build system. It won't let me install unless I am root... so it had to be built under chroot

In Heirloom's case, it will install just fine, but it won't change permissions for the root user.
So I think it will install just fine on CMLFS' toolchain.

@takusuman
Copy link
Contributor Author

Just a small update: now Heirloom NG also has readlink, from BSD:
Projeto-Pindorama/heirloom-ng#19

@dslm4515
Copy link
Owner

dslm4515 commented Oct 4, 2023

I got around building CMLFS on i686 on an old laptop. Once again, GNU coreuntils fails to configure. Its getting annoying how unpredictable coreutils cab be. Then I read about why Chimera Linux does not use coreutils:

While coreutils may seem lightweight enough to not cause any issues already, there are some specific reasons the system uses a BSD-derived userland. The primary one is probably that the code of the BSD versions is overall much cleaner and easier to read. There are no cursed components such as gnulib, the codebase is leaner, and more aligned with the project’s goals.

So as long has heirloom-ng has utilities that accept the same arguments as the GNU counterparts, I am happy to drop GNU's coreutils in favor of Heirloom-ng or Chimerautils.

Alternatively, I could just fork GNU coreutils and clean up the code... But that too time consuming...

I'm planning to finish llvm-15.0.6 branch with dropping GNU's coreutils for heirloom-ng & Chimerautils.

@takusuman
Copy link
Contributor Author

So as long has heirloom-ng has utilities that accept the same arguments as the GNU counterparts, I am happy to drop GNU's coreutils in favor of Heirloom-ng or Chimerautils.

For sure! You can compare, for example, Heirloom NG's seq(1) code with GNU's one and see per yourself which is more readable/hackable. Of course these newly implemented utilities on Heirloom NG still lacking some flags/functions that original GNU ones have, but it works thoroughly well for an UNIX-compatible system.
You can also read the website if it interests you, it has some further information on the project.

@takusuman
Copy link
Contributor Author

Looks like Heirloom NG has less dependencies

I mean, it has a lot less. Basically you will just need a C library and (n)curses.
For the sake of justice with Chimera's utilities, I have to mention the fact that Heirloom NG utilities are fairly smaller and some even came back from UNIX v7 (with patches, of course).
It's really good if you doesn't have space for bigger utilities and/or you want a real UNIX environment, but you may miss some "sugar" that GNU gives (and Chimera re-implements).

@dslm4515
Copy link
Owner

dslm4515 commented Oct 5, 2023

I tried compiling coreutils on a different cpu arch (amd64 vs i686) with same package versions... it won't configure under i686. I'm not sure if the host has too old of GNU autotools... I do hate how unpredictable it is.

@takusuman
Copy link
Contributor Author

Heirloom has received a ton of changes lately (since February), most of these compiling errors won't be present in the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To do
Development

No branches or pull requests

3 participants