Discussion:
Possible problems with the current CVS version
Steven Honeyman
2014-08-18 23:37:08 UTC
Permalink
Hello,

I've been trying to get the latest CVS version of dietlibc to compile
(and work!) but not having much luck.

x86_64, gcc 4.9.1, nothing unusual
I'm using the dash shell git source (last changed in 2013) as
something to test with because I know it already works well with
dietlibc 0.33

Compiling dietlibc without modification (just "make -j1 all"), I get
lots of these errors:
/usr/bin/ld: error in /opt/diet/lib-x86_64/dyn_stop.o(.eh_frame); no
.eh_frame_hdr table will be created

After some testing, adding "-fno-asynchronous-unwind-tables" stopped
that message appearing. It seemed to work OK with a "hello world"
program, and *compiles* dash, but trying to run it I get:

$ src/dash
sh: 0: Illegal number: 1

So I think the extra CFLAG I added probably just hid the error instead
of fixing it. Has anyone had similar issues?


Thanks,
Steven.
Thorsten Glaser
2014-08-19 07:36:54 UTC
Permalink
Post by Steven Honeyman
Compiling dietlibc without modification (just "make -j1 all"), I get
/usr/bin/ld: error in /opt/diet/lib-x86_64/dyn_stop.o(.eh_frame); no
.eh_frame_hdr table will be created
Indeed.
Post by Steven Honeyman
=20
$ src/dash
sh: 0: Illegal number: 1
Must be an issue with dash ;-)

Compiling mksh from CVS gets me:

/usr/bin/ld: error in /home/tglase/dietlibc/bin-x86_64/dyn_stop.o(.eh_frame=
); no .eh_frame_hdr table will be created.

But the resulting binary passes its testsuite, modulo the
one expected-fail. This is on Debian sid.

Same with i386:
/usr/bin/ld: error in /home/tglase/dietlibc/bin-i386/dyn_stop.o(.eh_frame);=
no .eh_frame_hdr table will be created.
and no unexpected testsuite failures.

The bug in dietlibc CVS about ssize_t is still not fixed, by the way:
/home/tglase/mbsd/mksh/shf.c:458:3: warning: format '%zd' expects argument =
of type 'signed size_t', but argument 4 has type 'ssize_t' [-Wformat=3D]
Fix is in the Debian dietlibc packaging.

Of course, there does seem to be something wrong here.


I can=E2=80=99t build dash at all:

/home/tglase/dietlibc/bin-x86_64/diet -Os gcc -L/home/tglase/dietlibc/bin-x=
86_64 -DHAVE_CONFIG_H -I. -I.. -include ../config.h -DBSD=3D1 -DSHELL -DIF=
S_BROKEN -Wall -g -O2 -MT test.o -MD -MP -MF .deps/test.Tpo -c -o test.o `=
test -f 'bltin/test.c' || echo './'`bltin/test.c
bltin/test.c: In function =E2=80=98test_file_access=E2=80=99:
bltin/test.c:490:2: warning: implicit declaration of function =E2=80=98facc=
essat=E2=80=99 [-Wimplicit-function-declaration]
return !faccessat(AT_FDCWD, path, mode, AT_EACCESS);
^
bltin/test.c:490:20: error: =E2=80=98AT_FDCWD=E2=80=99 undeclared (first us=
e in this function)
return !faccessat(AT_FDCWD, path, mode, AT_EACCESS);
^
bltin/test.c:490:20: note: each undeclared identifier is reported only once=
for each function it appears in
bltin/test.c:490:42: error: =E2=80=98AT_EACCESS=E2=80=99 undeclared (first =
use in this function)
return !faccessat(AT_FDCWD, path, mode, AT_EACCESS);
^
bltin/test.c:491:1: warning: control reaches end of non-void function [-Wre=
turn-type]
}
^
Makefile:330: recipe for target 'test.o' failed


But then, it=E2=80=99s not very good or portable, anyway. You=E2=80=99re be=
tter off
with mksh. (Disclaimer: I=E2=80=99m the mksh maintainer, and mksh has prove=
n
to be a good toolchain testsuite=E2=80=A6)

bye,
//mirabilos
--=20
tarent solutions GmbH
Rochusstra=C3=9Fe 2-4, D-53123 Bonn =E2=80=A2 http://www.tarent.de/
Tel: +49 228 54881-393 =E2=80=A2 Fax: +49 228 54881-235
HRB 5168 (AG Bonn) =E2=80=A2 USt-ID (VAT): DE122264941
Gesch=C3=A4ftsf=C3=BChrer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Ale=
xander Steeg
Steven Honeyman
2014-08-19 16:34:37 UTC
Permalink
Post by Thorsten Glaser
Post by Steven Honeyman
Compiling dietlibc without modification (just "make -j1 all"), I get
/usr/bin/ld: error in /opt/diet/lib-x86_64/dyn_stop.o(.eh_frame); no
.eh_frame_hdr table will be created
Indeed.
Thanks for your reply, at least I know it isn't just me :)
Post by Thorsten Glaser
/home/tglase/mbsd/mksh/shf.c:458:3: warning: format '%zd' expects argument of type 'signed size_t', but argument 4 has type 'ssize_t' [-Wformat=]
Fix is in the Debian dietlibc packaging.
Do you know if this is still considered an "active" project? Most of
the links on the dietlibc webpage are outdated or broken so
unfortunately I'm expecting it is not.
Post by Thorsten Glaser
But then, it’s not very good or portable, anyway. You’re better off
with mksh. (Disclaimer: I’m the mksh maintainer, and mksh has proven
to be a good toolchain testsuite…)
Hmm a matter of opinion - but I do agree with you, mksh is
excellent... but compiles to twice the size
I get 173kb with dietlibc and 184kb with musl. Dash is 81kb and 98kb
respectively (and 70kb with klibc)

Thanks,
Steven.
Thorsten Glaser
2014-08-20 13:48:00 UTC
Permalink
Post by Steven Honeyman
Do you know if this is still considered an "active" project? Most of
I think it's at least somewhat active, but Felix is on holidays
right now. He has not merged back the patches we have in the
Debian packaging of dietlibc, despite repeat prodding, though.
Post by Steven Honeyman
the links on the dietlibc webpage are outdated or broken so
unfortunately I'm expecting it is not.
Oh.
Post by Steven Honeyman
Hmm a matter of opinion - but I do agree with you, mksh is
excellent... but compiles to twice the size
Sure, but=E2=80=A6
Post by Steven Honeyman
I get 173kb with dietlibc and 184kb with musl. Dash is 81kb and 98kb
respectively (and 70kb with klibc)
I get 131 KiB with klibc static, 121 KiB with klibc dynamic.

Ensure CC=3D'diet -Os gcc', of course.

You can disable, for example, the Vi command line editing mode
(-DMKSH_S_NOVI in CPPFLAGS) and hardcode UTF-8 (-DMKSH_ASSUME_UTF8
or, to hardcode disabled UTF-8 unless "set -U" is used,
-DMKSH_ASSUME_UTF8=3D0). With those, I save 16K.

There is also -DMKSH_SMALL (disables Vi mode by default) or, to be not
as hardline, -DMKSH_SMALL -DMKSH_SMALL_BUT_FAST. (another 14K or 8K)

I think the benefits (better, less buggy code; the ability to
use constructs like arrays and [[ =E2=80=A6 ]]) are well worth it. And
a more active development and wider deploy (every Android device
carries mksh as /system/bin/sh) and review.

Do note that you can link or symlink mksh to things like [,
test, echo, kill, cat in a busybox-like manner (although the
cat built into mksh has only -u as option, so no cat -v).
This should save you another few KiB.

bye,
//mirabilos
--=20
=C2=ABMyISAM tables -will- get corrupted eventually. This is a fact of life=
=2E =C2=BB
=E2=80=9Cmysql is about as much database as ms access=E2=80=9D =E2=80=93 =
=E2=80=9CMSSQL at least descends
from a database=E2=80=9D =E2=80=9Cit's a rebranded SyBase=E2=80=9D =E2=80=
=9CMySQL however was born from a
flatfile and went downhill from there=E2=80=9D =E2=80=93 =E2=80=9Cat least =
jetDB doesn=E2=80=99t claim to
be a database=E2=80=9D=09=E2=80=A3=E2=80=A3=E2=80=A3 Please, http://deb.li/=
mysql and MariaDB, finally die!

Andreas K. Foerster
2014-08-19 22:14:37 UTC
Permalink
Post by Steven Honeyman
Hello,
I've been trying to get the latest CVS version of dietlibc to compile
(and work!) but not having much luck.
x86_64, gcc 4.9.1, nothing unusual
I'm using the dash shell git source (last changed in 2013) as
something to test with because I know it already works well with
dietlibc 0.33
Compiling dietlibc without modification (just "make -j1 all"), I get
/usr/bin/ld: error in /opt/diet/lib-x86_64/dyn_stop.o(.eh_frame); no
.eh_frame_hdr table will be created
If you're not interested in dynamic linking, go to the dietfeatures.h
and comment out #define WANT_DYNAMIC . That solved the problem for me.
--
AKFoerster <http://AKFoerster.de/>
Steven Honeyman
2014-08-19 22:27:22 UTC
Permalink
Post by Andreas K. Foerster
If you're not interested in dynamic linking, go to the dietfeatures.h
and comment out #define WANT_DYNAMIC . That solved the problem for me.
I had hope... but sadly it just hides the error like my 'solution'
did. It still produces a faulty binary.
(there might of course be two problems here, or three if you include
the ssize_t problem)

Thanks,
Steven
Loading...